Fix 550 5.7.23 SPF Validation Failed (Microsoft 365)
Why Microsoft 365 and Exchange Online reject messages with 550 5.7.23 SPF validation failed, how to check the envelope sender IP, and exact DNS fixes.
550 5.7.23 The message was rejected because of Sender Policy Framework violation (SPF fail).Inspect your domain's SPF record live
Check your active SPF record, nested DNS lookup count, and detected email providers in one click.
What SMTP 550 5.7.23 means
Microsoft 365 (Exchange Online Protection) returns 550 5.7.23 when the IP address delivering your message is not authorized by the SPF record of the MAIL FROM (Return-Path) domain.
This most often happens right after one of four changes:
- You added a new SaaS tool, web server, or SMTP relay that sends as your domain without updating your SPF record.
- You tightened your SPF record from
~all(soft fail) to-all(hard fail), exposing a previously unnoticed sending source. - Your SPF record exceeded the 10-DNS-lookup limit or has duplicate
v=spf1records. - A recipient forwards mail through an intermediary server that does not rewrite
MAIL FROMwith SRS.
Find the exact failing IP and domain
Look inside the non-delivery report (NDR) returned by Microsoft 365. You will see a diagnostic block naming the exact connecting IP and sender domain:
Remote Server returned '550 5.7.23 The message was rejected because of
Sender Policy Framework violation -> 550 5.7.23 ...
[IP=203.0.113.45, domain=yourdomain.com]'Now check the live SPF record on that exact domain (whether root or subdomain):
dig TXT yourdomain.com +short | grep spf1If you want to inspect the full expanded SPF tree and see which providers are currently authorized, run our domain email deliverability audit.
Step-by-step fix
1. Authorize the missing sending service
Add your provider's official include: mechanism (or static ip4: / ip6: range) to the single v=spf1 TXT record on the envelope sender domain:
v=spf1 include:spf.protection.outlook.com include:_spf.yourprovider.com ~allNever create a second v=spf1 TXT record on the same hostname. Two SPF records cause an immediate PermError.
2. Verify you are editing the Return-Path domain
If your transactional email tool sends with Return-Path: <bounces@mail.yourdomain.com>, Microsoft 365 queries mail.yourdomain.com, not yourdomain.com. Confirm the CNAME or TXT record for that custom bounce subdomain is active and unproxied in DNS.
3. Keep total nested DNS lookups at 10 or fewer
Count nested lookups inside every include:. Microsoft 365's own include:spf.protection.outlook.com uses multiple lookups on its own, so adding too many vendors to your root record pushes you over 10. Move automated app and marketing email to a dedicated subdomain if you are near the cap.
4. Use ~all while auditing, paired with DKIM and DMARC
If tightening -all suddenly broke legitimate business mail, temporarily revert to ~all while you collect DMARC aggregate reports (rua=) to discover every tool sending as your domain. Once DKIM and SPF pass across 100% of legitimate streams, enforce via DMARC (p=quarantine or p=reject), which also handles forwarded mail cleanly when DKIM passes.
Or let Sequenzy manage your sending subdomain and return path
Sequenzy isolates your app and marketing sending onto a verified custom return-path subdomain with managed DKIM keys and ongoing DNS health checks, so adding transactional or lifecycle email never collides with your Microsoft 365 root SPF record.
Official sources
- Microsoft Learn: Fix email delivery issues for error code 550 5.7.23 in Exchange OnlineChecked 2026-12-04
- RFC 7208: Sender Policy Framework (SPF)Checked 2026-12-04