What the error means
A DKIM signature contains a hash of the message body (bh=). When the receiver computes the hash of the
body it got and it does not match, the signature fails with "body hash did not verify". In short: the
body changed between signing and delivery. The key in DNS is fine; otherwise the error would be different
("signature did not verify" or "no key").
What changes the body
| Cause | Typical case |
|---|---|
| A footer added after signing | Mailing lists, antivirus disclaimers, "Sent from my…" added by a gateway. |
| Forwarding and lists | Google Groups, Mailman or a forwarder rewriting the message. |
| Signing too early | The app signs, then a relay re-encodes the message (quoted-printable, base64) or wraps lines. |
| Line endings or whitespace | Scripts sending LF instead of CRLF, or trailing spaces, with c=simple canonicalization. |
How to fix it
- Sign last: DKIM must be added by the final server that sends to the internet, after any footer or disclaimer.
- Use relaxed canonicalization (
c=relaxed/relaxed): it tolerates whitespace and line wrapping changes. - For mailing lists, the list should sign with its own domain; ARC helps receivers trust forwarded mail.
- Check that the key published in DNS is the one being used, with the DKIM checker above, and test again with a fresh message.
If DKIM fails and SPF is not aligned, the message also gets dmarc=fail. The email header analyzer shows the results of a real message.