Why DKIM signatures fail
DKIM signatures usually fail for one of two reasons: the message was changed after it was signed, or the receiver couldn't find a usable public key at the selector named in the signature. Temporary DNS problems and signing mistakes cause the rest. Each needs a different fix. A footer added after signing won't be cured by republishing your DNS record, and a missing record won't be cured by changing your mail gateway. And if DKIM passed but DMARC still didn't, that's not a DKIM failure at all. It's alignment.
What "DKIM fail" means
When a receiver checks a signature, it returns either a permanent failure (PERMFAIL) or a temporary one (TEMPFAIL), with a short reason in brackets, such as "body hash did not verify" or "no key for signature." Receivers usually record the outcome in the Authentication-Results header as fail, neutral, policy, temperror, or permerror. A typical line:
Authentication-Results: mx.receiver.example;
dkim=fail (body hash did not verify) header.d=example.com header.s=mail2026
header.d is the signing domain and header.s is the selector. Those two, plus the reason text, tell you which family of problem you're dealing with.
A DKIM failure doesn't, by itself, make the receiver reject the message. A failed signature does not force rejection. What happens next depends on the receiver's filtering and your DMARC policy. For bulk senders to Gmail, though, a DKIM failure has a direct cost. Gmail lists these replies:
- 4.7.30: "Your email has been rate limited because DKIM authentication didn't pass for this message. Gmail requires all email bulk senders to authenticate their email with DKIM."
- 5.7.30: "This message was blocked because it didn't pass DKIM authentication. Gmail requires bulk email senders to authenticate their email with DKIM."
The wider provider rules are in Google, Yahoo, and Microsoft sender requirements.
Common DKIM failure reasons
1. The message changed after signing ("body hash did not verify")
If DKIM "worked yesterday," start here.
"Body hash did not verify" means the body changed after it was signed. Google puts it plainly: if the text next to the DKIM entry is "body hash did not verify," "the message was modified during transit". Typical culprits:
- An outbound gateway or disclaimer tool that adds a footer after your mail platform signed the message. Google warns about exactly this.
- Link-rewriting or tracking tools that edit the body after signing.
- Mailing lists that append footers (DKIM and mailing lists or forwarders).
If you see this error in Microsoft 365, it means the same thing: something on the path edited the body after signing.
"Signature did not verify" with a matching body hash can mean a signed header changed. A list adding [tag] to the Subject is the classic case.
Encoding changes count too. Converting 8-bit content to 7-bit in transit will break DKIM signatures, so signers should encode the message before signing, as it's expected to be received.
Canonicalization matters. simple breaks on almost any change; relaxed tolerates whitespace and re-wrapped headers but not content edits. Microsoft 365 defaults to relaxed for both header and body.
The fix: sign after the last system that modifies the message, or stop that system from touching signed content. The same advice applies to mailing lists: sign after the message is prepared for distribution. Don't change DNS, and don't regenerate keys. Neither helps a body that was rewritten.
2. The receiver can't find or read the key
The receiver looks up exactly <s=>._domainkey.<d=>. If that lookup fails, the result depends on why:
- No key for signature (PERMFAIL). Nothing is published at that name. It was never published, it went in under the wrong host name (Microsoft calls out the doubled domain, such as
selector1._domainkey.example.com.example.com), it's in the wrong DNS zone, the selector is misspelled, or the key was deleted too early during a rotation (How to rotate a DKIM key). If the sender signs with a selector ord=domain you never published, it lands here too. The full "no record" diagnosis is in DKIM signature not found. - Key unavailable (TEMPFAIL). DNS didn't answer. This is the only case where a temporary 4xx SMTP reply is appropriate. For Microsoft 365, intermittent
dkim=temperroris often linked to very low TTLs on the DKIM CNAMEs; a TTL of at least 3600 seconds is recommended. - Key syntax error (PERMFAIL). The record is malformed. The classic case is a 2048-bit key cut off at 255 characters, or split strings stored out of order (1024-bit vs 2048-bit DKIM keys).
- Key revoked (PERMFAIL). The record has an empty
p=. That's deliberate retirement, so mail still signed with that key fails. - Wrong record type. A TXT where the provider expects a CNAME, or a CNAME proxied through Cloudflare instead of set to DNS only.
- Too soon. A new key can take up to 48 hours to start working.
Record formats and the doubled-domain trap are in DKIM selectors and DNS records.
3. The signature itself is set up wrong
These are signer configuration problems, and they are permanent failures:
- A required tag is missing (
v,a,b,bh,d,h,s). - The From header isn't in
h=("From field not signed"). - The
i=domain isn't thed=domain or a subdomain of it ("domain mismatch"). - The signature has expired (
x=is in the past). Verifiers may fail it, which mostly affects very delayed or replayed mail. - The algorithm is
rsa-sha1, which has permanently failed evaluation, or the RSA key is shorter than 1024 bits.
Two related settings deserve a check too:
- The
l=body-length tag leaves content past the limit unverified. This can be abused, and assessors might ignore signatures that use the tag. Don't usel=, because messages using it are vulnerable to abuse. - A key record with
t=y(testing) isn't a failure, but receivers must treat the mail like unsigned mail, so you get no DKIM benefit.
If you send marketing mail with one-click unsubscribe, check h= for the list headers as well. The message must have a valid DKIM signature that covers at least List-Unsubscribe and List-Unsubscribe-Post.
4. It failed after it left you
Plain forwarding usually keeps DKIM intact. Mailing lists that tag subjects, add footers, or rewrite MIME parts usually break it. Forwarded messages can fail DKIM even when your setup is correct. You can't fully fix this from the sending side. See DKIM and mailing lists or forwarders.
When DKIM passed for the wrong domain
Sometimes the report says dkim=pass and DMARC still doesn't pass. That isn't a DKIM failure. The signature verified, but its d= domain isn't aligned with your From domain. A valid signature from d=vendor.example isn't an aligned DKIM pass for From: news@example.com. DMARC still passes if there's another aligned SPF or DKIM pass. Microsoft lists this exact symptom in its DKIM troubleshooting, and Gmail's 4.7.32 reply says the From header "isn't aligned with either the authenticated SPF or DKIM organizational domain."
Under relaxed alignment, the fix is a signature whose d= shares your organizational domain, such as d=example.com or d=mail.example.com. You don't need the exact From domain. Alignment is covered in Identifier alignment for SPF and DKIM, and the third-party version of this problem in Third-party mail fails alignment.
There's a Gmail-specific wrinkle too. Gmail checks only the first five signatures listed in Authentication-Results. If your aligned signature isn't among them, the message fails DKIM, and that "might also cause the message to fail DMARC."
How to diagnose a DKIM failure, in order
- Read
Authentication-Resultson a received copy. Note thedkim=result, the reason text,header.d, andheader.s. - "Body hash did not verify" → look for gateways, footer tools, tracking rewriters, or lists on the path (reason 1).
- "No key," permerror, or a key syntax error → look up the selector in DNS and compare it with the value your provider gave you (reason 2).
- temperror → retry later, then check your DNS host and TTLs (reason 2).
dkim=passbut no DMARC pass → compareheader.dwith the From domain (previous section).- Check the scale. Your DMARC aggregate reports show the DKIM domain, selector, and result per source. If one source fails and the rest pass, the problem is that sender's setup or path, not "DKIM for the whole domain" (A field-by-field walk-through of a DMARC aggregate report).
Mistakes worth avoiding
- Assuming a DKIM failure means the DNS record is wrong. A changed body is a common cause, and no DNS change fixes it.
- Assuming a failure means an attacker tampered with the mail. A legitimate gateway or list can also change signed content.
- Regenerating keys to fix a body-hash failure. It changes nothing.
- Publishing the key and never turning signing on. Google has a Start authentication step; Microsoft 365 has its own enable setting (Microsoft 365 or Google Workspace setup issues).
- Using
l=so footers don't break the signature.
Free DMARC account
Turn raw DMARC reports into a readable dashboard
Point your rua address to our platform and read the results by sender and source instead of opening XML files.
- Results grouped by sending source
- SPF, DKIM and alignment results per sender
- The original XML reports are still there to download
FAQ
Why is my DKIM failing?
Start with the reason text in Authentication-Results. "Body hash did not verify" means something changed the body after signing. "No key" or a syntax error means the record is missing, misplaced, or truncated. temperror means DNS didn't answer.
What does "body hash did not verify" mean?
The body changed after signing, usually because of a footer, gateway, or list. Fix the system that modifies the message, not DNS.
Why does DKIM fail only sometimes?
Look for temporary DNS errors, mail that takes different paths (some through a gateway or list), or a rotation that removed a key too early.
Can I make DKIM survive mailing lists?
Not reliably from the sending side. See DKIM and mailing lists or forwarders.