Siftsmith Run on Apify
← All email error fixes

Fix 550 5.7.23: SPF validation failed (Exchange Online)

Microsoft 365 sent your message, and the destination server rejected it because SPF failed: the server it came from isn’t listed in the SPF record of your envelope sender domain. Check that record below, then find the server it doesn’t list and add it.

Last verified 9 October 2026.

What “550 5.7.23” means

Microsoft’s list of Exchange Online bounce codes gives 5.7.23 this message and explanation:

5.7.23 The message was rejected because of Sender Policy Framework violation
“The destination email system uses SPF to validate inbound mail, and an issue affects your SPF configuration.”

The code itself comes from RFC 7372 §3.2, which registers X.7.23 with the sample text “SPF validation failed” and says it “is returned when a message completed an SPF check that produced a ‘fail’ result, contrary to local policy requirements.” So you may see either wording. In order, this is what happened:

  1. Your Microsoft 365 organisation sent the message to an outside domain.
  2. The destination server checked SPF for the domain in the envelope sender (the MAIL FROM, shown as Return-Path), not the From: address you see. For mail a Microsoft 365 user sends, that is normally the sender’s own domain.
  3. The result was fail. The IP the message came from isn’t authorized by that domain’s SPF record, usually because the record ends in -all and doesn’t list that IP (RFC 7208 §2.6.4: fail “is an explicit statement that the client is not authorized to use the domain in the given identity”).
  4. The destination rejected the message, and Exchange Online sent you the bounce. Microsoft: “The Diagnostic information for administrators section in the bounce message will contain the original error message when Office 365 tried to send the message to the external email server or service.” That original reply is the destination’s own wording and may name the IP and domain it checked.

Who fixes it: the sending side. Microsoft’s fix page says “Only an email admin in your Microsoft 365 or Office 365 organization can fix this issue.” If you got the bounce as a user, forward it to your admin. The recipient can’t make your SPF pass: the record and the sending servers are yours.

A 5xx code is a permanent rejection: resending the same message the same way gets the same bounce.

Sources: Microsoft Learn, Fix NDR error “550 5.7.23” in Exchange Online and Email non-delivery reports and SMTP errors in Exchange Online; RFC 7372 §3.2; RFC 7208 §2.6.4 and §8.4 (checked 9 October 2026).

Check the SPF record behind the bounce

Enter the domain from the Return-Path of the bounced message (usually the domain in your own address). The lookups run in your browser against public DNS: they read the SPF record, follow every include and redirect, count DNS lookups, and show whether Microsoft 365’s include is in the record before its all.

What this can and can’t tell you: it reads the records the domain publishes right now, through Cloudflare’s public resolver (Google’s when Cloudflare’s fails). A lookup that fails shows as unknown, never as missing. It doesn’t test a specific IP address against the record. For the PermError detail of every term, use the SPF PermError check; for a full A–F grade with DMARC and DKIM, the DMARC checker.

Find the server and domain that failed

Fix it

Microsoft’s fix page lists these steps: verify the SPF record, provision all your domains, add on-premises IPs, and check whether the message went out through the High Risk Delivery Pool. Here is each one, with the record changes.

1. Authorize Microsoft 365 in the SPF record

Microsoft: “Most Microsoft 365 organizations require include:spf.protection.outlook.com in the SPF TXT record for the domain.” For a domain that sends only through Microsoft 365:

v=spf1 include:spf.protection.outlook.com -all

GCC High and DoD use include:spf.protection.office365.us, and Microsoft 365 operated by 21Vianet uses include:spf.protection.partner.outlook.cn. You publish the record at your DNS host; Microsoft 365 has no setting for it.

2. Add on-premises servers and other senders

Microsoft: “Add your on-premises IPs, if any, to the SPF record of any domains you send for. This would include any unprovisioned domains you might be relaying through Microsoft 365 or Office 365.” In a hybrid setup, that is the public IP your Exchange Server sends from. Other services that send with your domain in the Return-Path (a CRM, help desk, newsletter tool) need their own include:, from their setup guide.

Before: a hybrid organisation’s on-premises server at 192.0.2.25 (a documentation address; use your own) sends mail for example.com, and the record lists only Microsoft 365, so that server’s mail gets SPF fail:

v=spf1 include:spf.protection.outlook.com -all

After: the same record, edited in place, with the server added:

v=spf1 ip4:192.0.2.25 include:spf.protection.outlook.com -all

Two rules while you edit. Keep one SPF record per name: Microsoft says multiple SPF records “cause SPF to return permerror”, so add to the existing record rather than publishing a second (merge duplicates). And stay at 10 DNS lookups or fewer: each include, a, mx, ptr, exists and redirect counts, nested ones too, while ip4 and ip6 don’t (how to cut them). Over 10 is a PermError, and SPF can’t pass at all.

3. Provision every domain you send from

Microsoft: “Provision all of the domains you own. We limit the number of emails with unprovisioned domains that a tenant can send.” Add each domain your users or applications send as to Microsoft 365 as an accepted domain, and give it an SPF record. A domain you own but never send from can publish v=spf1 -all.

4. Check for the high-risk delivery pool

Microsoft sends outbound mail it determines to be spam through a separate high-risk delivery pool, and its fix page says: “Messages in the High Risk Delivery Pool won’t pass SPF checks, and therefore won’t be accepted by the destination email organization.” Microsoft also says “Messages where the source email domain has no A record and no MX record defined in public DNS are always routed through the high-risk delivery pool”; the checker above tests for that. If message trace shows this pool and the message wasn’t spam, look for a compromised account or a misbehaving application first, then contact Microsoft support, as the fix page advises.

5. Forwarded and relayed mail

Forwarding resends a message from the forwarder’s server, so the original sender’s SPF can’t cover it. Microsoft 365 handles most of this with the Sender Rewriting Scheme, which “rewrites the MAIL FROM address … for all applicable messages sent from Microsoft 365 to external recipients”, so SPF is checked against your forwarding domain, which your record covers with step 1. The case it doesn’t fix is the relay pool: in some cases Microsoft sends forwarded or relayed mail from a separate pool that is “not part of published SPF record for Microsoft 365”. A message avoids it if the sender is in one of your accepted domains or SPF passed when the message arrived. Microsoft’s SRS page: “This behavior mainly affects messages entering Exchange Online that fail SPF checks. SRS doesn’t fix these failures.” If your MX points to another service or an on-premises server first, Microsoft recommends Enhanced Filtering for Connectors so SPF is evaluated correctly on arrival.

SRS can make SPF pass for a forward, but SPF then passes for your forwarding domain, not the original sender’s, so DMARC still depends on the original DKIM signature. See DMARC alignment failed for how that works.

Sources: Microsoft Learn, Fix NDR error “550 5.7.23” in Exchange Online; Set up SPF to identify valid email sources for your Microsoft 365 domain; Outbound delivery pools; Sender Rewriting Scheme (SRS) in Microsoft 365 (checked 9 October 2026).

5.7.23 and similar bounces

5.7.23SPF ran and gave fail: the sending IP isn’t in the record. This page.
5.7.24RFC 7372’s “SPF validation error”: SPF couldn’t be evaluated (permerror or temperror). See SPF PermError and SPF TempError.
5.7.509The message failed DMARC and the From: domain’s policy is p=reject. See fixing 550 5.7.509.
5.7.515Outlook.com’s rule for high-volume senders: the domain doesn’t meet the required SPF, DKIM and DMARC level. See fixing 550 5.7.515.

FAQ

Who has to fix 550 5.7.23?

The sending side. The destination server rejected your message because SPF failed for your envelope sender domain, and only that domain’s SPF record, or the server the mail left from, can change the result. Microsoft says only an email admin in your Microsoft 365 organization can fix it, so forward the bounce to your admin.

My SPF record includes spf.protection.outlook.com. Why does it still fail?

Because the message left from a server that the record doesn’t cover: an on-premises or hybrid server, another service sending as your domain, or one of Microsoft’s separate pools. Mail Microsoft classifies as spam goes out through the high-risk delivery pool, which Microsoft says won’t pass SPF checks, and some forwarded or relayed mail goes through the relay pool, which isn’t part of Microsoft 365’s published SPF record. Message trace shows which pool sent it.

Should I change -all to ~all to stop the bounces?

No. RFC 7372 defines 5.7.23 for an SPF fail result, which -all produces, and some receivers may accept a softfail instead, but the message still isn’t authenticated, and Microsoft says DMARC treats -all and ~all as SPF failures. Microsoft recommends -all for Microsoft 365 domains. Add the missing server to the record instead.

Can forwarding cause 550 5.7.23?

Yes. A forwarded message reaches the destination from the forwarder’s server, not yours. Microsoft 365 rewrites the envelope sender of mail it autoforwards (Sender Rewriting Scheme), so SPF is checked against the forwarding domain. But a forwarded or relayed message that isn’t from one of your accepted domains and failed SPF when it arrived can go out through Microsoft’s relay pool, which isn’t in Microsoft 365’s SPF record, and SRS doesn’t fix that.

Checking many domains?

If you manage sending domains for clients or brands, Email Security Signals runs SPF, DMARC and DKIM checks on a whole list and returns one row per domain with the DMARC policy, SPF lookup count, DKIM selectors found and an A–F grade, ready to export as CSV. $0.02 per graded domain ($20 per 1,000); invalid inputs, domains that don’t exist, DNS lookup failures and duplicates are free.

Check a list on the Apify Store →

Related: fixing 550 5.7.509 (DMARC policy of reject), fixing 550 5.7.515 (Outlook.com high-volume senders), fixing SPF PermError, fixing SPF “too many DNS lookups” and the free DMARC, SPF and DKIM checker.