// how to fix
"550 5.7.23 The message was rejected because of Sender Policy Framework violation" (SPF fail): how to fix it
The receiver rejected your email because your SPF record does not authorize the server that sent it. Find the server and update SPF.
What it means
The receiving server checked your domain's SPF record and found that the server which sent the email is not allowed to send for your domain. With Microsoft 365 and Exchange, the bounce looks like this:
550 5.7.23 The message was rejected because of Sender Policy Framework violation
Other servers use shorter wordings. The message usually looks like one of these:
550 5.7.1 SPF fail - not authorized 550 5.7.1 Rejected by SPF
SPF (Sender Policy Framework) is a TXT record in your domain's DNS that lists the servers allowed to send email for it. When a server that is not on the list sends, SPF "fails". If the record ends with -all ("reject anything else"), many receivers refuse the email straight away.
Why it happens
- A sender is missing from SPF. You started using a newsletter tool, a CRM, an online shop, a billing tool or a new email provider and did not add it.
- Your server's IP changed (new hosting, new VPS) and SPF still lists the old one.
- Two SPF records exist for the domain. That is invalid, and SPF fails for every sender.
- Too many lookups. SPF allows only 10 DNS lookups (each
include:,a,mxcounts). Above that, SPF gives an error that some receivers treat as a fail. - Forwarding. The email was sent to an address that forwards to Microsoft 365 or another mailbox. The forwarding server is not in your SPF, so the check fails there.
- Someone else is spoofing your domain. In that case, the rejection is SPF doing its job.
How to check
- Run a Delivmail test. From the same app or server that bounced, send an email to the unique address on the home page (
/). The report shows the sending IP, the domain checked by SPF (the envelope sender, or Return-Path) and the SPF result with the reason. - Scan your domain. Use
/domain-scannerto read your SPF record. It shows if there are two records, a syntax error or too many lookups. - Read the bounce headers. The bounce often contains a line such as
Received-SPF: Failwith the IP that was checked.
How to fix it
- Identify the sending service. The Delivmail report shows the IP. The service's documentation gives its SPF include, for example
include:spf.protection.outlook.comfor Microsoft 365 orinclude:_spf.google.comfor Google Workspace. - Add it to your single SPF record. Edit the existing record, do not create a second one:
v=spf1 include:spf.protection.outlook.com include:spf.newsletter-example.com ip4:203.0.113.10 -all
- Merge duplicates. If you have two
v=spf1records, combine them into one. - Stay under 10 lookups. Remove services you no longer use. Replace
aandmxwithip4:when you know the IP. - Consider
~allwhile you test. It marks unknown senders as suspicious instead of rejecting them. Go back to-allonce everything passes. - Set up DKIM too. DKIM signs the email and survives forwarding. With DKIM and DMARC in place, receivers rely less on SPF alone.
If forwarding is the cause
Ask the person to forward differently (a mailbox rule that redirects with SRS, or collecting the mail directly), or make sure your emails are DKIM-signed so DMARC can still pass.
Check that it is fixed
Wait for the DNS change to spread (often minutes, up to the record's TTL, sometimes a few hours). Run the Domain scanner to confirm there is one valid SPF record, then send a new Delivmail test from the same service: SPF should show pass. Finally, resend the email to the address that bounced.
Check that it is fixed
DNS changes can take from a few minutes to a few hours. Then send a new test email or scan your domain again.
Related guides
- No SPF record on your domainYour domain does not say which servers may send email for it. Add one TXT record and receivers can tell your real emails from fakes.
- SPF error: too many DNS lookups (permerror)SPF allows at most 10 DNS lookups. Above that, the whole record breaks and receivers treat it as invalid. Here is how to slim it down.
- Several SPF records on one domainA domain must have only one SPF record. With two or more, SPF breaks for every email. Merge them into a single line.
- SPF fails: the sending server is not authorizedYour domain has an SPF record, but the server that sent your email is not in it. Find which service sent the email and add it.
- No DKIM signature on your emailsDKIM adds a digital signature that proves an email really comes from your domain. Turn it on in your email provider and publish its key in DNS.