MIME and mail
From Helpful
| This article/section is a stub — probably a pile of half-sorted notes and assertions some of which may well be wrong, and not verified as a whole. Feel free to add or refine. |
Contents |
MIME
MIME (Multipurpose Internet Mail Extensions) is a container format mostly commonly used in mail sent over SMTP.
(The combination is sometimes called SMTP/MIME, but this is often avoided to avoid confusion with S/MIME, a public-key scheme that allows the signing and encrypting of MIME messages)
MIME deals with text coding (character set specification, and non-ASCII headers), but also with message structure, particularly multi-part bodies, which allows attachments (text and non-text), and message nesting (useful in replying and forwarding messages verbatim, including attachments).
See also Binary-to-text coding#Base64 and Binary-to-text coding#Quoted Printable
MIME types
'MIME type' is now called Internet media type.
'MIME compatible'
Specific parts of MIME-formatted messages may not contain certain characters, which means things like control characters (0x00-0x1F, 0x7F), and non-ASCII (0x80-0xFF)(verify).
Some characters (like 0x0D, 0x0A) may be parsed out.
As a result:
- binary data cannot be safely embedded as-is, and must be encoded using Base64, which is a simple transformation of binary data into printable ASCII characters (similar to as do uuencode, binhex), taking more space in the process.
- some character codings cannot be used. For example, For example, SCSU cannot be used in MIME (without also Base64ing it, which would negate much of its coding efficiency).
See also
Standards:
- RFC 2821: 'Simple Mail Transfer Protocol)' (SMTP)
- RFC 2822: 'Internet Message Format' (mostly outdates RFC 822)
- RFC 822: 'Standard for the Format of ARPA Internet Text Messages'
And also:
- RFC 2045: 'MIME Part One: Format of Internet Message Bodies'
- RFC 2046: 'MIME Part Two: Media Types'
- RFC 2047: 'MIME Part Three: Message Header Extensions for Non-ASCII Text'
- RFC 2231: 'MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations'
Also related, perhaps a little less interesting:

