DKIM Canonicalization

DKIM canonicalization explained: simple vs relaxed header and body algorithms, and why forwarding breaks simple.

simplerelaxed
Header canonicalizationExact match including all whitespace and foldingCollapses whitespace, removes trailing empty lines, lowercases header names
Body canonicalizationExact match including trailing empty linesCollapses multiple spaces, removes trailing empty lines, strips trailing whitespace
Survives forwarding?No: any modification breaks the hashYes: tolerant of minor reformatting
RecommendedNo (too fragile)Yes (standard choice)

Technical details

DKIM canonicalization is the process of normalizing an email message's headers and body into a standard form before computing the cryptographic hash, defined in RFC 6376 Section 3.4.

Two algorithms exist for each of headers and body: simple (no modification, exact match) and relaxed (whitespace collapsing, header name lowercasing, trailing whitespace removal).

Relaxed canonicalization is recommended because simple canonicalization breaks whenever an intermediate server modifies whitespace or refolds headers, which is common during email forwarding.

Frequently asked questions

What is the default DKIM canonicalization?+

The default is simple/simple if the c= tag is not specified in the DKIM-Signature header. Most providers default to relaxed/relaxed instead.

Can I mix simple and relaxed?+

Yes, the c= tag can specify different algorithms for headers and body independently (e.g., c=relaxed/simple). But relaxed/relaxed is recommended.

Does canonicalization affect which headers are signed?+

No. The h= list chooses which headers are signed; canonicalization only normalizes whitespace and folding before hashing so transit modifications do not break verification.

Check your domain with our free tools: SPF checker, DMARC checker, DKIM checker.

Last verified: 2026-10-28