DEV Community

AdminPackStudio
AdminPackStudio

Posted on

Exchange Online 550 5.7.509 DMARC Reject: A Read-First Alignment, SPF, DKIM, and Forwarding Triage

A sender gets a bounce from a Microsoft 365 or Outlook.com recipient: 550 5.7.509 Access denied, sending domain contoso.com does not pass DMARC verification and has a DMARC policy of reject. The message was not blocked for content. The From domain publishes p=reject, the message failed DMARC, and the recipient honored that policy.

Microsoft made honoring the sender's DMARC policy the default for Microsoft 365 recipients (MX pointing to Office 365) and for Outlook.com, Hotmail and Live in a change announced in July 2023. This post is a read-first order: confirm the text, read Authentication-Results, find which sender fails alignment, then decide whether the fix is on the sending side or the receiving side. Nothing here changes a tenant unless a step says so.

TL;DR

  • 5.7.509 means DMARC failed and the sender asked for rejection. The 5322.From domain publishes p=reject.
  • DMARC needs SPF or DKIM to pass and align with the From domain. Passing is not enough.
  • Read Authentication-Results for dmarc=fail action=oreject, then compare smtp.mailfrom and header.d with header.from.
  • Sender fix: align SPF (MAIL FROM) or DKIM (d=) for every sending service. Weakening the policy is the last resort.
  • Receiver fix for forwarded or list mail: trusted ARC sealer first; narrow mail flow rule or temporary allow entry after that.

Step 1: Read the exact text

Microsoft's NDR reference describes 5.7.509 as the sender's 5322.From domain not passing DMARC. The text differs by place:

550 5.7.509 Access denied, sending domain contoso.com does not pass DMARC verification and has a DMARC policy of reject
550 5.7.1 (DMARC setup article wording for p=reject rejected during SMTP)
Enter fullscreen mode Exit fullscreen mode

Check the text and not only the number. Record the sending domain named in the bounce and which service sent the message.

Step 2: Read Authentication-Results

Microsoft includes the original headers in the NDR. Find the Authentication-Results header:

spf=pass smtp.mailfrom=bounces.adatum.com;
dkim=pass header.d=adatum.com;
dmarc=fail action=oreject header.from=contoso.com
Enter fullscreen mode Exit fullscreen mode

Here SPF and DKIM both pass, but for adatum.com and not contoso.com. Neither aligns with the From domain, so DMARC fails. Microsoft maps dmarc=fail action=oreject to a p=reject policy, and action=quarantine to p=quarantine.

Step 3: Check alignment

Header Compare with header.from
smtp.mailfrom (SPF) Same domain, or a subdomain under relaxed alignment
header.d (DKIM) Same domain, or a subdomain under relaxed alignment

Relaxed alignment is the default, so bounces.contoso.com aligns with contoso.com while adatum.com does not. DMARC passes when at least one of SPF or DKIM passes and aligns.

Step 4: Read the sender's published records

Read-only, from any workstation:

Resolve-DnsName _dmarc.contoso.com -Type TXT
Resolve-DnsName contoso.com -Type TXT | Where-Object { $_.Strings -match 'v=spf1' }
Resolve-DnsName selector1._domainkey.contoso.com -Type CNAME
Enter fullscreen mode Exit fullscreen mode

The DMARC record shows p=, pct=, and the aspf and adkim modes. The selector1 name applies to Microsoft 365 custom DKIM; a third-party service uses its own selector.

Step 5: Fix it as the sender

Microsoft lists three reasons DMARC fails: missing or incorrect DMARC and DNS records, missing DKIM, and forwarding. For the sending side:

  1. Find the failing source. Use the From address and sending service from the bounce, or your DMARC aggregate report vendor.
  2. Align SPF if the service lets you set the MAIL FROM (bounce) domain to your own, then add the service to that domain's SPF.
  3. Align DKIM if the service can sign with d=your domain: publish the keys it provides and turn signing on.
  4. Use a subdomain if the service can do neither. Send from a subdomain with its own DMARC record and signing.

Step 6: Fix it as the receiving admin

If your users must receive legitimate mail that fails DMARC, such as forwarded mail or a mailing list, Microsoft lists these in order of preference:

  • Configure the intermediary as a trusted ARC sealer (preferred)
  • A mail flow rule with narrow conditions (sender IP plus sender domain) to skip spam filtering
  • A Tenant Allow/Block List entry (temporary, expires in 30 days)

Read-only, to see what your tenant does:

Connect-ExchangeOnline

Get-AntiPhishPolicy | Format-List Name, HonorDmarcPolicy, DmarcQuarantineAction, DmarcRejectAction
Get-ArcConfig | Format-List ArcTrustedSealers
Enter fullscreen mode Exit fullscreen mode

If your MX points to a non-Microsoft filter in front of Microsoft 365, the Honor DMARC setting applies only when Enhanced Filtering for Connectors is enabled on the inbound connector.

What the result means

What you found Likely cause and next move
SPF or DKIM passes for a different domain Alignment failure; set MAIL FROM or d= to the From domain
No DKIM signature Publish keys and enable signing at the sending service
Mail was forwarded Forwarding breaks SPF; trusted ARC sealer at the receiver
Third-party filter in front of Microsoft 365 Check Enhanced Filtering for Connectors
Only one unknown sender fails Possible spoofing; do not allow it

Free tool: https://sysadmin-toolbox.pages.dev/guides/exchange-online-550-5-7-509-dmarc-reject/

Common false starts

  • "SPF passes, so DMARC should pass." It must also align with the From domain.
  • "Move the policy to quarantine." Microsoft says Outlook.com consumer mailboxes reject on both p=reject and p=quarantine.
  • "Allow the sender in the tenant." An unknown failing sender may be a spoof; confirm it first.
  • "Move to p=reject before inventorying senders." Find every sending service first.

Related posts

Free checklist

Changing mail authentication or DMARC policy is the kind of change you want planned, not improvised. The free Conditional Access pre-enforcement checklist keeps break-glass accounts, pilot groups, and report-only review on one page:

👉 https://cashflow4375.gumroad.com/l/ujkqxb?utm_source=devto&utm_medium=article&utm_campaign=aps_first_sale&utm_content=exchange-online-550-5-7-509-dmarc-reject


Sources: Microsoft Learn, "Email nondelivery reports (NDRs) and SMTP errors in Exchange Online", "Set up DMARC to validate email in Microsoft 365", "Troubleshoot email authentication in Microsoft 365", and the Microsoft Tech Community post "Announcing New DMARC Policy Handling Defaults". Commands are read-only. Test in a lab first.

Top comments (0)