Support Library
Microsoft 365 Email Deliverability Troubleshooting
A step-by-step workflow for Exchange Online and Microsoft Defender for Office 365 admins: find the message, learn which filter made the decision, and fix the cause instead of adding allow entries.
The short answer
Start with a message trace in the Exchange admin center. It tells you whether Microsoft 365 received the message and whether it was delivered, quarantined, filtered as spam or failed. If it was quarantined, the Quarantine page in the Microsoft Defender portal names the policy. If it was delivered to Junk or never arrived, read the message headers: compauth and its reason code in Authentication-Results, and SFV and CAT in X-Forefront-Antispam-Report, tell you which check decided.
Most Microsoft 365 delivery problems come from three places: a sender whose SPF, DKIM or DMARC does not line up, a filtering gateway in front of Microsoft 365 without Enhanced Filtering for Connectors, or an old allow or block entry. Broad allows such as a mail flow rule that sets SCL -1 for a whole domain hide the real problem and let spoofed mail through.
Setting up a domain: the DNS checklist
Use this list for a new custom domain in Microsoft 365, or to audit one that already sends mail. Several values are specific to your tenant and domain, so copy them from the Microsoft 365 admin center and the Microsoft Defender portal, not from a guide or another tenant.
| Step | Record | Where the value comes from |
|---|---|---|
| 1. Verify the domain | TXT at the domain, starting MS=ms | Admin center: Settings, Domains, Add domain |
| 2. Route mail to Exchange Online | One MX record pointing to a tenant-specific host, such as example-com.mail.protection.outlook.com. Newer domains may be given a host under mx.microsoft instead. | Admin center, the domain's DNS records page. Use exactly the host it shows. |
| 3. Autodiscover | CNAME autodiscover to autodiscover.outlook.com | Admin center DNS records page |
| 4. SPF | One TXT record such as v=spf1 include:spf.protection.outlook.com -all, with any other senders added to the same record | Microsoft's SPF guidance. Never add a second v=spf1 record. |
| 5. DKIM | Two CNAMEs, selector1._domainkey and selector2._domainkey, pointing to targets Microsoft generates for your domain | Defender portal: Email authentication settings, DKIM. Publish both CNAMEs, then enable signing there. The target format has changed over time, so copy the values shown for your domain. |
| 6. DMARC | TXT at _dmarc, starting with v=DMARC1; p=none; rua=mailto:... | You write it. Move to quarantine and reject in stages, as in Email Phishing Protection. |
| 7. Device enrollment (optional) | CNAMEs for enterpriseregistration and enterpriseenrollment | Only if you use Intune or Entra ID device registration; see device enrollment records |
If mail passes through a third-party gateway before Microsoft 365, the MX points to the gateway instead, and Enhanced Filtering for Connectors should be turned on so Microsoft sees the original sender. See step 5 of the troubleshooting below.
Checking the setup
| Command | What you want to see |
|---|---|
| dig +short MX example.com | Only the host the admin center gave you (or your gateway) |
| dig +short TXT example.com | One v=spf1 record that includes spf.protection.outlook.com |
| dig +short CNAME selector1._domainkey.example.com | The target the Defender portal shows; repeat for selector2 |
| dig +short TXT _dmarc.example.com | One record starting v=DMARC1 |
| Resolve-DnsName example.com -Type MX | The MX check from Windows PowerShell |
The admin center's domain health check flags missing or wrong records. Then send a test message to an outside mailbox and read the Authentication-Results header: SPF, DKIM and DMARC should each pass for your domain. If something still fails, work through the troubleshooting steps below.
Match the symptom to a starting point
| Symptom | Likely cause | Look first |
|---|---|---|
| The sender gets a bounce with 550 5.7.509 mentioning DMARC | The sending domain publishes p=reject and the message failed DMARC | The sender's SPF and DKIM, and Authentication-Results on a sample |
| Your mail to Outlook.com or Hotmail bounces with 550 5.7.515 | Microsoft's rules for senders of 5,000 or more messages a day to its consumer mailboxes: SPF, DKIM and DMARC must be in place and pass | Your own SPF, DKIM and DMARC records |
| Message trace status is Quarantined | An anti-spam, anti-phishing or anti-malware policy, or a mail flow rule | The Quarantine page: reason and policy type |
| Message trace status is Filtered as spam | Spam filtering rejected or blocked the message without quarantining it | Anti-spam policy actions and the Tenant Allow/Block List |
| Delivered, but in Junk Email | Spam verdict, a user's Blocked Senders list or a spoof verdict | SFV, CAT and compauth in the headers |
| Your users get 550 5.1.8 when sending | The account was restricted from sending, often after a compromise sent spam | Restricted entities in the Defender portal, then the account's sign-ins |
| No trace record at all | The message never reached Microsoft 365: the MX points elsewhere, a gateway held it, or the sender never sent it | Your MX records and any gateway's own logs |
Step 1: run a message trace
In the Exchange admin center at admin.exchange.microsoft.com, go to Mail flow > Message trace. A new trace covers the last two days by default and can reach back 90 days. Searches of 10 days or less return a summary on screen. Anything longer, and the Enhanced summary and Extended reports, are prepared as downloadable CSV files from archived data and can take several hours.
Filter by sender, recipient, subject or Message ID. The Message ID is the value of the Message-ID header, including the angle brackets, so ask the user for the headers rather than a screenshot. Select a result to open its Message events: Receive, Deliver, Fail, Defer, Expand, Transfer and DLP rule entries show each step. The Extended report adds a custom_data column: values starting S:SFA come from the spam filter and S:TRA from mail flow rules, with the ID of the rule that matched.
In Exchange Online PowerShell (module 3.7.0 or later), Get-MessageTraceV2 and Get-MessageTraceDetailV2 replace the older message trace cmdlets. They return up to 5,000 results per query, and a tenant can run 100 queries in any five minutes.
| Task | Command |
|---|---|
| Connect to Exchange Online | Connect-ExchangeOnline |
| Trace one sender over the last two days | Get-MessageTraceV2 -SenderAddress [email protected] -StartDate (Get-Date).AddDays(-2) -EndDate (Get-Date) |
| Trace one message by its Message-ID | Get-MessageTraceV2 -MessageId "<[email protected]>" |
| Show the events for a recipient's messages | Get-MessageTraceV2 -RecipientAddress [email protected] | Get-MessageTraceDetailV2 |
| Request a report older than 10 days | Start-HistoricalSearch -ReportTitle "Sender trace" -ReportType MessageTrace -SenderAddress [email protected] -StartDate 2026-10-01 -EndDate 2026-10-20 -NotifyAddress [email protected] |
Step 2: check quarantine
In the Defender portal at security.microsoft.com, go to Email & collaboration > Review > Quarantine. The Quarantine reason column says which verdict caught the message (spam, high confidence spam, bulk, phishing, high confidence phishing, malware or a mail flow rule), Policy type names the policy, and Expires shows when the message is deleted.
Release a message only after checking why it was caught. When you release a false positive you can also report it to Microsoft as clean and allow the sender, which creates an entry in the Tenant Allow/Block List. Quarantine policies decide what users may do themselves: by default they cannot release high confidence phishing or malware.
| Task | Command |
|---|---|
| List quarantined messages from one sender | Get-QuarantineMessage -SenderAddress [email protected] |
| Release a message to all its recipients | Get-QuarantineMessage -MessageId "<[email protected]>" | Release-QuarantineMessage -ReleaseToAll |
Step 3: read SPF, DKIM, DMARC and composite authentication
Microsoft 365 records each check in Authentication-Results and then combines them into composite authentication, compauth, judged against the From domain. A compauth=fail can still be delivered if nothing else looks suspicious, but it is the usual reason for a spoof verdict. The reason code says why:
| Reason | Meaning |
|---|---|
| 000 | Failed DMARC, and the sending domain's policy is p=quarantine or p=reject |
| 001 | Failed implicit authentication: the domain has no records, or only weak ones (SPF ~all or DMARC p=none) |
| 010 | Failed DMARC with an enforcing policy, and the domain is one of your own accepted domains |
| 100 to 102 | Passed: SPF or DKIM passed for a domain aligned with the From address |
| 601 | The sending domain is one of your accepted domains, sent from outside (self-to-self spoofing) |
| 905 | DMARC was not enforced because of complex routing, such as a non-Microsoft filter in front of Microsoft 365 |
Mail you send. Your SPF record needs include:spf.protection.outlook.com and every other service that sends as your domain. Without your own DKIM keys, Microsoft 365 signs with your onmicrosoft.com domain, which does not align with your From address, so DMARC rests on SPF alone and breaks when mail is forwarded. Turn on DKIM for each custom domain in the Defender portal under Email authentication settings > DKIM. It asks for two CNAME records, selector1._domainkey and selector2._domainkey. Newer domains point them at a host such as selector1-example-com._domainkey.contoso.n-v1.dkim.mail.microsoft, older ones at contoso.onmicrosoft.com, so copy the exact values from the portal or PowerShell rather than from an old guide.
Mail you receive. If a partner's mail fails, the fix is in their DNS, and the header gives you the evidence to send them. Anti-phishing policies decide whether Microsoft 365 honours a sender's p=quarantine or p=reject. When a legitimate service sends as someone else's domain, spoof intelligence may block it; allow that pair of spoofed domain and sending infrastructure rather than the whole domain.
| Task | Command |
|---|---|
| Show DKIM status and the CNAME targets | Get-DkimSigningConfig -Identity example.com | Format-List Name,Enabled,Status,Selector1CNAME,Selector2CNAME |
| Create DKIM keys for a domain, disabled | New-DkimSigningConfig -DomainName example.com -Enabled $false |
| Turn on DKIM once both CNAMEs resolve | Set-DkimSigningConfig -Identity example.com -Enabled $true |
| Check the CNAME from any computer | nslookup -type=CNAME selector1._domainkey.example.com |
Step 4: use allow and block lists sparingly
The Tenant Allow/Block List (Defender portal, Threat policies > Tenant Allow/Block Lists) is the supported way to override a verdict. Entries for domains and addresses match the From address, block entries win over allow entries, and an entry takes effect within about five minutes.
- Allows for domains and addresses can override spam, high confidence spam, bulk and phishing verdicts. For high confidence phishing or malware, submit the message on the Submissions page as clean and choose to allow it. Allows created that way are removed 45 days after the filter last needed them.
- Spoofed senders is a separate tab: an allow there covers one spoofed domain from one sending infrastructure.
- Blocks for domains and addresses treat matching mail as high confidence phishing and also stop your users sending to those addresses. To treat a sender as ordinary spam instead, use the blocked senders list in an anti-spam policy.
- Avoid mail flow rules that set SCL -1 for whole domains, the anti-spam allowed domains list, and adding shared provider IP addresses to the connection filter IP Allow List. All three skip filtering for anyone who can forge the matching value.
- Phishing simulations from a third-party vendor belong in the advanced delivery policy, not in allow entries.
| Task | Command |
|---|---|
| List sender allow and block entries | Get-TenantAllowBlockListItems -ListType Sender |
| Block one sender address | New-TenantAllowBlockListItems -ListType Sender -Block -Entries "[email protected]" |
| Allow one spoofed domain from one sending infrastructure | New-TenantAllowBlockListSpoofItems -Identity Default -Action Allow -SpoofedUser example.org -SendingInfrastructure 192.0.2.0/24 -SpoofType External |
Step 5: check connectors and gateways
Connectors live in the Exchange admin center under Mail flow > Connectors. Two setups cause most connector problems.
A filtering service in front of Microsoft 365. When your MX points at Proofpoint, Mimecast or another gateway, every message reaches Microsoft 365 from the gateway's IP address. SPF is then checked against the wrong server, IP reputation is the gateway's, and spoof detection misfires. Turn on Enhanced Filtering for Connectors (Defender portal, Threat policies > Enhanced filtering) on the inbound connector, either to skip the last IP automatically or with the gateway's ranges, and test it on a few recipients first. Afterwards, disable any SCL -1 rule you added for the gateway. Messages then carry X-MS-Exchange-SkipListedInternetSender with the real source address. Also restrict the inbound partner connector to the gateway's IP ranges or certificate so senders cannot skip the gateway by delivering straight to your mail.protection.outlook.com host.
Outbound through a smart host. If an outbound connector sends your mail through a gateway, the gateway's servers must be in your SPF record, and the gateway should DKIM-sign after any change it makes, such as adding a disclaimer, because changing the body breaks Microsoft's signature. Use Validate this connector after any change.
Step 6: read the anti-spam headers
In Outlook, open the message and choose View > View message details (or File > Properties in classic Outlook) to copy the headers. These fields answer most questions:
| Header and field | What it tells you |
|---|---|
| Authentication-Results | SPF with smtp.mailfrom, DKIM with header.d, DMARC with header.from, and compauth with its reason code |
| X-Forefront-Antispam-Report: CIP | The connecting IP address. If it is your gateway, Enhanced Filtering is not working |
| X-Forefront-Antispam-Report: SFV | The spam verdict: NSPM not spam, SPM spam, SKS marked spam by a rule, SKA sender in an anti-spam allow list, SKB sender in an anti-spam block list, SKN rule bypassed filtering, SKI IP Allow List, SFE user Safe Senders, BLK user Blocked Senders, SKQ released from quarantine |
| X-Forefront-Antispam-Report: CAT | The policy category that applied, such as SPM, BULK, PHSH, HPHSH, SPOOF, MALW or an impersonation type |
| X-Forefront-Antispam-Report: SCL | The spam confidence level. In the cloud it does not decide the action; read CAT and SFV instead |
| X-Microsoft-Antispam: BCL | Bulk complaint level, compared with the bulk threshold in the anti-spam policy |
| X-MS-Exchange-Organization-Network-Message-Id | The Network Message ID, which message trace accepts as -MessageTraceId |
One more trap: a message that was delivered and later vanished may have been moved by zero-hour auto purge, which acts after delivery. Check the quarantine and, with Defender for Office 365 Plan 2, Threat Explorer.
How DNS Panopticon helps
Paste the headers into Email Header Analyzer to see the route, the envelope sender and DKIM domain beside the From address with their alignment, and the results the receiver recorded. It parses in your browser and uploads nothing. Email Validation checks a domain's MX, SPF, DKIM and DMARC records together. Enter selector1, then selector2, as the DKIM selector to confirm both of the keys Microsoft 365 uses resolve before you turn signing on. Domain Visualizer shows the same records in context with MTA-STS and DANE.
For the DNS side of the same problem, see Why is email not being delivered? (DNS perspective) and Email Phishing Protection: SPF, DKIM, DMARC. If your MX points at a gateway, read the Proofpoint or Mimecast guide alongside this one.
FAQ
Why does DMARC fail when DKIM passes?
Because the passing signature belongs to your onmicrosoft.com domain, not the domain in the From address. Publish the two selector CNAMEs and enable DKIM for the custom domain so the signature aligns.
Message trace says Delivered, but the user cannot find the message. Where is it?
Delivered means it reached the mailbox. Check the Junk Email folder, Focused Inbox, inbox rules and forwarding, and whether zero-hour auto purge moved it to quarantine after delivery.
Should I add our gateway IP addresses to the connection filter IP Allow List?
No. That skips spam filtering for everything the gateway relays, including mail it should have caught. Use Enhanced Filtering for Connectors so Microsoft 365 sees the original sender instead.
Why do allow entries disappear from the Tenant Allow/Block List?
Allows created from submissions are removed 45 days after the filter last needed them, and Microsoft removes entries it decides are no longer needed. Spoofed sender allows do not expire.
Sources and further reading
- Microsoft Learn: Message trace in the new EAC in Exchange Online
- Microsoft Learn: Get-MessageTraceV2
- Microsoft Learn: Manage quarantined messages and files as an admin
- Microsoft Learn: Anti-spam message headers: SFV, CAT and compauth reason codes
- Microsoft Learn: How to use DKIM for email in your custom domain
- Microsoft Learn: Manage allows and blocks in the Tenant Allow/Block List
- Microsoft Learn: Enhanced Filtering for Connectors in Exchange Online
- Microsoft Support: Fix NDR error "550 5.7.515" in Outlook.com
- RFC 8601: Message Header Field for Indicating Message Authentication Status
- RFC 9989: DMARC