What does a DKIM fail result tell a receiver about a message, and why is it treated like an unsigned message?
answer
- integrity, not identity
- survivability in transit not guaranteed
- lists and gateways edit messages
- RFC 6376 section 6.1 SHOULD NOT
basics
~20 sDKIM fail means a checkable signature did not match the message as received, so it vouches for nothing. It is not proof of forgery: relays that modify mail break honest signatures, so RFC 6376 says treat it like an unsigned message.
solid answer
~50 sWhen a verifier recomputes the body hash or checks the `b=` signature and the check fails, RFC 6376 returns PERMFAIL for that signature, and `Authentication-Results` (RFC 8601) records `dkim=fail`: the message was signed, the signature was acceptable, and it failed verification. The cause can be tampering, but far more often it is an intermediary that changed a signed header field or the body: a list footer, a tagged subject, a gateway that re-encodes a part. Because survivability in transit is not guaranteed, RFC 6376 section 6.1 says a verifier SHOULD NOT treat a message with only bad signatures differently from one with no signature, and section 6.3 says unverifiable mail SHOULD be treated like all unverified mail. A fail removes a positive signal; it adds no negative one. What the From domain asks receivers to do with unauthenticated mail is a separate, DMARC-level question.
go deeper
Recall the plain meaning: a fail is a signature that did not match the message as received, and receivers treat it like no signature at all.
Explain where the mismatch arises, the body hash or the header signature, and why list footers and gateways cause most fails on legitimate mail.
Show you would read the verifier's logged reason and look for a second valid signature before calling a fail spoofing, and keep fail apart from temperror and permerror.
Frame the incentive argument: penalising a fail more than unsigned mail only hurts honest mail broken in transit, so enforcement belongs in a domain-level policy, not in DKIM alone.
## What a DKIM fail means A **DKIM signature** is a `DKIM-Signature` header field that a signing domain, named in `d=`, adds to a message. A receiver, the **verifier**, fetches the public key the signature names, recomputes two hashes over the message as it arrived, and checks them against the values the signature carries. RFC 6376 (September 2011) ends the evaluation of each signature in one of three states, and RFC 8601 (May 2019) gives the names a receiver writes into `Authentication-Results`: | RFC 6376 state | Typical RFC 8601 result | Meaning | |---|---|---| | SUCCESS | `pass` | the key was found and both checks matched | | PERMFAIL | `fail`, `permerror` or `neutral` | a permanent problem: a hash mismatch, a missing or revoked key, a malformed signature | | TEMPFAIL | `temperror` | a transient problem, such as a key lookup that got no answer | RFC 8601 defines `fail` narrowly: the message was signed, the signature was acceptable to the receiving domain, and it **failed the verification test**. In practice the recomputed body hash did not match `bh=`, or the `b=` signature did not verify against the hash of the signed header fields. Something in the signed content is not what the signer hashed. ## Why honest mail fails A fail tells you the bytes changed, not who changed them or why. Most fails on legitimate mail come from intermediaries that edit messages for their own reasons: - a discussion list that appends a footer or adds a tag to the `Subject`; - a gateway or scanner that re-encodes a body part, rewrites links or adds a disclaimer; - a relay that re-folds or alters a signed header field in a way the chosen normalisation does not absorb; - a forwarder that edits the message instead of passing it on unchanged. A message relayed **without** modification keeps a valid signature, because the signature travels inside the message and does not depend on which server delivered it. That is why DKIM usually survives plain forwarding, and why a fail points at modification rather than at the delivery path. Which normalisation choices tolerate which edits is covered with DKIM canonicalization. ## Why a fail is treated like no signature RFC 6376 section 6.1 says that because 'survivability of signatures after transit is not guaranteed', a verifier **SHOULD NOT** treat a message that has one or more bad signatures and no good signature differently from a message with no signature at all. Section 6.3 repeats it: mail that cannot be verified SHOULD be treated the same as all unverified mail, 'regardless of whether or not it looks like it was signed'. The reasoning is about incentives: 1. Penalising a fail more than an unsigned message protects nothing, because a sender with bad intent can simply send the message unsigned. 2. The only mail the extra penalty would catch is honest mail broken in transit by lists and gateways. 3. So a fail **removes a positive signal**: the receiver cannot attach the signing domain's reputation to this message. By itself it adds no negative one. RFC 8601 makes the same point from the reporting side: a report of `fail` lets a downstream consumer decide how to handle it, while `neutral` or `none` pre-empts that choice and forces unsigned treatment. The key record carries a stricter version of the same rule. When the signer's key record has the testing flag `t=y`, verifiers **MUST NOT** treat its mail differently from unsigned mail, even when the signature fails; they MAY track the results to help the signer. ## What fail is not | Result | What happened | Same as fail? | |---|---|---| | `none` | the message carried no signature | no | | `temperror` | the key could not be fetched right now | no, a later attempt may verify | | `permerror` | an unrecoverable error, such as a missing required header field | no, no comparison was possible | | `policy` | some aspect of the signature was unacceptable to the receiving domain | no | Confusing these leads to wrong conclusions. A `temperror` is a DNS problem, not a broken signature. A `policy` result says the receiving domain found some aspect of the signature unacceptable, not that the hashes mismatched. ## What the mail operator does with a fail - Read the **reason** the verifier logged; RFC 6376 section 6.3 says the exact cause SHOULD be made available, which separates a body-hash mismatch from a header-signature mismatch. - Check for **another signature** on the same message. A list or forwarder that modifies mail often adds its own, and a signature that verifies gives the message a valid signature for that signature's domain. - Look for the intermediary in the path before assuming spoofing. - Leave the question of what the From domain asked receivers to do with unauthenticated mail to its DMARC policy, a separate evaluation built on top of this result. A DKIM fail, in short, is a statement about **integrity in transit**: the signature can no longer vouch for the message. On its own it is never proof that someone forged it.
- Why would a verifier record permerror rather than fail for a signed message?`fail` is for a signature that could be checked and did not match. `permerror` is for one that could not be checked at all, for a reason that will not go away: RFC 8601's example is a required header field being absent. RFC 6376 returns PERMFAIL in both kinds of case, so both are permanent; only `fail` says the hashes were actually compared.
- Does a DKIM fail on mail whose key record carries t=y change how the receiver may treat it?It makes unsigned treatment mandatory rather than recommended. `t=y` marks a domain that is testing DKIM, and RFC 6376 says verifiers MUST NOT treat such mail differently from unsigned mail, even when the signature fails; they MAY track the results to help the signer. It is a debugging signal for the signer, not a filtering signal for the receiver.
A DKIM signature is like a wax seal across the flap of a letter. A broken seal tells you the letter was opened or altered on the way; it does not tell you the letter is fake, and you would not trust it less than a letter that never had a seal. You simply cannot lean on the seal any more.
- A DKIM fail proves the message was forged or spoofed.
- A failed signature should score worse than an unsigned message.
- temperror is just another name for a failed signature.
- Forwarding a message unchanged always breaks its DKIM signature.
- A policy result means the signature's hashes did not match.