5.7.23 means the message failed SPF: the sending server is not in the SPF record of the domain in its Return-Path. Microsoft 365 uses it in that sense. Gmail’s temporary 4.7.23 means something else — a missing PTR record.
| Code | 5.7.23 |
| Meaning | SPF validation failed |
| Kind | Permanent failure — the sender gives up |
| Sent in reply to | With 550 |
| What the sender does | Returns the message to the sender |
| Defined in | RFC 7372 |
Paste your bounce
Paste the line with the code — or the whole bounce: we explain each code in it, say whether the sender will try again, and link the service’s own page where it has one. It is read in your browser; nothing is sent.
What causes it
- A new sending service or server not yet added to the SPF record.
- Mail forwarded by a server that is not in your record.
- At Microsoft 365: mail routed through its High Risk Delivery Pool, which does not pass SPF.
What to do
- Add the sending service’s include, or the server’s address, to your SPF record — and stay within ten DNS lookups.
- Sign with DKIM too, so mail still passes DMARC when SPF breaks in forwarding.
What each provider means by it
| Who | What they say |
|---|---|
| Microsoft 365 | 550 5.7.23 The message was rejected because of Sender Policy Framework violation. |
| Gmail | Reports SPF failures as 5.7.26 or 5.7.27; its 451 4.7.23 is about a missing PTR record. |
Bounces with this code
- Microsoft 365 550 5.7.23: rejected because of Sender Policy Framework violation
- Message rejected due to: SPF fail – not authorized (550 5.7.23)
Related: 5.7.26, 5.7.24, 5.7.27.
Sources
Checked on 27 September 2026 against these official sources:
- Simple Mail Transfer Protocol (SMTP) Enhanced Status Codes Registry — iana.org
- RFC 7372: Email Authentication Status Codes — rfc-editor.org
- Email nondelivery reports (NDRs) and SMTP errors in Exchange Online — learn.microsoft.com
- Fix NDR error 5.7.23 in Exchange Online — learn.microsoft.com
- Gmail SMTP errors and codes — knowledge.workspace.google.com