Guides
SPF softfail vs hardfail: ~all or -all
29 October 2026
~all (softfail) says mail from servers not in your SPF record is probably not authorized. -all (hardfail) says it is not authorized, full stop. Receivers are told not to reject on softfail alone, and may reject on hardfail. For DMARC the two are the same, because only an SPF pass counts. The real choice is how much risk you accept that a hardfail rejects legitimate mail before DMARC gets to look at it.
The four endings
The last term in an SPF record, all, matches every server not listed before it. Its qualifier sets the result. RFC 7208 section 4.6.2 defines four:
-allreturns fail. Section 2.6.4 calls it an explicit statement that the server is not authorized.~allreturns softfail. Section 2.6.5 calls it a weak statement that the server is probably not authorized.?allreturns neutral. Section 2.6.2: the domain is explicitly not saying whether the server is authorized.+all, orallwith no qualifier, returns pass for every server on the internet. Never use it.
The qualifier only affects servers that matched nothing earlier. Everything you list with include, ip4, and the rest still passes either way.
What receivers are told to do
RFC 7208 gives receivers guidance for each result:
- Fail (section 8.4): rejecting is up to the receiver’s local policy. If it rejects during the SMTP session, it should use reply code 550.
- Softfail (section 8.5): treat it as somewhere between fail and neutral. Receivers should not reject the message based solely on softfail, but may look at it more closely.
The RFC’s introduction (section 2.1) explains why -all exists at all. A domain that wants receivers to reach a firm “not authorized” conclusion has to publish a record ending in -all, or redirect to one that does. Without it, there is no definite negative answer from SPF.
Why DMARC does not care
RFC 9989, the DMARC standard, counts SPF only when it produces a pass that aligns with the From domain. Fail, softfail, neutral, and none all count the same: not a pass. So an unlisted server sending as your domain fails DMARC’s SPF half whether your record ends in ~all or -all.
That changes the question. If you have DMARC at p=quarantine or p=reject, your DMARC policy is what tells receivers how to treat spoofed mail. The SPF ending adds little protection on top. It mostly adds a second, separate way for mail to be rejected.
The risk with -all
RFC 9989 section 7.1 describes the problem. A hard fail like -all can cause a message to be rejected early in the SMTP transaction, before any DMARC processing takes place. A message that would have passed DMARC through an aligned DKIM signature can be rejected because of the SPF failure alone. And because the rejection happens before the message is accepted, it never appears in your DMARC aggregate reports.
The common case is forwarding. Someone forwards your invoice from their work address to their personal one. The forwarding server is not in your SPF record, so SPF fails. Your DKIM signature is still valid and aligned, so DMARC would pass. But a receiver that rejects on SPF fail never gets that far. Our guide to why DMARC fails covers forwarding in more detail.
The other case is a sender you forgot. With ~all, that mail gets a weak negative signal and is usually still judged on DKIM. With -all, some receivers bounce it outright, and you may not find out until a customer asks why they never got a receipt.
What Google and Microsoft recommend
They disagree, which tells you this is a judgment call.
- Google’s Set up SPF page recommends
~allin its Workspace records, for examplev=spf1 include:_spf.google.com ~all. - Microsoft’s SPF article recommends
-allfor Microsoft 365 domains, withv=spf1 include:spf.protection.outlook.com -all. It treats?allas for testing only.
Both agree on the more important point: SPF alone is not enough, and you need DKIM and DMARC as well.
How to choose
Use ~all when
- You are still finding every service that sends as your domain.
- You have no DMARC reports yet, so you cannot see what you would break.
- Your mail is often forwarded, as with invoices, receipts, and messages to people who forward work mail to a personal account.
- You already have DMARC at quarantine or reject, so spoofed mail is handled there.
Use -all when
- Your DMARC reports show every legitimate source and all of them pass.
- Each of those sources also signs with DKIM on your domain.
- You want receivers that only check SPF, with no DMARC support, to reject unlisted servers firmly.
- The domain sends no mail at all. A parked domain should publish
v=spf1 -allon its own, an example Microsoft gives directly, alongside a DMARC reject policy.
For most small businesses with a handful of senders and DMARC in place, either choice is defensible. Which one matters less than having the right includes, DKIM on every sender, and a DMARC policy you are working toward enforcing.
Switching from ~all to -all
- Run DMARC at
p=nonewith reports for a few weeks. See how to read a DMARC report. - Confirm every legitimate source in the reports passes SPF on your domain or passes aligned DKIM.
- Check the record is under ten DNS lookups, with one record at the name. Our guide on too many lookups covers the count.
- Change only the last term from
~allto-all. Everything else stays the same. - Watch for bounces and support tickets about missing email for a couple of weeks. If something breaks, change it back while you fix the sender.
Remember that hard-fail rejections do not show up in DMARC aggregate reports, per RFC 9989. Bounce messages and customer reports are how you will hear about them.
Things that are not a choice
- No
allat all. A record without anallterm (and noredirect) gives a neutral result for unlisted servers (RFC 7208 section 4.7). Add an ending. - Terms after
all. RFC 7208 section 5.1 says they are never tested. Putalllast. +all. It authorizes everyone and defeats the record. If you see it, fix it today. Our guide to creating an SPF record walks through a correct one.
Sources
- RFC 7208: SPF: sections 2.1, 2.6 (results), 4.6.2 (qualifiers), 5.1 (all), 8.4 (fail), 8.5 (softfail)
- RFC 9989: DMARC: section 7.1 (SPF hard fail and early rejection)
- Google Workspace: Set up SPF
- Microsoft Learn: Set up SPF for Microsoft 365