The Content-MD5 Header Field
obsoletes
- rfc-1544 — The Content-MD5 Header Field
Extracted elements (12)
Content-MD5 was introduced because existing MIME mechanisms, while protecting data during transport encoding/decoding, do not provide a mechanism for verifying that decoded data remain intact. The field fills the gap between transport-level encoding and verified data integrity.
Use of Content-MD5 is RECOMMENDED whenever data integrity is desired but Privacy-Enhanced Mail services are not available, positioning it as a lightweight alternative to PEM for integrity-only scenarios.
Textual data is regularly altered during normal mail delivery; addition or deletion of trailing whitespace produces a different MD5 digest. Therefore, when Content-MD5 is used, either quoted-printable or base64 SHOULD be employed as the content-transfer-encoding to prevent spurious integrity failures.
Content-MD5 may only be added to MIME entities of a 'leaf' nature; it MUST NOT be used with content types multipart or message/rfc822.
For textual data, the MD5 algorithm MUST be computed on data where each newline is represented by a CR-LF pair, as required by MIME canonical form.
If the Content-MD5 field is present, a recipient user agent MAY use it to verify that the MIME entity's contents have not been modified during transport.
Message relays and gateways are expressly forbidden to alter their processing based on the presence of the Content-MD5 field. However, a gateway is allowed to remove the field if the corresponding MIME entity is translated into a different content-type.
The Content-MD5 field MUST be generated only by an originating user agent. Message relays and gateways are expressly forbidden from generating a Content-MD5 field.
The MD5 algorithm MUST be computed on the canonical form of the MIME entity's object, after conversion to canonical form but before applying any content-transfer-encoding. The receiver also applies MD5 after undoing content-transfer-encoding.
Content-MD5 is an optional MIME header field that serves as a message integrity check (MIC). It may be used to verify that decoded data are identical to the data originally sent, and may also appear in encapsulated headers of message/external-body objects.
Content-MD5 provides a data integrity service that protects against accidental modification in transit from sender to recipient. It does not provide a secure integrity service; Privacy Enhanced Mail (PEM) is conjectured to protect data from all modifications, including intentional ones.
The MD5 algorithm produces a 128-bit digest, yielding 16 octets in network byte order (big-endian). These 16 octets are then base64-encoded to produce the Content-MD5 field value (e.g., 'Q2hlY2sgSW50ZWdyaXR5IQ==').