Skip to content
DMARC Pulse

Email errors

SPF fail: softfail vs hardfail and how to fix each

SPF fail means the sending IP is not authorized by the domain's SPF record. See how softfail and hardfail differ and how to fix each one.

What this means

SPF fail means the server that delivered the message is not authorized to send for the domain that was checked. SPF (Sender Policy Framework) is the DNS record that lists those servers.

SPF softfail vs hardfail

The prefix on all, the term that catches any IP not matched earlier, usually sets the result:

  • fail (-all), or hardfail: the server is not authorized. The receiver's local policy decides what happens next.
  • softfail (~all): the server is probably not authorized. RFC 7208 says receivers should not reject on this result alone.

Under RFC 9989, DMARC (the check against the visible From domain) treats both alike. It counts only an SPF pass on a domain that matches From under your DMARC alignment settings, so after either result DMARC depends on DKIM (a signature on the message). Microsoft adds that the DMARC policy is effectively ignored for ~all failures on messages without DKIM signatures.

SPF failure bounces and SPF validation error

A receiver that rejects on fail during delivery should reply 550. RFC 7372 assigns 5.7.23 (sample text SPF validation failed), and Microsoft documents 550 5.7.23 for bounces caused by the sending domain's SPF record. It lists an incomplete SPF record among the causes of 550 5.7.1, a code that also covers refusals unrelated to SPF, such as relaying denied. Read the text after the code.

SPF validation error is the sample text for 5.7.24 (or 4.7.24): the SPF check itself hit an error.

Why it happens

SPF checks the domain in the MAIL FROM command (the envelope sender), which can differ from the visible From address. Look for one of these causes:

  • A real sender is missing. You added a mail server or third-party service without updating SPF. If its include: is already there, check that it sits before all, because mechanisms after all are ignored.
  • The message was forwarded. A forwarder or mailing list that keeps the original MAIL FROM connects from its own IP.
  • You edited a different record. Each subdomain needs its own SPF record, so the one on example.com says nothing about mail.example.com.
  • Someone is forging the domain. Then the failure is correct.

How to fix it

  1. Open the full headers. In Gmail, click More next to Reply, then Show original. Find spf=fail or spf=softfail in Authentication-Results. In Received-SPF, the result is the first word. A message rejected during delivery has none of these headers: read the bounce, or send a test from the same source to a mailbox you control.
  2. Note the checked domain (after smtp.mailfrom= or envelope-from=) and the IP (client-ip= in Received-SPF, or CIP: in X-Forefront-Antispam-Report on Microsoft 365).
  3. Look up that domain with the SPF checker and compare its record with the IP. A ~all or -all inside an include: never sets your result.
  4. Identify the IP, then act on it:
    • Your server or provider: add ip4: (or ip6:) or the mechanism your provider documents, before all. Caution: edit the existing record. A second SPF record gives permerror (multiple SPF records), and so do more than 10 DNS lookups, nested ones included (too many lookups).
    • A forwarder or mailing list: leave your record alone. Look for dkim=pass with a header.d= domain aligned with From. With it, DMARC still passes. Without it, this message fails DMARC: make sure your domain signs with DKIM.
    • An IP you cannot identify: leave your record alone. Adding it would authorize that server.
  5. Decide on ~all or -all last. Caution: RFC 9989 warns that, at some receivers, -all can cause rejection before DMARC runs. Mail that would have passed DMARC through aligned DKIM can be lost, and those rejections never appear in aggregate reports. Move to -all only after your DMARC aggregate reports show every sending service you use passing SPF.

Confirm the fix

  1. Give DNS time. Google says SPF can take up to 48 hours to start working.
  2. Send a new message from the same source to a mailbox you control.
  3. Look for spf=pass with the same smtp.mailfrom= domain.
  4. In aggregate reports, find that source_ip and read spf in auth_results. In policy_evaluated, spf holds only the DMARC alignment result, so a softfail appears there as fail.

Check it now

Validate SPF and count DNS lookups

Frequently asked questions

Does SPF fail mean my email was rejected?
Not always. RFC 7208 leaves a fail result to the receiver's local policy, and it says receivers should not reject on softfail alone. Microsoft notes that the outcome depends on the destination system. A soft-failed message might be quarantined, sent to the Junk Email folder or delivered to the Inbox with a marker added.
What is the difference between SPF softfail and hardfail?
Hardfail is the fail result, usually from -all: the domain states that the server is not authorized. Softfail, usually from ~all, says the server is probably not authorized. A receiver may reject on fail under its local policy, while RFC 7208 says it should not reject on softfail alone. RFC 9989 counts both the same way, though Microsoft says the DMARC policy is effectively ignored for ~all failures on messages with no DKIM signature.
Should I use ~all or -all?
Fix missing senders first, because the ending authorizes nobody. Google recommends ~all. Microsoft recommends -all for Microsoft 365 domains. RFC 9989 warns that -all can cause rejection before DMARC runs, which also keeps those messages out of aggregate reports. Move to -all only after your reports show every sending service you use passing SPF.
What does SPF validation error mean?
It is the sample text RFC 7372 gives the status code 5.7.24 (or 4.7.24), which means the SPF check itself hit an error. A temperror, usually a transient DNS problem, pairs with 451. A permerror, such as two SPF records or more than 10 DNS lookups, pairs with 550 and needs a DNS fix. Servers can word this differently.
Does an SPF failure mean DMARC failed?
Not by itself. SPF cannot help that message pass DMARC, because DMARC needs an SPF pass on a domain aligned with the From address. The message can still pass DMARC through an aligned DKIM signature.
Why do forwarded emails fail SPF?
The forwarder connects from its own IP. If it keeps the original MAIL FROM, that IP is checked against the original domain's record and does not match. Adding forwarders to your record would authorize servers you do not control. An aligned DKIM signature can still pass DMARC if it survives the forward.

Sources consulted

RFC 7208 §4.6.2 Mechanisms
checked 2026-11-08
RFC 7208 §5.1 all
checked 2026-11-08
RFC 7208 §5.2 include
checked 2026-11-08
RFC 7208 §5.6 ip4 and ip6
checked 2026-11-08
RFC 7208 §8.4 Fail
checked 2026-11-08
RFC 7208 §8.5 Softfail
checked 2026-11-08
RFC 7208 §8.6 Temperror
checked 2026-11-08
RFC 7208 §8.7 Permerror
checked 2026-11-08
RFC 7208 §10.3 Mediators
checked 2026-11-08
RFC 8601 §2.7.1 DKIM
checked 2026-11-08
RFC 8601 §2.7.2 SPF
checked 2026-11-08

Related pages

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.