A sender's DKIM signatures fail only on mail through a discussion list that appends a footer or a gateway that re-folds long headers; which c= change helps, and where does none?
answer
- two paths, two halves of c=
- folding is a header matter
- footer adds non-empty lines
- body hash versus signature
- l= is not the answer
basics
~20 sRe-folding breaks only simple header canonicalization; signing with relaxed headers, as in c=relaxed/relaxed, absorbs it. A footer adds non-empty body lines, which change the canonical body under both algorithms, so no c= value saves those signatures.
solid answer
~40 sStart by reading `c=` on the failing signatures and asking which half each path touches. A gateway that re-folds long header lines only inserts or moves CRLF-plus-whitespace; `relaxed` header canonicalization unfolds lines and collapses whitespace, so moving the header half to `relaxed` fixes that path, including for the long `DKIM-Signature` line itself. The list footer is different: both body algorithms ignore only trailing empty lines, and relaxed also ignores line-end whitespace, so appended text changes the body hash whatever `c=` says. RFC 6376 section 6.1.3 separates the two symptoms as "body hash did not verify" against "signature did not verify". The `l=` tag could exclude appended text, but RFC 6377 discourages it and it leaves content unsigned; how lists and forwarders are accommodated is a DMARC rollout matter.
go deeper
Recall that re-folding is a header change relaxed absorbs, while a footer adds body text that neither body algorithm ignores.
Explain which relaxed steps undo re-folding, and why both body algorithms forgive only trailing empty lines and, for relaxed, whitespace.
Split the failure into body-hash and signature mismatches, read c= on the failing copies, fix the header half for the gateway and refuse l= for the list.
Decide which list and forwarder breakage the domain will accept as unfixable by canonicalization, and route it to the DMARC rollout plan rather than to signer settings.
## The situation A sender's DKIM signatures verify at most receivers but fail on two kinds of path: mail that went through a **discussion list** that appends a footer to every message, and mail that crossed an inbound **gateway** that re-folds long header lines to a shorter width. The question is what the sender's choice of canonicalization can and cannot do about each. ## Step one: read the signature, then split the symptom 1. Take a failing copy and read the `c=` tag in its `DKIM-Signature` field. A header half of `simple` (including the default when `c=` is absent) means any change to folding breaks the header hash. A body half of either value tells you less, because the footer will break both. 2. Tell the two hashes apart. RFC 6376 (September 2011) section 6.1.3 describes checking the body hash in `bh=` first, with PERMFAIL "body hash did not verify" when it differs, then the header signature, with "signature did not verify". Verifiers record their verdict in their own words; where a receiver's detail distinguishes the two, a footer shows up as a body-hash mismatch and re-folding as a signature mismatch. 3. Compare a signed copy as sent with the copy received through each path. The difference is usually obvious: extra lines at the end of the body, or header lines broken at new positions. ## The gateway: a header problem relaxed was made for Folding in RFC 5322 (October 2008) section 2.2.3 means inserting a CRLF before whitespace where the syntax allows it, so a long field spans several lines. A gateway that re-folds changes where those breaks fall. Under `simple` header canonicalization nothing is normalised, so the hashed bytes change. Under `relaxed`, the steps in RFC 6376 section 3.4.2 unfold every continuation line and reduce each whitespace run, including the whitespace around a former fold, to a single space. The re-folded and the original fields canonicalize identically. Two details matter in practice: - The `DKIM-Signature` field is itself hashed with the header algorithm (section 3.7), and it is usually the longest header in the message, so it is often the first field a re-folding gateway touches. - Re-folding never touches the body, so changing the body half alone, for example to `c=simple/relaxed`, does nothing for this path. The fix is on the signer: sign with `relaxed` headers, typically `c=relaxed/relaxed`. ## The list footer: why no canonicalization survives it A footer appends **non-empty lines** to the body. Compare that with what the two body algorithms forgive: | Body change | `simple` | `relaxed` | |---|---|---| | Empty lines added at the very end | absorbed | absorbed | | Spaces added at the end of lines | breaks | absorbed | | Whitespace runs inside a line changed | breaks | absorbed | | Footer text appended | breaks | breaks | | Footer inserted inside a MIME part | breaks | breaks | Both algorithms exist to absorb whitespace, not added content. Any visible footer changes the canonical body, the computed body hash no longer equals `bh=`, and the signature fails whatever `c=` says. The same is true of a list that adds a tag to a signed `Subject:` value: relaxed lowercases field names and normalises whitespace, but never alters the characters of a value. ## What about l=? The `l=` tag tells verifiers to hash only the first N octets of the canonical body, so text appended after them would not affect `bh=`. It is not the remedy here: - RFC 6377 (September 2011, the best-current-practice document on DKIM and mailing lists) says `l=` is not workable for MIME messages, has security considerations, and that its use is discouraged. - Everything beyond the counted octets is unsigned, so the sender would be authorising unsigned additions to every message it sends, not only from this list. How a domain keeps list and forwarded mail deliverable once its own signatures are broken, including list operators rewriting the `From:` field and the sealed records that forwarders can add, is covered in the material on DMARC rollout. The result a receiver then records for the broken signature is covered with signature verification. ## Summary for the sender - Gateway path: switch the header half to `relaxed`; verify by re-checking failure rates on that path. - List path: no `c=` change helps; do not reach for `l=`; treat it as a list-handling question. - Neither path: a relay that re-encodes the body or rewrites a signed value breaks every canonicalization alike.
- Would relaxed canonicalization save a list that prefixes the signed Subject with the list name?No. Relaxed header canonicalization lowercases field names, unfolds lines and normalises whitespace, but never changes the characters of a value. A list tag added to a signed Subject: changes the header hash under either algorithm, just as a footer changes the body hash.
- Why not add l= so the list footer falls outside the body hash?RFC 6377 says l= is not workable for MIME messages and discourages its use, and RFC 6376 section 8.2 warns that content past the counted octets is unsigned. The sender would accept unsigned additions on every message to cure one list's footer.
- Could a gateway break a relaxed/relaxed signature in a way that is not about whitespace?Yes. Re-encoding a body, for example converting 8-bit content to quoted-printable, changes the hashed octets, because DKIM hashes the transmitted encoding. Rewriting a signed header value has the same effect. Relaxed only absorbs whitespace, header folding and field-name case.
- Relaxed body canonicalization survives list footers because it ignores appended lines.
- Every DKIM failure after a list or gateway is cured by moving to relaxed/relaxed.
- Header re-folding by a gateway breaks the body hash.
- Adding l= is the recommended way to keep signatures valid through list footers.
- A gateway's re-folding cannot affect the DKIM-Signature field itself.