An SPF fail means the server that sent a message is not on the list of servers allowed to send for the envelope sender’s domain, and that domain’s SPF record ends in -all. The domain owner has said, in DNS, that anything else is not genuine. Receivers can reject the message, send it to spam, or fall back on DKIM and DMARC.
The error message
You usually meet an SPF fail in one of two places. In the headers of a delivered message:
Received-SPF: fail
Authentication-Results: mx.example.net; spf=fail smtp.mailfrom=yourdomain.com
Or as a rejection. Gmail’s SMTP error reference lists:
550 5.7.26 The (E)MAIL FROM domain [domain-name] has an SPF record with a hard fail policy (-all) but it fails to pass SPF checks with the ip: [ip-address]. To best protect our users from spam and phishing, the message has been blocked.
What it means
SPF is defined in RFC 7208. A check returns one of several results. The two that confuse people:
| Result | Record ends in | RFC 7208 meaning |
|---|---|---|
| fail | -all |
An explicit statement that the client is not authorized to use the domain. |
| softfail | ~all |
A weak statement that the host is probably not authorized. |
| permerror | (any) | The record could not be interpreted, for example a syntax error or too many lookups. |
What a receiver does with a fail is local policy. RFC 7208 suggests rejecting with 550 and enhanced code 5.7.1; RFC 7372 later added 5.7.23, “SPF validation failed”, for the same purpose.
Why it happens
- A sending service is missing from your record: a new CRM, helpdesk, billing tool or email API.
- The message was forwarded. The forwarder’s IP sends on behalf of your domain but is not in your record.
- The provider uses your domain as the return path without you adding its include.
- Two SPF records exist on the same name, which is a permerror, not a fail, but many tools display both the same way.
- Someone really is spoofing your domain. In that case the fail is SPF doing its job.
How to fix it
- Read the headers of a failing message. Note the
smtp.mailfromdomain and the sending IP. - Find who owns that IP. If it is a service you use, it belongs in your record.
- Merge into one record:
Replace the includes with your own providers.yourdomain.com. TXT "v=spf1 include:_spf.google.com include:spf.protection.outlook.com -all" - Keep it under 10 DNS lookups. See SPF too many lookups.
- Use
~allwhile you are still finding senders, then move to-allonce reports show nothing legitimate failing. - Add DKIM and DMARC. DKIM survives forwarding, and DMARC (RFC 9989) passes if SPF or DKIM passes and aligns. A starting record:
Our SPF, DKIM and DMARC guide covers the order._dmarc.yourdomain.com. TXT "v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com"
Which server sent it
| Provider | How SPF fail shows up |
|---|---|
| Gmail | Rejects with 550 5.7.26 when SPF hard fails, and requires all senders to pass SPF or DKIM. Bulk senders failing SPF can get 550 5.7.27. |
| Microsoft 365 | Its own outbound bounces report destination SPF rejections as 550 5.7.23. Outlook.com requires SPF, DKIM and DMARC for senders of over 5,000 messages a day. |
| Yahoo | Lists authentication failures as a cause of 5xx rejections and requires SPF or DKIM from all senders. |
| Generic servers | 550 5.7.1 or 550 5.7.23 with SPF text, or acceptance with spam filing. |
Is it temporary?
A rejection for SPF fail is permanent: retrying from the same IP fails until the record changes. An SPF temperror (a DNS lookup timed out) is the temporary case. Gmail, for example, answers with 451 4.7.26 when temporary DNS failures prevent it from authenticating a message under a DMARC policy, and your server retries.
How Mailcandor handles it
Every domain you add to Mailcandor gets a return path on send.<domain> with its own SPF, plus three DKIM records, so SPF and DKIM both align without touching your main record. The deliverability coach checks SPF, DKIM and DMARC and explains bounces in plain English, and hard bounces are suppressed automatically. Decode any code with the free bounce code lookup, or browse all error codes. More free checks are on the tools page.