[ DKIM ]

Understand the DKIM body-length tag security trade-off

Evaluate partial body coverage before accepting a signature that permits unsigned appended content.

By the EmailAuth research team

[ Key points ]

  • l counts canonicalized body octets; absent means full body and zero means no body coverage.
  • Unsigned appended content can mislead the reader while the signature still passes.
  • Prefer signing final content over using partial coverage to accommodate a footer.
On this page

The DKIM l tag limits how much of the canonicalized body contributes to the body hash. It can let a signature survive appended content, but that survival comes from leaving content outside the signature's coverage. Treat it as a security decision, not a routine fix for footer failures.

Know what the length measures

RFC 6376 section 3.5 defines l as a count of octets in the canonicalized body. It is not a character count, a line count or the size of an attachment. Canonicalization happens before the length limit is applied. Without l, the entire canonicalized body is covered. A value of zero permits no body content to contribute to the hash; it does not mean unlimited coverage.

If l exceeds the available canonicalized body length, the signature is invalid under the specification's verification rules. The upper bound is the explicit requirement in RFC 6376 section 3.5. An ordinary file-size comparison cannot reliably establish coverage because transfer encoding and canonicalization affect the relevant representation.

Understand why a pass may be misleading

The feature was designed to tolerate additions such as mailing-list trailers. However, RFC 6376 section 8.2 warns that appended content can exploit MIME structure or client rendering so that the recipient sees misleading material while the covered prefix remains intact. A passing signature therefore does not establish the integrity of the entire displayed body when l leaves a suffix uncovered.

Illustrative scenario: a signer covers an initial body prefix. A later processor appends text outside that prefix. The signature can remain valid if the covered prefix and signed headers remain unchanged and other verification checks pass. This is a conceptual coverage example, not a demonstration that every MIME append produces the same result or that a specific client will render it safely.

Inspect before changing policy

For each affected signature, retain the raw message, l, c, h, d and selector. Use a conforming verifier or byte-aware analysis to determine the canonicalized body length and covered prefix. Note whether Content-Type and other interpretation-relevant headers were selected. A header coverage review can expose additional risks, but it does not make unsigned body content signed.

Check whether the recipient system applies special policy to limited-body signatures. RFC 6376 section 8.2 warns signers to be extremely wary of l and notes that assessors might ignore such signatures. Do not promise that a mathematically valid prefix signature will be accepted everywhere.

Prefer complete content at the signing boundary

If the goal is to survive an outbound disclaimer, first evaluate moving the disclaimer before signing or signing the final message with an authorized domain. For mailing lists, examine the list's modification and signing design. These approaches address the processing order rather than hiding the changed suffix from coverage.

If a legacy workflow still uses l, document why, which routes depend on it and what recipient interpretation risks remain. Test removal or replacement in a controlled path with a rollback plan. Do not silently change the signing profile for all mail without checking legitimate delayed and indirect routes.

Make the review outcome specific

The outcome should state whether full or partial body coverage is intended, which messages use it and who accepted the residual risk. Preserve evidence of the exact signature and covered representation. A generic DKIM-pass count is insufficient to close this review because it says nothing about how much body content the signature protects.

Work a canonicalized-length example

Assume a conforming tool measures a canonicalized body of 140 octets and the signature has l=100. The body hash covers the first 100 octets; the remaining 40 are outside body-hash coverage. If the covered prefix and signed headers remain unchanged, further appended content may leave verification successful. If instead the canonicalized body is only 80 octets with l=100, the value violates RFC 6376 section 3.5 and the signature is invalid. These are constructed counts after canonicalization, not raw file sizes or an executed cryptographic test.

Keep a compact investigation record

Use this suggested worksheet for the route under review. It is a planning aid, not evidence of an executed test.

  • Signature: d, selector, c, h and l, or record that l is absent.
  • Coverage: canonicalized body length, covered prefix and unsigned suffix, measured by a conforming tool.
  • Interpretation: Content-Type coverage and effects of MIME/client rendering.
  • Decision: remove partial coverage, redesign signing order or document a narrowly scoped exception.

[ Takeaway ]

l counts canonicalized body octets; absent means full body and zero means no body coverage. Unsigned appended content can mislead the reader while the signature still passes. Prefer signing final content over using partial coverage to accommodate a footer.

[ By role ]

What this means for you

Choose your role for practical next steps.

IT / Mail Admin

Measure after canonicalization

Raw file size is not the protected-body count.

Next steps

  1. Inspect l and c together.
  2. Test removal on controlled flows.

CISO / SecOps

Record residual interpretation risk

Appended content can affect what the recipient sees.

Next steps

  1. Review MIME and client implications.
  2. Name an exception owner.

Founder / Non-technical

Do not equate pass with full coverage

A compatibility workaround can weaken the assurance customers expect.

Next steps

  1. Ask which routes use l.
  2. Fund a final-content signing design.

[ FAQs ]

Frequently asked questions

Is l measured in characters?

No. It counts octets of the canonicalized body.

RFC 6376 §3.5

What happens when l is absent?

The entire canonicalized body is included in body-hash coverage.

RFC 6376 §3.5

Does l=0 mean unlimited?

No. It means zero body octets are covered.

RFC 6376 §3.5

Can l exceed the actual body length?

A value exceeding the canonicalized body length makes the signature invalid under RFC 6376.

RFC 6376 §3.5

Can appended content remain unsigned?

Yes. Content after the covered prefix can be outside the signature’s body coverage.

RFC 6376 §3.5

Will every receiver accept a valid prefix signature?

No. Assessors may apply policy to signatures using l; RFC 6376 specifically warns about the risk.

RFC 6376 §8.2

Does signing Content-Type remove all risk?

No. Relevant header coverage matters, but an unsigned body suffix remains unsigned.

RFC 6376 §8.2

What is the preferred footer repair?

Evaluate applying the footer before final authorized signing rather than limiting body coverage.

[ Sources ]

Sources

  1. RFC 6376 DomainKeys Identified Mail Signatures

    Sections §3.5 · §5.3.1 · §5.4.1 · §6.1.3 · §8.2

  2. RFC 9989 Domain Based Message Authentication Reporting and Conformance

    Sections Introduction · §4.4 · §5.3.5

  3. RFC 8601 Authentication Results

    Sections §1.2 · §7.1

[ Glossary ]

Glossary

DKIM
DomainKeys Identified Mail verifies selected message content against a signing domain’s public key.

RFC 6376 §1

Canonicalization
The specified transformations applied to headers or body before DKIM hashing and verification.

RFC 6376 §3.4

Body-length tag (l)
An optional count limiting how many canonicalized body octets enter the DKIM body hash.

RFC 6376 §3.5

Octet
Eight bits; DKIM body length counts these units rather than displayed characters.
MIME
Message structure and encodings used to represent text, attachments and multipart content.

RFC 6376 §8.2

Enterprise provenance

Why top financial institutions and governments retired their email security dashboards.

Traditional email authentication platforms sell you a dashboard and ask your engineers to do the labour. In high-stakes environments, manual oversight means delayed enforcement, configuration drift and unmonitored shadow domains.

EmailAuth is the agentic email provenance platform. Our agents enforce p=reject, keep third-party senders aligned and move your domains to full RFC 9989 compliance, the new DMARC standard,, with human-in-the-loop auditability.

Governments Large enterprises Tier-1 financial institutions

SaaS · Dedicated tenancy · Air-gapped on-prem · BYOK encryption

Knowledge Base