Skip to contentSkip to navigationSkip to topbar
Page toolsOn this page
Looking for more inspiration?Visit the

Canonicalization


Internet standard. The standardization of email messages formatting that enables consistent hashed values for validating email messages.

To generate the comparison values in metadata like a DKIM-Signature, a sending email server standardizes both headers and body content. This process is called canonicalization. Standards like DKIM follow the Internet Message Format(link takes you to an external page) format. Given this standard format, an email message can still undergo some mild modifications in transit. You can choose the level of tolerance you have for these changes as they get authenticated.

  • If you want to accept common modification, choose relaxed.
  • If you don't want to tolerate any changes, choose simple.
  • You can set this value for both the header and body independently, with the header listed first, then a forward slash (/), then the body.
  • This value defaults to simple/simple.

This results in accepted combinations of simple/simple, simple/relaxed, relaxed/simple, and relaxed/relaxed. If you only provide one value, like relaxed, that value applies to the header. The body gets set to simple and the complete value becomes relaxed/simple.

The service that generates your DKIM signatures sets the method, or algorithm, applied to the header and body content.

  • On email servers that you manage, you set the canonicalization value in the DKIM configuration file.
  • Most large scale email servers set their value to relaxed/relaxed.
  • Twilio SendGrid sets this value to relaxed/simple.

Header canonicalization for DKIM

header-canonicalization-for-dkim page anchor

When writing about canonalization, the following changes get made to email headers:

AlgorithmChanges made
simpleNoneKeeps headers as byte-for-byte identical to the original.
relaxedLowercase header namesConverts header names, not values, to lowercase.
Unfold header linesCollapses multiline headers into single lines.
Compress whitespaceReduces multiple tabs or spaces to single spaces.
Trim whitespaceRemoves spaces at the start and end of lines and after colons.

Body canonicalization for DKIM

body-canonicalization-for-dkim page anchor

When writing about canonalization, the following changes get made to email message bodies:

AlgorithmChanges madeResult
simpleTrim blank linesIgnores blank lines at the end of the message.
relaxedTrim blank linesIgnores blank lines at the end of the message.
Compress whitespaceReduces multiple tabs or spaces within a line to single spaces.
Trim whitespaceRemoves spaces at the end of lines.