ietf-corpus

rfc-2049

Multipurpose Internet Mail Extensions (MIME) Part Five: Conformance Criteria and Examples

N. Freed, N. Borenstein
date1996-11 streamIETF areaapp wg822ext statusDRAFT STANDARD pages24 canonicalhttps://www.rfc-editor.org/rfc/rfc2049 doi10.17487/RFC2049 errataview
This set of documents, collectively called the Multipurpose Internet Mail Extensions, or MIME, redefines the format of messages. This fifth and final document describes MIME conformance criteria as well as providing some illustrative examples of MIME message formats, acknowledgements, and the bibliography. [STANDARDS-TRACK]

obsoletes

Extracted elements (25)

design-rationale §4

Local newline formats (LF-only, bare CR, CRLF, counted records) are considered encodings of canonical RFC 822/MIME, not canonical form itself. Formats that encode CRLF as LF cannot represent binary MIME content containing LF octets that are not line separators.

email

design-rationale §4

The canonical encoding model defines MIME composition as four sequential steps: (1) create body in local form, (2) convert to canonical form, (3) apply transfer encoding, (4) insert into MIME entity with headers. This model is conceptual only — actual implementations may collapse or reorder these steps as long as the resulting messages are equivalent.

email

design-rationale §2

The concept of 'MIME-conformance' is defined to promote interoperability: a system meeting these criteria is considered 'safe' to send virtually any properly-marked data to, because it will treat unknown data as undifferentiated binary rather than displaying it as raw text to users.

email

design-rationale §2

The multipart/digest default body-part type is 'message/rfc822' rather than 'text/plain' because digest containers are intended to hold encapsulated mail messages; using text/plain as the default would misrepresent their structure.

email

design-rationale §4

There is no fixed relationship between a media type and its transfer encoding; the choice between base64 and quoted-printable may appropriately be based on character frequency counts specific to a given body instance, not on the content type alone.

email

interoperability-note §3

Certain literal strings corrupt messages in some SMTP implementations: a period '.' alone on a line and lines beginning with 'From ' (with a space) are known to be altered. Encoders can prevent this by substituting '=2E' and '=46rom ' respectively in quoted-printable.

email

interoperability-note §3

CRLF sequence persistence across gateways and user agents cannot be relied on, as conversion between base64 and quoted-printable may conflate CRLFs with line breaks. Implementations must not depend on CRLF sequences being preserved as something other than line breaks.

email

interoperability-note §3

Lines longer than 76 characters may be wrapped or truncated by some mail transport environments. Applications requiring long lines must differentiate between soft and hard line breaks (e.g., using quoted-printable encoding).

email

interoperability-note §3

NUL characters (US-ASCII value 0) are problematic in Internet mail and must not be relied upon to be preserved, because many C runtime library routines treat NUL as a terminator.

email

interoperability-note §3

Only 73 characters are guaranteed to survive all known gateways intact: upper/lowercase A-Z and a-z, digits 0-9, and eleven punctuation characters. Base64 encoding confines itself to this invariant set and is thus maximally portable.

email

interoperability-note §3

Trailing whitespace characters (SPACE, TAB) on a line may be discarded or padded by transport agents; their persistence cannot be relied on. TAB characters may also be converted to variable numbers of spaces in some environments.

email

normative-requirement §2 MUST

A conformant agent MUST recognize and interpret the Content-Type header field, avoid showing users raw data with a non-text Content-Type, and be capable of sending at least text/plain messages with an explicit charset parameter when the character set is not US-ASCII.

email

normative-requirement §2 MUST

A conformant agent must recognize the 'multipart/digest' subtype and use 'message/rfc822' (not 'text/plain') as the default media type for body parts inside multipart/digest entities. Unrecognized multipart subtypes must be treated as 'multipart/mixed'.

email

normative-requirement §2 MUST

A MIME-conformant agent MUST recognize the Content-Transfer-Encoding header field and decode all data encoded with quoted-printable or base64. The identity encodings 7bit, 8bit, and binary must also be recognized. Non-7bit data sent without encoding must be labelled 8bit or binary, and if the underlying transport (e.g., SMTP) does not support these, the data must be encoded and labelled with quoted-printable or base64.

email

normative-requirement §2 MUST

A MIME-conformant mail user agent MUST always generate a 'MIME-Version: 1.0' header field in any message it creates.

email

normative-requirement §2 MUST

An implementation MUST treat any unrecognized Content-Transfer-Encoding as if the body had a Content-Type of 'application/octet-stream', regardless of whether the Content-Type itself is recognized.

email

normative-requirement §2 MUST

Conformant agents MUST ignore any content-type parameters whose names they do not recognize, ensuring forward compatibility with future MIME parameter extensions.

email

normative-requirement §2 MUST

Conformant agents must recognize and display 'message/rfc822' encapsulations in a way that preserves recursive structure, displaying or offering to display the encapsulated data according to its own media type. Unrecognized message subtypes must be treated as 'application/octet-stream'.

email

normative-requirement §2 MUST

Conformant agents must recognize the 'multipart/alternative' subtype and avoid showing the user redundant parts. They must also recognize 'multipart/mixed' and display all body parts individually.

email

normative-requirement §2 MUST

Conforming user agents must be able to distinguish encoded-words from 'text', 'ctext', or 'word' tokens wherever they appear in message headers, and MUST support both the 'B' (base64) and 'Q' (quoted-printable) encodings for any character set they support.

email

normative-requirement §2 MUST

Conforming user agents must ensure that any string within a '*text' or '*ctext' that begins with '=?' and ends with '?=' is a valid encoded-word. Similarly, any 'word' within a 'phrase' matching that pattern must be a valid encoded-word.

email

normative-requirement §2 MUST

Conforming user agents MUST include proper MIME labelling when sending anything other than plain US-ASCII text. Sending non-US-ASCII text without a MIME-Version field is strongly discouraged as it impedes interoperability.

email

normative-requirement §2 MUST NOT

Conforming user agents MUST NOT send non-MIME messages containing anything other than US-ASCII text. If non-standard support for non-US-ASCII in non-MIME messages is provided, it MUST apply only to received messages.

email

normative-requirement §2 MUST

Upon encountering any unrecognized Content-Type field, an implementation MUST treat it as 'application/octet-stream' with no parameter sub-arguments, offering the user options such as saving the decoded data to a file or passing it to a named program.

email

security-consideration §6

Security issues applicable to MIME are discussed in RFC 2046 (MIME Part Two: Media Types); this document (RFC 2049) does not independently define security requirements beyond that reference.

email, security