Enhanced Status Code 5.7.23: SPF Validation Failed
Enhanced Status Code 5.7.23 means “SPF Validation Failed.” Your message completed an SPF check that returned a fail, and the receiving server rejects on that result. The sending IP address is not authorised to send for the domain in the envelope sender.
550 5.7.23 The message was rejected because of Sender Policy Framework violation
What does 5.7.23 mean?
Enhanced status code 5.7.23 means SPF validation failed. RFC 7372 defines it as a message that completed an SPF check producing a fail result, contrary to the receiver's local policy. Note the word completed: this is a definitive fail, not an error or a timeout, which has its own code in 5.7.24.
SPF authorises IP addresses to send for the domain in the envelope sender, which is the MAIL FROM address rather than the From header your recipient sees. That distinction causes most of the confusion around this code. A message can pass SPF while the visible From header belongs to an entirely different domain, and it can fail SPF while the visible From header is perfectly legitimate, which is what happens whenever a message is forwarded. Forwarding breaks SPF by design: the forwarding server becomes the sending IP and it is not in your record.
The other frequent cause is structural rather than accidental. SPF permits a maximum of ten DNS lookups during evaluation, and every include, a, mx, ptr, exists and redirect term counts toward it. Records that accumulate one include per vendor drift past that limit and start returning permerror, which many receivers treat as a fail. A record that worked last year can begin failing with no change on your side, because a vendor expanded their own record inside your include.
How 5.7.23 plays out
5.7.23 rejectionWhere 5.7.23 sits: soft vs hard bounce
| Soft bounce (4xx) | Hard bounce (5xx) | |
|---|---|---|
| Nature | Temporary | Permanent |
| SMTP class | 4xx | 5xx |
| What to do | Let it retry | Suppress the address |
| Recoverable? | Often | No |
| 5.7.23 is | ✓ this code |
What each provider means by 5.7.23
A registered code does not oblige a provider to use it that way, and the large ones diverge. Match the wording in your own bounce, not the definition above.
Common causes of 5.7.23
- The sending IP address is genuinely not listed in the domain SPF record
- A new sending platform was added without updating the record
- The record exceeds the ten DNS lookup limit and evaluation returns permerror
- The message was forwarded, so the forwarding server IP replaces yours
- The domain publishes more than one SPF record, which is invalid and fails outright
- The record ends in -all and a legitimate sender was never added to it
How to fix 5.7.23
- Check the record and its lookup count with SPF Record Checker before changing anything
- Add every platform that sends as your domain, including invoicing, ticketing and CRM tools
- Flatten or consolidate includes if you are near the ten lookup limit
- Publish exactly one SPF record for the domain, merging any duplicates into it
- Sign with DKIM as well, because DKIM survives forwarding where SPF cannot
- Move to -all only once you have confirmed every legitimate sender is covered