legitimate email failing DMARClegitimate email failing DMARC

A legitimate sender can have correct SPF, DKIM and DMARC records and still have messages fail DMARC.

I recently came across exactly that with a supplier using a SaaS platform to send payment notifications. Most messages arrived normally, but some were quarantined. The sender, platform and type of notification were the same every time, so at first the behaviour looked random.

The headers told a different story. The failing messages had a DKIM problem caused by a malformed Cc header carrying roughly 40 addresses. And the sender’s DMARC policy contained pct=10, which meant the policy was only being applied to a sample of the messages that failed. That combination made the problem look far more complicated than it was.

The useful lesson is that a legitimate sender failing DMARC doesn’t automatically mean their DNS is wrong. Sometimes the message itself is being changed between signing and verification.

DMARC in two minutes

DMARC doesn’t require both SPF and DKIM to pass. A message passes when either SPF or DKIM passes and aligns with the domain in the visible From address. It fails only when neither gives an aligned pass.

That distinction matters with third-party SaaS platforms. A platform sending on behalf of supplier.example usually uses its own bounce domain for SPF, so SPF can pass while failing alignment, because the domain doesn’t match the From address. DKIM provides the aligned path instead. If the platform signs with d=supplier.example and the From address is also supplier.example, DKIM satisfies DMARC. If that signature then breaks, there’s no aligned authentication left, and DMARC fails.

The sender’s DMARC record tells receivers what to do with failures: p=none to monitor, p=quarantine to treat them as suspicious, or p=reject to refuse them. The original DMARC specification also defined pct, which applies the policy to only a percentage of failing messages (Microsoft Learn: Set up DMARC to validate email).

Start with the message headers

When a legitimate message is quarantined for DMARC, don’t start by changing your Microsoft 365 policies. Read the headers. In Microsoft 365, open the message in the Defender portal and view its headers, or paste them into Microsoft’s Message Header Analyzer to make them easier to read. The line that matters is Authentication-Results. A simplified failing example:

Authentication-Results: spf=pass (sender IP is 203.0.113.25)
    smtp.mailfrom=bounces.saasplatform.example;
    dkim=fail (signature did not verify)
    header.d=supplier.example;
    dmarc=fail action=quarantine
    header.from=supplier.example;
    compauth=fail reason=000

Reading it line by line:

  • spf=pass means the platform was authorised to send for its bounce domain. Compare smtp.mailfrom with header.from: if they differ, SPF passed but didn’t align, so it can’t satisfy DMARC.
  • dkim=fail is the real problem, and the reason text tells you where to look. (body hash did not verify) means the body changed after signing. (signature did not verify) usually means a signed header changed.
  • header.d is the DKIM signing domain. When it matches header.from, DKIM was the aligned path, which is why its failure matters.
  • dmarc=fail action=quarantine means DMARC failed and the sender’s quarantine policy was applied to this message.
  • compauth=fail is Microsoft’s composite authentication verdict, which combines DMARC with Microsoft’s own signals. reason=000 indicates the message failed explicit authentication.

Comparing header.from, header.d and smtp.mailfrom is usually the fastest way to work out which authentication method was actually capable of satisfying DMARC.

How a Cc header can break DKIM

This was the interesting part. The failing messages all shared an unusually long Cc header, roughly 40 addresses. Messages with shorter recipient lists didn’t show the same failure.

DKIM signs headers as well as the body. The DKIM-Signature header contains an h= tag listing which headers were included, for example:

h=from:to:cc:subject:date:message-id

If cc is on that list and the Cc header changes after signing, the receiver can no longer calculate the same signature (RFC 6376: DKIM Signatures). Nobody has to tamper with the message maliciously for that to happen. Mail-processing software, formatting fixes or re-encoding along the way can all do it.

Header folding and canonicalisation

RFC 5322 limits a line to 998 characters, so long headers are meant to be folded across several lines and unfolded again when read (RFC 5322: Internet Message Format). DKIM’s relaxed header canonicalisation is designed to tolerate normal formatting changes like line rewrapping and whitespace. simple canonicalisation is far less tolerant.

But relaxed canonicalisation doesn’t make a malformed header harmless. If an application generates a header that breaks the rules and a server along the way repairs, rewrites or re-encodes it, the header that arrives is different from the one that was signed. If that header is covered by DKIM, the signature fails.

That gives you a useful diagnostic rule:

If DKIM failures correlate with a particular message characteristic, investigate that characteristic rather than assuming the sender’s DNS configuration is broken.

In this case, the characteristic was the long Cc header.

Why only some messages were quarantined

The sender’s DMARC record contained:

v=DMARC1; p=quarantine; pct=10; rua=mailto:dmarc@supplier.example

Under the original DMARC specification, pct sets the percentage of failing messages that should have the policy applied. Receivers pick them by random sampling, so pct=10 applies the policy to roughly 10 per cent of failures. The rest get the next policy down: none instead of quarantine, or quarantine instead of reject.

Microsoft 365 records which way each message went in the action value:

  • dmarc=fail action=quarantine means the message failed DMARC and was selected, so the quarantine policy was applied.
  • dmarc=fail action=pct.quarantine means the message failed DMARC but was not selected. Because pct was below 100, the system randomly decided not to apply the quarantine action, and the message was delivered (Microsoft: Using DMARC in Office 365, archived).

That second value is the key to the whole puzzle. Check the headers of messages from the same sender that were delivered normally. If they carry action=pct.quarantine, they failed DMARC too. They only reached the inbox because they weren’t in the sampled 10 per cent.

So the underlying authentication failure wasn’t intermittent at all. Every message with the long Cc header was failing. Only the enforcement was being sampled.

That changes the question you should be asking. It isn’t “why did Microsoft 365 quarantine this message?” It’s “why are these messages failing authentication, and how many others are affected right now?” If you’re trying to work out why only some emails from a sender are quarantined, search the delivered messages’ headers for action=pct.quarantine.

What happens when pct rises

A sender using pct=10 is normally partway through a staged rollout, increasing the percentage as they gain confidence. For a sender with an unnoticed DKIM problem, that’s a trap. Today, roughly one in ten of their broken messages is quarantined. Raise pct to 100 without fixing the cause, and every broken message is quarantined. Move from p=quarantine to p=reject, and receivers that honour the policy will refuse those messages outright.

Microsoft 365 honours the sender’s DMARC policy by default: failures from a p=quarantine domain are quarantined, and failures from a p=reject domain are rejected, unless the receiving organisation has changed its anti-phishing policy actions (Microsoft Tech Community: New DMARC policy handling defaults). So a small change in someone else’s DNS can turn an occasional nuisance into a complete delivery failure for that sender, with no change on your side at all.

A note on DMARCbis

The DMARC standard has changed. RFC 9989, known as DMARCbis, replaces the original RFC 7489 specification and retires the pct tag, because receivers implemented percentages inconsistently. In its place is a simple testing flag: t=y for test mode and t=n for full enforcement (Palisade: What is DMARCbis).

That doesn’t mean you can ignore pct when troubleshooting. You’ll keep seeing it in existing records and headers for some time. But I wouldn’t build a new DMARC rollout around pct just because it appears in older examples. And as senders update their records, expect the gentle ramp of percentages to give way to a straight switch from testing to enforcing, which makes it even more important to fix authentication problems first.

Other reasons legitimate email fails DMARC

A broken Cc header is only one cause. When you’re investigating a legitimate sender, also rule out these:

  • Unaligned third-party senders. A marketing, CRM, payroll or notification platform sends as the customer’s domain but signs DKIM with its own domain, or hasn’t been set up with the customer’s DKIM keys. SPF and DKIM both pass for the platform, and neither aligns.
  • Forwarding. Forwarding breaks SPF, because the forwarding server isn’t in the original sender’s SPF record. DKIM survives if the message isn’t modified, but many forwarders do modify it.
  • Mailing lists. Lists often add footers or tag the subject line, which can invalidate DKIM depending on what was signed.
  • Security gateways. A gateway in front of Microsoft 365 that adds a disclaimer, rewrites URLs or tags the subject can break DKIM before Microsoft 365 checks it. Microsoft also sees the gateway’s IP instead of the original sender’s, which breaks SPF unless Enhanced Filtering for Connectors is configured.
  • Body modifications. If the reason is body hash did not verify, look for anything that changed the body after signing, such as appended text, re-encoding or line-ending changes.
  • DKIM key problems. A selector missing from DNS, the wrong public key, a rotated key, a DNS lookup failure, or incorrect DKIM configuration at the sending service.

The key is to distinguish a signature problem, where the message changed, from a DNS or key problem, where the receiver couldn’t validate the signature at all.

What to do as the recipient

The first instinct when legitimate mail is quarantined is to create an exception. That can fix the immediate problem while creating a much bigger one.

Don’t broadly bypass filtering. Avoid mail flow rules that set SCL to -1 or otherwise bypass filtering for a whole sender domain. A spoofed message can claim exactly the same From domain.

If you need a temporary exception, keep it narrow. Microsoft 365’s Tenant Allow/Block List supports spoofed-sender entries that pair the sender’s domain with the specific sending infrastructure, rather than trusting the domain from anywhere. Spoofed-sender allow entries don’t expire automatically, so review them and remove them once the sender has fixed the problem.

Check before you release. Inspect a quarantined message’s headers before releasing it, and confirm it matches the known legitimate pattern. A legitimate sender having a DMARC problem doesn’t mean every message claiming to be from them is legitimate.

Give the sender useful evidence. Send them a sanitised failing header, a sanitised passing header, the DKIM failure reason, the signing domain, the From domain, their DMARC policy, and the message characteristic linked to the failures. In this case, that was the long Cc header. Also tell them about pct. If they’re increasing enforcement, fixing the DKIM problem matters far more than changing the percentage.

What the sender should fix

The long-term fix belongs in the sending application or platform:

  • Generate valid headers. Fold long fields correctly, and don’t rely on downstream servers to repair malformed headers.
  • Check the DKIM h= list. RFC 6376 advises signers to be careful about signing headers that may be legitimately modified or removed in transit. If the platform signs a header it later changes, it has created its own failure condition.
  • Test realistic messages. Test the actual application output, including long Cc lists, multiple recipients, unusual display names, non-ASCII characters, attachments and different message sizes.
  • Monitor DMARC aggregate reports. They reveal failures across the whole mail stream before a recipient reports a problem, and they should be read before any increase in enforcement.

Checklist: legitimate email failing DMARC

  1. Read the Authentication-Results header on a quarantined message.
  2. Check whether SPF passed and whether smtp.mailfrom aligns with header.from.
  3. Check whether DKIM passed, and compare header.d with header.from.
  4. Note the exact DKIM reason: body hash did not verify or signature did not verify.
  5. Check the sender’s DMARC record for p= and, where present, pct=.
  6. Compare a failing message with one that was delivered, and look for action=pct.quarantine on the delivered one. If it’s there, that message failed too.
  7. Look for a message-specific pattern, such as long recipient lists or unusual characters in names.
  8. Rule out forwarding, mailing lists and gateways that modify messages.
  9. Avoid broad filtering bypasses. If you need a temporary exception, scope it to the sender and their sending infrastructure.
  10. Give the sender sanitised headers so they can fix the problem at the source, and warn them before they raise pct.

A DMARC failure from a legitimate sender isn’t necessarily a DNS problem, and it isn’t a reason to weaken your email protection. In this case, the sender was legitimate and their records were in place, but the signed message content wasn’t surviving the journey intact. The pct=10 setting made it look random, because only a sample of the failing messages was being quarantined.

The lesson is simple: when legitimate email fails DMARC, compare the message that failed with one that passed. The difference is usually more useful than the DMARC failure itself.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *