dotvitals

Loading the list of pages…

↑↓ to moveEnter to openEsc to close

DKIM fail: body hash did not verify

Updated · 3 min read

Any receiver that verifies DKIM:dkim=fail (body hash did not verify)

In short

  • The DKIM signature was checked and the key was found, but the message body that arrived is not the body that was signed: something changed it on the way.
  • Usual causes: a mailing list or forwarder adding a footer, your own gateway adding a disclaimer or rewriting links after signing, or a server re-encoding the message.
  • If your own system changes mail after signing, make signing the last step. If a list or forwarder did it, the fix is on their side.

Check the signature now

Type the domain from the signature's d= tag to check its published key. To verify the signature itself, paste the headers of a message you sent into the DKIM header check.

On this page
  1. The result, as Microsoft documents it
  2. Most likely causes
  3. Find where the body changed
  4. How to fix it
  5. How to confirm the fix worked

The result, as Microsoft documents it

dkim=failMicrosoft's example of the Authentication-Results line (contoso.com is Microsoft's example domain)

dkim=fail (body hash did not verify) header.d=contoso.com

compauth=pass reason=108When Microsoft's composite check passes the message anyway: reasons in the 100s are passes

DKIM failed due to a message body modification attributed to previous legitimate hops. For example, the message body was modified in the organization's on-premises email environment.

Read on . Providers reword these messages without notice, so treat the text as a dated snapshot and check the source before acting on anything consequential.

DKIM signs a fingerprint of the message body, called the body hash, together with selected headers. The receiver found your key, computed the fingerprint of the body it received, and got a different value. The body was changed after it was signed.

That makes it a different problem from a missing or wrong key. The key, the selector and the domain can all be fine; what changed is the content, somewhere between the signing server and the receiver.

Microsoft documents this exact wording for its Authentication-Results header, and other receivers report it in similar words. If SPF also fails for the message — after a forward, for example — DMARC fails with it.

Most likely causes

  1. A mailing list or forwarder changed the message. Lists add footers and subject tags and convert formats, and every change alters what was signed.
  2. Your own outbound path changes mail after it is signed: a disclaimer or signature appliance, an anti-virus scanner that rewrites attachments, a gateway that rewrites links for click protection.
  3. A server re-encoded the message in transit, for example converting 8-bit text to quoted-printable or re-wrapping long lines. RFC 6376 describes its simple canonicalization as tolerating almost no modification, and relaxed as tolerating common changes such as whitespace replacement.
  4. The signing step ran before the last change on your own server: a plugin or filter that edits the message after DKIM has already signed it.

Find where the body changed

Send a message straight to a mailbox you control at an outside provider, with no list, forward or alias in between. If DKIM passes there and fails on the other path, the change happens on that path.

If it fails even when sent directly, the change is on your side, somewhere between the signing step and the edge of your network. Look at every system that touches outbound mail after signing.

Our DKIM header check separates the two halves. Paste the headers of a message sent from your domain and it verifies the signature over the headers against your published key, in your browser. It cannot check the body hash, because the body is never pasted, so a signature that verifies there while the receiver reports body hash did not verify means the key and selector are fine and the content is what changed.

How to fix it

If your own system changes outbound mail, make DKIM signing the last step: sign at the final hop that changes the message, or move the change before signing.

Where your signer lets you choose, use relaxed canonicalization for the body; it tolerates whitespace changes that simple does not.

If a mailing list or forwarder breaks the signature, the fix is theirs: a list that rewrites the From address and signs as itself, or ARC. Do not weaken your DMARC policy for one list.

Make sure SPF passes in alignment on your direct mail, so a DKIM failure on one path does not become a DMARC failure there.

How to confirm the fix worked

Send a fresh message directly to an outside mailbox: the Authentication-Results should show dkim=pass for your domain.

Then send through the path that failed. If only that path still fails, the remaining change is in the hands of whoever runs it.

Check your domain with the DKIM checker

Read next