Microsoft 365 550 5.7.23: rejected because of an SPF violation
Updated · 3 min read
Microsoft 365:550 5.7.23
In short
- Another organisation's mail server refused your message because SPF failed for your domain; Microsoft 365 reports that refusal to you as 5.7.23.
- Usually the SPF record lacks include:spf.protection.outlook.com, is duplicated, or needs more than ten lookups.
- Also check whether Microsoft treated the message as outbound spam: mail it routes through its High Risk Delivery Pool does not pass SPF.
Check your SPF record now
Type the domain your users send from.
On this page
The bounce, as Microsoft documents it
550 5.7.23As Microsoft's list of Exchange Online errors prints itThe message was rejected because of Sender Policy Framework violation
Read on . Providers reword these messages without notice, so treat the text as a dated snapshot and check the source before acting on anything consequential.
You sent from Microsoft 365, and the receiving organisation's mail server refused the message because SPF failed for your domain. Microsoft reports that refusal back to you as 5.7.23; the receiving server's own words are in the bounce, under Diagnostic information for administrators.
Microsoft's page for this code says only an email admin in your organisation can fix it, and that it most likely indicates an SPF configuration issue there. It also names a cause that has nothing to do with DNS: messages Microsoft routes through its High Risk Delivery Pool will not pass SPF checks.
Most likely causes
- The SPF record does not include Microsoft 365. Microsoft documents that most Microsoft 365 organisations need include:spf.protection.outlook.com in the record.
- The record is broken. A second SPF record at the same name, a syntax slip — Microsoft lists a trailing dot after the domain, an equals sign instead of a colon, and a space after the colon — or a record needing more than ten DNS lookups: each makes SPF fail.
- Other systems relay through Microsoft 365. Microsoft asks you to add your on-premises addresses to the SPF record of every domain you send for, and to provision every domain you own in the tenant.
- Microsoft treated the message as outbound spam and sent it through its High Risk Delivery Pool, which does not pass SPF. A compromised account sending spam is the usual reason.
When the problem is not your DNS
If the record is correct and the bounces continue, look at the account that sent the message. Microsoft says outbound messages it identifies as spam can be routed through the High Risk Delivery Pool, and that those messages won't pass SPF checks.
Microsoft's suggestions are to receive copies of outbound messages it classifies as spam, by configuring outbound spam policy notifications, and to contact Microsoft support if a message was classified wrongly. A sudden run of 5.7.23 bounces from one mailbox is also a reason to check that mailbox for compromise.
How to fix it
For Microsoft 365 alone, Microsoft's documented record is v=spf1 include:spf.protection.outlook.com -all. Add the include or address range of every other service that sends as your domain.
Use -all once you are sure every sender is listed. While you are still finding them, ~all keeps a forgotten sender's mail from being refused outright — but Microsoft notes that a ~all failure on a message without a DKIM signature leaves DMARC unable to act, so do not stay there.
Keep exactly one SPF record, without the syntax slips above, under ten DNS lookups.
If you relay on-premises mail through Microsoft 365, add those servers' public addresses with ip4 or ip6, and add every domain you send from to the tenant.
If the message went out as spam, secure the account first: reset its password and review its sign-ins and mailbox rules.
How to confirm the fix worked
Run the SPF check: one record, with the Microsoft include, at ten lookups or fewer.
Send the message again. If it bounces a second time, read the receiving server's own text under Diagnostic information for administrators — it may name a different reason.
Check your domain with the SPF checker