My SPF checker used to put a warning on every record that ended in ~all. Then I ran it on google.com.
$ dig +short TXT google.com | grep spf
"v=spf1 include:_spf.google.com ~all"
And here is microsoft.com:
$ dig +short TXT microsoft.com | grep spf
"v=spf1 include:_spf-a.microsoft.com include:_spf-b.microsoft.com include:_spf-ssg-a.msft.net include:_spf1-meo.microsoft.com -all"
Google ends with ~all, Microsoft ends with -all. My tool flagged the first and was happy with the second. So according to my own checker, Google had SPF set up wrong. That was enough to stop trusting my memory of the qualifiers and reread RFC 7208.
What the qualifier in front of all means
all matches any sender that got past the earlier mechanisms without a match. The qualifier in front of it decides what result that sender gets (RFC 7208, sections 4.6.2 and 5.1):
-
+allgives pass. Every server on the internet is allowed to send as your domain. -
?allgives neutral. The owner says nothing either way. -
~allgives softfail. Probably not allowed, treat with suspicion. -
-allgives fail. Not allowed.
The part I had forgotten is what happens when there is no all at all. Section 4.7: if nothing matches and there is no redirect=, the result is neutral, "just as if ?all were specified". A record without all behaves like ?all. So a record that says nothing about strangers is weaker than one that says ~all, and my warning was pointing at the wrong one.
Why ~all is a reasonable choice
If the domain has DMARC, what counts for DMARC is whether SPF passed and whether the domain aligns. Softfail and fail are both just "did not pass", and DMARC's own policy decides what happens to the message.
Where -all can bite is forwarding. The forwarding server is not in your SPF record, so the forwarded message fails SPF. Some receivers reject a hard fail during the SMTP conversation, before they look at DKIM, so the message bounces even though a valid DKIM signature would have saved it. RFC 7489 says this directly in section 10.1: operators choosing -all "should be aware of this". That is the usual argument for ~all, and I think it's a fair one. Either way it's a trade-off, and a checker has no business deciding it for you.
One more trap: redirect=
Look at gmail.com:
$ dig +short TXT gmail.com | grep spf
"v=spf1 redirect=_spf.google.com"
There is no all in this record. The policy lives in _spf.google.com, which ends in ~all. A checker that only reads the top record and greps for all would report gmail.com as having no all, which is wrong. You have to follow redirect= before you judge the ending.
What is worth a warning
-
+all: a real problem. Anyone can pass SPF as you. Loud warning. -
?all: tells receivers nothing. Warning. - no
alland noredirect=: same as?all. Warning. -
~allor-all: no warning, just a note on the difference.
Today google.com gets a 100/100 estimate in my checker and the line "No obvious SPF structure warning was found in this limited check."
Checking your own record
Linux or macOS:
dig +short TXT example.com | grep spf
Windows PowerShell:
Resolve-DnsName example.com -Type TXT | Where-Object { $_.Strings -match 'spf1' } | Select-Object -ExpandProperty Strings
Then read the last term. If it's +all, fix it today. If it's ?all or missing, decide what you want to say about senders you didn't list. If it's ~all or -all, you're fine on this point, and the choice between them is about forwarding and DMARC, not about being "strict enough".
The gap between ~all and -all is much smaller than the warning I used to print.
If you run -all on a domain that receives a lot of forwarded mail, have you actually seen bounces from it? I'd like to know how often it happens in practice.
I build MyIPScan, and the SPF checker there is the one that had this bug.
The case and the data are ours, from MyIPScan, checked against the live site. AI helped with the wording.
Top comments (1)
to your question, honestly the bounces i've seen with -all were old forwarding setups, like alumni or college addresses and some mailing lists. the big forwarders mostly rewrite the sender (SRS) so it doesn't hit as much. one more thing a checker can warn on is the 10 DNS lookup limit, a record can look perfectly fine and still return permerror once the includes get expanded, and that one actually breaks mail