ietf-corpus

rfc-2045

Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies

N. Freed, N. Borenstein
date1996-11 streamIETF areaapp wg822ext statusDRAFT STANDARD pages31 canonicalhttps://www.rfc-editor.org/rfc/rfc2045 doi10.17487/RFC2045 errataview
This initial document specifies the various headers used to describe the structure of MIME messages. [STANDARDS-TRACK]

obsoletes

updated by

Extracted elements (31)

design-rationale §6.4

Content-Transfer-Encoding is kept independent of Content-Type because encoding appropriateness varies by transport (e.g., 8bit transport needs no encoding for many charsets, while 7bit SMTP does), and different instances of the same media type may require different encodings.

email

design-rationale §6.4

Encoding of composite (multipart/message) body types is forbidden to prevent nested encodings, which add complexity, obscure message structure, and require multiple decode passes just to determine body types. Compatibility and robustness over elegance was the guiding principle of the working group.

email

design-rationale §6.8

The base64 alphabet was chosen because it is represented identically in all versions of ISO 646 and EBCDIC, meeting portability requirements for binary mail transport that alternatives like uuencode, binhex, and base85 do not satisfy.

email

design-rationale §6.2

Two transfer encodings are defined (quoted-printable and base64) because there is a tradeoff: quoted-printable preserves human readability for mostly-7bit data, while base64 provides compact uniform encoding for largely binary data. A single encoding cannot optimize for both.

email

interoperability-note §6.7

Quoted-Printable encoded bodies will work reliably over most mail gateways but may not work perfectly over gateways involving EBCDIC translation. For higher reliability through EBCDIC gateways, additionally quoting '!"#$@[\]^`{|}~' per rule #1 is recommended; base64 offers yet higher confidence.

email

interoperability-note §4

When checking MIME-Version values, any RFC 822 comment strings present must be ignored. For example, 'MIME-Version: 1.(produced by MetaSend Vx.x)0' is equivalent to 'MIME-Version: 1.0'.

email

normative-requirement §5.1 MUST

A subtype specification is MANDATORY in a Content-Type header field; it may not be omitted. There are no default subtypes.

email

normative-requirement §6.4 MUST

Any entity with an unrecognized Content-Transfer-Encoding MUST be treated as if it has a Content-Type of 'application/octet-stream', regardless of what the Content-Type header field actually says.

email

normative-requirement §6.8 MUST

Base64-encoded output stream lines must be no more than 76 characters each. All line breaks and characters not in the base64 alphabet must be ignored by decoding software.

email

normative-requirement §6.7 MUST

In Quoted-Printable, composers MUST NOT generate non-zero length transport padding (trailing LWSP before CRLF on encoded lines), but receivers MUST be able to handle such padding added by message transports.

email

normative-requirement §6.7 MUST

In Quoted-Printable encoding, hexadecimal digits MUST be uppercase; lowercase letters in 'abcdef' are formally illegal. TAB and SPACE MUST NOT appear at the end of an encoded line; trailing whitespace must be deleted on decode.

email

normative-requirement §5.2 SHOULD

In the absence of a Content-Type header field, or when a syntactically invalid Content-Type is encountered, the default media type is 'text/plain; charset=us-ascii'. This default SHOULD also be assumed for syntactically invalid Content-Type fields.

email

normative-requirement §6.4 MUST NOT

It is EXPRESSLY FORBIDDEN to use any Content-Transfer-Encoding other than '7bit', '8bit', or 'binary' with any composite media type (currently 'multipart' and 'message'). All desired encodings must be applied at the innermost body level.

email

normative-requirement §4 MUST

Messages composed in accordance with RFC 2045 MUST include a MIME-Version header field with the verbatim value '1.0'. This field is required at the top level of a message but not for each body part of a multipart entity.

email

normative-requirement §5 MUST

MIME implementations MUST ignore any Content-Type parameters whose names they do not recognize. This ensures forward compatibility with new parameters.

email

normative-requirement §6.3 MUST

New standardized Content-Transfer-Encoding values must be specified by a standards-track RFC; all CTE namespace except 'X-' prefixed tokens is reserved to the IETF. Private CTEs must use an 'X-' prefix.

email, registry

normative-requirement §5 MUST

New top-level media type tokens not prefixed with 'X-' must be defined by a standards-track extension to the MIME standard and registered with IANA. Private experimental types must use an 'X-' prefix.

email, registry

normative-requirement §6.8 MUST

Text line breaks must be converted to CRLF sequences before base64 encoding when encoding text that has not been converted to canonical form. This may be done directly by the encoder rather than as a separate canonicalization step.

email

normative-requirement §7 REQUIRED

The Content-ID header field is generally optional but its use is MANDATORY in implementations that generate data of the 'message/external-body' media type; each such entity must have a Content-ID to permit caching.

email

normative-requirement §6.2 MUST

The proper Content-Transfer-Encoding label MUST always be used. Labelling unencoded data containing 8bit characters as '7bit' is not allowed, nor is labelling non-line-oriented data as anything other than 'binary'.

email

normative-requirement §6.7 MUST

When encoding binary data in Quoted-Printable, CR and LF MUST be encoded as '=0D' and '=0A' respectively; a CRLF in binary data must be encoded as '=0D=0A' to avoid incorrect decoding on platforms with different newline conventions.

email

protocol-element §8

The Content-Description header field ('Content-Description: *text') is always optional and provides a human-readable description of the body, presumed in US-ASCII. Non-ASCII values may use the RFC 2047 encoding mechanism.

email

protocol-element §7

The Content-ID header field is syntactically identical to the Message-ID field ('Content-ID: ' msg-id) and must be generated to be world-unique. It uniquely identifies MIME entities for reference and caching purposes.

email

registry §5.1

MIME media types (top-level types and subtypes) are registered with IANA as specified in RFC 2048. New standard subtype values must be registered; private values use an 'X-' prefix and cannot be registered.

email, registry

registry §6.3

The Content-Transfer-Encoding namespace is reserved to the IETF except for 'X-' prefixed private tokens. New standardized CTE values must be specified by a standards-track RFC meeting requirements in RFC 2048.

email, registry

security-consideration §11

Security issues for MIME are discussed in RFC 2046 (the second document in the MIME set). RFC 2045 itself defers security considerations to that companion document.

email, security

wire-format §6.8

Base64 encodes 24-bit groups of input as 4 printable characters using a 65-character US-ASCII alphabet (A–Z, a–z, 0–9, '+', '/', '=' for padding). Output lines must be no more than 76 characters; padding uses '=' to complete the final quantum to a multiple of 4 characters.

email, crypto

wire-format §6.7

In Quoted-Printable encoding, any octet may be represented as '=' followed by two uppercase hexadecimal digits (e.g., '=3D' for '='). Encoded lines must be no more than 76 characters long, not counting the trailing CRLF; soft line breaks are indicated by '=' as the last character.

email

wire-format §6.1

The Content-Transfer-Encoding field value is a single case-insensitive token: one of '7bit', '8bit', 'binary', 'quoted-printable', 'base64', or an ietf-token or x-token. The default value when the field is absent is '7bit'.

email

wire-format §5.1

The Content-Type header field syntax is 'Content-Type: type "/" subtype *(";", parameter)'. Type and subtype names are case-insensitive; parameter names are case-insensitive but parameter values are case-sensitive unless otherwise specified.

email

wire-format §4

The MIME-Version field is encoded as 'MIME-Version: ' followed by two integer fields separated by a period (e.g., '1.0'). RFC 822 comment strings present in the value MUST be ignored when checking the version.

email