view Side-By-Side changes
Network Working GroupN.Nathaniel Borenstein Internet DraftFirst Virtual Holdings Expires in six months N. Freed, Innosoft May 1994 MIME (MultipurposeNed Freed <draft-ietf-822ext-mime-imb-01.txt> Multipurpose Internet MailExtensions)Extensions (MIME) Part One:Mechanisms for Specifying and Describing theFormat of Internet Message Bodies<draft-ietf-822ext-mime-imb-00.txt>November 21, 1994 Status of this Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of sixmonths andmonths. Internet-Drafts may be updated, replaced, or obsoleted by other documents at any time. It isinappropriatenot appropriate to useInternet- DraftsInternet-Drafts as reference material or to cite them other than as``worka "working draft" or "work inprogress.''progress". To learn the current status of any Internet-Draft, please check the``1id-abstracts.txt''1id-abstracts.txt listing contained in theInternet- DraftsInternet-Drafts Shadow Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe), ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim). Internet Draft MIME Part One November 1994 1. Abstract STD 11, RFC 822 defines a message representation protocolwhich specifiesspecifying considerable detail about message headers, but which leaves the message content, or message body, as flatASCIIUS-ASCII text. This document redefines the format of message bodies to allow multi-part textual and non-textual message bodies to be represented and exchanged without loss of information. This is based on earlier work documented in RFC 934, STD 11, and RFC 1049, but extends and revisesthat work.them. Because RFC 822 said so little about message bodies, this document is largely orthogonal to (rather than a revision of) RFC 822.Borenstein & Freed [Page i]In particular, this document is designed to provide facilities to include multipleobjectsparts in a single message, to represent body text in character sets other thanUS- ASCII,US-ASCII, to represent formatted multi-font text messages, to represent non-textual material such as images and audio fragments, and generally to facilitate later extensions defining new types of Internet mail for use by cooperating mail agents. This document does NOT extend Internet mail header fields to permit anything other than US-ASCII text data. Such extensions are the subject ofa companion document [RFC -1522].[RFC-MIME-HEADERS]. This document is a revision of RFC 1521, which was a revision of RFC 1341. Significant differences from RFC 1521 are summarized in AppendixH. Borenstein & Freed [Page ii] THIS PAGE INTENTIONALLY LEFT BLANK. The table of contents should be inserted after this page. Borenstein & Freed [Page iii]G. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 2] Internet Draft MIME Part One November 19941 Introduction Since its publication in 1982, RFC 822 [RFC-822] has defined the standard format2. Table oftextual mail messages on the Internet. Its success has been such that the RFC 822 format has been adopted, wholly or partially, well beyond the confinesContents 1 Abstract .............................................. 2 2 Table ofthe InternetContents ..................................... 3 3 Introduction .......................................... 5 4 Notations, Conventions, andthe Internet SMTP transport defined by RFC 821 [RFC-821]. As the format has seen wider use, a number of limitations have proven increasingly restrictive for the user community. RFC 822 was intended to specify a format for text messages. As such, non-text messages, such as multimedia messages that might include audio or images, are simply not mentioned. Even in the caseGeneric BNF Grammar ....... 9 5 MIME Header Fields .................................... 12 5.1 MIME-Version Header Field ........................... 12 5.2 Content-Type Header Field ........................... 14 5.2.1 Syntax oftext, however, RFC 822 is inadequate fortheneedsContent-Type Header Field ........... 15 5.2.2 Definition ofmail users whose languages require the usea Top-Level Content-Type ............ 18 5.2.3 Initial Set ofcharacter sets richer than US ASCII [US-ASCII].Top-Level Content-Types ............ 18 5.3 Content-Transfer-Encoding Header Field .............. 21 5.3.1 Content-Transfer-Encoding Syntax .................. 21 5.3.2 Content-Transfer-Encoding Semantics ............... 22 5.3.3 Quoted-Printable Content-Transfer-Encoding ........ 26 5.3.4 Base64 Content-Transfer-Encoding .................. 30 5.4 Content-ID Header Field ............................. 32 5.5 Content-Description Header Field .................... 33 5.6 Additional MIME Header Fields ....................... 33 6 Predefined Content-Type Values ........................ 34 6.1 Discrete Content-Type Values ........................ 34 6.1.1 Text Content-Type ................................. 34 6.1.1.1 Representation of Line Breaks ................... 35 6.1.1.2 Charset Parameter ............................... 35 6.1.1.3 Plain Subtype ................................... 38 6.1.1.4 Unrecognized Subtypes ........................... 38 6.1.2 Image Content-Type ................................ 39 6.1.3 Audio Content-Type ................................ 39 6.1.4 Video Content-Type ................................ 40 6.1.5 Application Content-Type .......................... 40 6.1.5.1 Octet-Stream Subtype ............................ 41 6.1.5.2 PostScript Subtype .............................. 42 6.1.5.3 Other Application Subtypes ...................... 45 6.2 Composite Content-Type Values ....................... 46 6.2.1 Multipart Content-Type ............................ 46 6.2.1.1 Common Syntax ................................... 48 6.2.1.2 Handling Nested Messages and Multiparts ......... 53 6.2.1.3 Mixed Subtype ................................... 53 6.2.1.4 Alternative Subtype ............................. 53 6.2.1.5 Digest Subtype .................................. 56 6.2.1.6 Parallel Subtype ................................ 57 6.2.1.7 Other Multipart Subtypes ........................ 57 6.2.2 Message Content-Type .............................. 57 Expires May 1995 [Page 3] Internet Draft MIME Part One November 1994 6.2.2.1 RFC822 Subtype .................................. 58 6.2.2.2 Partial Subtype ................................. 58 6.2.2.2.1 Message Fragmentation and Reassembly .......... 59 6.2.2.2.2 Fragmentation and Reassembly Example .......... 60 6.2.2.3 External-Body Subtype ........................... 62 6.2.2.3.1 General External-Body Parameters .............. 64 6.2.2.3.2 The 'ftp' and 'tftp' Access-Types ............. 65 6.2.2.3.3 The 'anon-ftp' Access-Type .................... 66 6.2.2.3.4 The 'local-file' Access-Type .................. 66 6.2.2.3.5 The 'mail-server' Access-Type ................. 66 6.2.2.3.6 Examples and Further Explanations ............. 67 6.2.2.4 Other Message Subtypes .......................... 70 7 Experimental Content-Type Values ...................... 71 8 Summary ............................................... 72 9 Security Considerations ............................... 73 10 Authors' Addresses ................................... 74 11 Acknowledgements ..................................... 75 A MIME Conformance ...................................... 77 B Guidelines For Sending Email Data ..................... 80 C A Complex Multipart Example ........................... 83 D Collected Grammar ..................................... 85 F Summary of the Seven Content-types .................... 88 G Canonical Encoding Model .............................. 91 H Changes from RFC 1521 ................................. 94 I References ............................................ 97 Expires May 1995 [Page 4] Internet Draft MIME Part One November 1994 3. Introduction Since its publication in 1982, RFC 822does not specify mechanisms for mail containing audio, video, Asian language text, or even text in most European languages, additional specifications are needed. One of[RFC-822] has defined thenotable limitationsstandard format ofRFC 821/822 basedtextual mailsystems ismessages on thefactInternet. Its success has been such thatthey limitthecontents of electronic mail messagesRFC 822 format has been adopted, wholly or partially, well beyond the confines of the Internet and the Internet SMTP transport defined by RFC 821 [RFC-821]. As the format has seen wider use, a number of limitations have proven increasingly restrictive for the user community. RFC 822 was intended to specify a format for text messages. As such, non-text messages, such as multimedia messages that might include audio or images, are simply not mentioned. Even in the case of text, however, RFC 822 is inadequate for the needs of mail users whose languages require the use of character sets richer than US-ASCII. Since RFC 822 does not specify mechanisms for mail containing audio, video, Asian language text, or even text in most European languages, additional specifications are needed. One of the notable limitations of RFC 821/822 based mail systems is the fact that they limit the contents of electronic mail messages to relatively short lines ofseven-bit ASCII.7-bit US-ASCII. This forces users to convert anynon- textualnon-textual data that they may wish to send into seven-bit bytes representable as printableASCIIUS-ASCII characters before invoking a local mail UA (User Agent, a program with which human users send and receive mail). Examples of such encodings currently used in the Internet include pure hexadecimal, uuencode, the 3-in-4 base 64 scheme specified in RFC 1421, the Andrew Toolkit Representation [ATK], and many others. The limitations of RFC 822 mail become even more apparent as gateways are designed to allow for the exchange of mail messages between RFC 822 hosts and X.400 hosts. X.400 [X400] specifies mechanisms for the inclusion of non-textual body parts within electronic mail messages. The current standards for the mapping of X.400 messages to RFC 822 messages specify either that X.400 non-textual body parts must be converted to (not encoded in)an ASCIIIA5Text format, or that they must be discarded, notifying the RFC 822 user that discarding has occurred. This is clearly undesirable, as information that a user may wish to receive is lost. Even though auser's UAuser agent may not have the capability of dealing with the non-textual Expires May 1995 [Page 5] Internet Draft MIME Part One November 1994 body part, the user might have some mechanism external to the UA that can extract usefulBorenstein & Freed [Page 1] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994information from the body part. Moreover, it does not allow for the fact that the message may eventually be gatewayed back into an X.400 message handling system (i.e., the X.400 message is "tunneled" through Internet mail), where the non-textual information would definitely become useful again. This document describes several mechanisms that combine to solve most of these problems without introducing any serious incompatibilities with the existing world of RFC 822 mail. In particular, it describes:1.(1) A MIME-Version header field, which uses a version number to declare a message to be conformant with this specification and allows mail processing agents to distinguish between such messages and those generated by older or non-conformant software, whichisare presumed to lack such a field.2.(2) A Content-Type header field, generalized from RFC 1049 [RFC-1049], which can be used to specify the type and subtype of data in the body of a message and to fully specify the native representation (encoding) of such data.2.a.(3) A"text" Content-Type value,Content-Transfer-Encoding header field, which can be used torepresent textual information in a number of character sets and formatted text description languagesspecify an auxiliary encoding that was applied to the data ina standardized manner. 2.b. A "multipart" Content-Type value,order to allow it to pass through mail transport mechanisms which may have data or character set limitations. (4) Two additional header fields that can be used tocombine several body parts, possibly of differing types of data, intofurther describe the data in asingle message. 2.c. An "application" Content-Type value,body, the Content-ID and Content-Description header fields. All of these header fields defined in this document are subject to the general syntactic rules for header fields specified in RFC 822. In particular, all of these header fields can include RFC 822 comments, which have no semantic content and should be ignored during MIME processing. The generalized Content-Type header field values can be used totransmit application data or binary data,identify both discrete andhence, among other uses, to implement an electronic mail file transfer service. 2.d.composite bodies. The following types of discrete bodies are currently defined: Expires May 1995 [Page 6] Internet Draft MIME Part One November 1994 (1) A"message""text" Content-Type value,for encapsulating another mail message. 2.ewhich can be used to represent textual information in a number of character sets and formatted text description languages in a standardized manner. (2) An "image" Content-Type value, for transmitting still image (picture) data.Borenstein & Freed [Page 2] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 2.f.(3) An "audio" Content-Type value, for transmitting audio or voice data.2.g.(4) A "video" Content-Type value, for transmitting video or moving image data, possibly with audio as part of the composite video data format.3. A Content-Transfer-Encoding header field,(5) An "application" Content-Type value, which can be used tospecify an auxiliary encoding that was applied to thetransmit application datain order to allow itor binary data, and hence, among other uses, topass throughimplement an electronic mailtransport mechanisms which may have data or character set limitations. 4.file transfer service. Twoadditional header fields thattypes of composite bodies are currently defined: (1) A "multipart" Content-Type value, which can be used tofurther describe the data incombine several body parts, possibly of differing types of data, into a single message. (2) A "message" Content-Type value, for encapsulating another messagebody, the Content-ID and Content-Description header fields. MIME hasor part of a message. MIME's Content-Type mechanism has been carefully designedas an extensible mechanism,to be extensible, and it is expected that the set ofcontent-type/subtypecontent- type/subtype pairs and their associated parameters will grow significantly with time. Several other MIMEfields,entities, most notablyincludingthe list of the name of characterset names,sets registered for MIME usage, are likely to have new values defined over time. In order to ensure that the set of such values is developed in an orderly, well-specified, and public manner, MIMEdefinessets up a registration process which uses the Internet Assigned Numbers Authority (IANA) as a central registry forsuch values. Appendix E provides details about how IANAMIME's extension areas. The registration process isaccomplished.described in RFC REG [RFC- REG]. Finally, to specify and promote interoperability, Appendix A of this document provides a basic applicability statement for a subset of the above mechanisms that defines a minimal level Expires May 1995 [Page 7] Internet Draft MIME Part One November 1994 of "conformance" with this document. HISTORICAL NOTE: Several of the mechanisms described in this document may seem somewhat strange or even baroque at first reading. It is important to note that compatibility with existing standards AND robustness across existing practice were two of the highest priorities of the working group that developed this document. In particular, compatibility was always favored over elegance. MIME was first defined and published asRFCsRFC 1341and 1342[RFC-1341] and RFC1342 [RFC-1342], then revisedas RFCsin RFC 1521 [RFC-1521] and RFC 1522Borenstein & Freed [Page 3] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 [RFC-1521][RFC-1522]. This document is a relatively minor updating of RFC 1521, and is intended to supersede it. The companion document RFC MIME-HEADERS [RFC-MIME-HEADERS] in turn supersedes RFC 1522. The differences between this document and RFC 1521 are summarized in AppendixH.G. Please refer to the current edition of the "IAB Official Protocol Standards" for the standardization state and status of this protocol.SeveralRFC 822 and RFC 1123 [RFC-1123] also provide essential background for MIME since no conforming implementation of MIME can violate them. In addition, several other informational RFC documents will be of interest to the MIME implementor, in particular[RFC 1343],RFC 1344 [RFC-1344], RFC 1345 [RFC-1345], and[RFC-1345]. 2RFC 1524 [RFC-1524]. Expires May 1995 [Page 8] Internet Draft MIME Part One November 1994 4. Notations, Conventions, and Generic BNF GrammarThis document is being published in two versions, one as plain ASCII text and one as PostScript1 . The latter is recommended, though the textual contents are identical. An Andrew-format copy of this document is also available from the first author (Borenstein).Although the mechanisms specified in this document are all described in prose, most are also described formally in themodifiedaugmented BNF notation of RFC 822. Implementors will need to be familiar with this notation in order to understand this specification, and are referred to RFC 822 for a complete explanation of themodifiedaugmented BNF notation. Some of themodifiedaugmented BNF in this document makes reference to syntactic entities that are defined in RFC 822 and not in this document. A complete formal grammar, then, is obtained bycombining the collected grammar appendixAppendix D of thisdocumentdocument, the collected grammar, withthatthe BNF of RFC 822 plus the modifications to RFC 822 defined in RFC 1123, which specifically changes the syntax for `return', `date' and `mailbox'. The term CRLF, in this document, refers to the sequence of the twoASCIIUS-ASCII characters CR(13)(decimal value 13) and LF(10)(decimal value 10) which, taken together, in this order, denote a line break in RFC 822 mail. The term "character set" is used in this document to refer to a method used with one or more tables to convertencoded text toaseriessequence of octets into a sequence of characters. Note that unconditional conversion in the other direction is not required, in that not all characters may be available in a given character set and a character set may provide more than one sequence ofoctets.octets to represent a particular character. This definition is intended to allow various kinds oftextcharacter encodings, from simplesingle- tablesingle-table mappings such asASCIIUS-ASCII to complex table switching methods such as those that use ISO 2022's techniques.__________ 1PostScript is a trademark of Adobe Systems Incorporated. Borenstein & Freed [Page 4] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994However, the definition associated with a MIME character set name must fully specify the mapping to beperformed.performed from octets to characters. In particular, use of external profiling information to determine the exact mapping is not permitted. The term "message", when not further qualified, means either the (complete or "top-level") message being transferred on a network, or a message encapsulated in a body part of type "message". The term "body part", in this document,meansrefers to either the a single part message or one of the partsofin the body of a Expires May 1995 [Page 9] Internet Draft MIME Part One November 1994 multipart entity. A body part has a header and a body, so it makes sense to speak about the body of a body part. The term "entity", in this document, means either a message or a body part. All kinds of entities share the property that they have a header and a body. The term "body", when not further qualified, means the body of an entity, that is the body of either a message or of a body part. NOTE: The previous four definitions are clearly circular. This is unavoidable, since the overall structure of a MIME message is indeed recursive. "7bit data" refers to data that is all represented as short lines of US-ASCII. CR (decimal value 13) and LF (decimal value 10) characters only occur as part of CRLF line separation sequences and no NULs (US-ASCII value 0) are allowed. (1) "8bit data" refers to data that is all represented as short lines, but there may be non-US-ASCII characters (octets with the high-order bit set) present. As with "7bit data" CR and LF characters only occur as part of CRLF line separation sequences and no NULs are allowed. (2) "Binary data" refers to data where any sequence of octets whatsoever is allowed. "Lines" are defined as sequences of octets separated by a CRLF sequences. This is consistent with both RFC 821 and RFC 822. Lines in MIME bodies must also be terminated with a CRLF, but the terminating CRLF on the last line of the body may properly be part of a subsequent boundary marker rather than being part of the body itself. In this document, all numeric and octet values are given in decimal notation.It must be noted thatAll Content-Type values, subtypes, and parameter names as defined in this document are case- insensitive. However, parameter values are case-sensitive unless otherwise specified for the specific parameter. FORMATTING NOTE:This document has been carefully formatted for ease of reading. The PostScript version of this document, in particular, places notes likeNotes, such at this one, provide additional nonessential information which may be skipped by thereader, in a smaller, italicized, font, and indents it as well. In the text version, only the indentationreader Expires May 1995 [Page 10] Internet Draft MIME Part One November 1994 without missing anything essential. The primary purpose of these non-essential notes ispreserved, so if you are reading the text version of this you might consider using the PostScript version instead. However, all such notes will be indented and preceded by "NOTE:" or some similar introduction, even in the text version. Borenstein & Freed [Page 5] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 The primary purpose of these non-essential notes is to convey information aboutto convey information about the rationale of this document, or to place this document in the proper historical or evolutionary context. Such information may in particular be skipped by those who are focused entirely on building a conformant implementation, but may be of use to those who wish to understand whythis document is written as it is. For easecertain design choices were made. Expires May 1995 [Page 11] Internet Draft MIME Part One November 1994 5. MIME Header Fields MIME defines a number ofrecognition, all BNF definitions have been placednew RFC 822 header fields that are used to describe the content of messages. These header fields occur in two contexts: (1) As part of afixed-width font in the PostScriptregular RFC 822 message header. (2) In a MIME body part header within a multipart construct. The formal definition of these header fields is as follows: MIME-message-headers := fields version CRLF [ content CRLF ] [ encoding CRLF ] [ id CRLF ] [ description CRLF ] *( mime-extension-field CRLF ) ; The ordering of the header ; fields implied by thisdocument. 3BNF ; definition should be ignored MIME-part-headers := [ content CRLF ] [ encoding CRLF ] [ id CRLF ] [ description CRLF ] *( mime-extension-field CRLF ) ; The ordering of the header ; fields implied by this BNF ; definition should be ignored The syntax of the various specific MIME header fields will be described in the following sections. 5.1. MIME-Version Header Field Since RFC 822 was published in 1982, there has really been only one format standard for Internet messages, and there has been little perceived need to declare the format standard in use. This document is an independent document that complements RFC 822. Although the extensions in this document have been defined in such a way as to be compatible with RFC Expires May 1995 [Page 12] Internet Draft MIME Part One November 1994 822, there are still circumstances in which it might be desirable for a mail-processing agent to know whether a message was composed with the new standard in mind. Therefore, this document defines a new header field, "MIME- Version", which is to be used to declare the version of the Internet message body format standard in use. Messages composed in accordance with this document MUST include such a header field, with the following verbatim text: MIME-Version: 1.0 The presence of this header field is an assertion that the message has been composed in compliance with this document. Since it is possible that a future document might extend the message format standard again, a formal BNF is given for the content of the MIME-Version field:Borenstein & Freed [Page 6] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT Thus, future format specifiers, which might replace or extend "1.0", are constrained to be two integer fields, separated by a period. If a message is received with a MIME-version value other than "1.0", it cannot be assumed to conform with this specification. Note that the MIME-Version header field is required at the top level of a message. It is not required for each body part of a multipart entity. It is required for the embedded headers of a body of type "message" if and only if the embedded message is itself claimed to be MIME-conformant. It is not possible to fully specify how a mail reader that conforms with MIME as defined in this document should treat a message that might arrive in the future with some value of MIME-Version other than "1.0".However, conformant software is encouraged to check the version number and at least warn the user if an unrecognized MIME-version is encountered.It is also worth noting that version control for specific content-types is not accomplished using the MIME-Version mechanism. In particular, some formats (such as application/postscript) have version numbering conventions that are internal to the document format. Where such conventions exist, MIME does nothing to supersede them. Where Expires May 1995 [Page 13] Internet Draft MIME Part One November 1994 no such conventions exist, a MIME type might use a "version" parameter in the content-type field if necessary. NOTE TO IMPLEMENTORS:All header fields defined in this document, including MIME-Version, Content-type, etc., are subject to the general syntactic rules for header fields specified inWhen checking MIME-Version values any RFC822.822 comment strings that are present must be ignored. In particular,all can include comments, which means thatthe followingtwofour MIME-Version fields are equivalent: MIME-Version: 1.0 MIME-Version: 1.0(Generated(produced byGBD-killer 3.7) Borenstein & Freed [Page 7] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 4 TheMetaSend Vx.x) MIME-Version: (produced by MetaSend Vx.x) 1.0 MIME-Version: 1.(produced by MetaSend Vx.x)0 5.2. Content-Type Header Field The purpose of the Content-Type field is to describe the data contained in the body fully enough that the receiving user agent can pick an appropriate agent or mechanism to present the data to the user, or otherwise deal with the data in an appropriate manner. HISTORICAL NOTE: The Content-Type header field was first defined in RFC 1049. RFC 1049Content- typesContent-types used a simpler and less powerful syntax, but one that is largely compatible with the mechanism given here. The Content-Type header field is used to specify the nature of the data in the body of an entity, by giving type and subtype identifiers, and by providing auxiliary information that may be required for certain types. After the type and subtype names, the remainder of the header field is simply a set of parameters, specified in an attribute/value notation. Theset of meaningful parameters differs for the different types. In particular, there are NO globally-meaningful parameters that apply to all content-types. Global mechanisms are best addressed, in the MIME model, by the definition of additional Content-* header fields. Theordering of parameters is not significant.Among the defined parameters is a "charset" parameter by which the character set used in the body may be declared. Comments are allowed in accordance with RFC 822 rules for structured header fields.In general, the top-level Content-Type is used to declare the general type of data, while the subtype specifies a specific format for that type of data. Thus, a Content-Type of "image/xyz" is enough to tell a user agent that the data is an image, even if the user agent has no knowledge of the specific image format "xyz". Such information can be used, for example, to decide whether or not to show a user the raw data Expires May 1995 [Page 14] Internet Draft MIME Part One November 1994 from an unrecognized subtype -- such an action might be reasonable for unrecognized subtypes of text, but not for unrecognized subtypes of image or audio. For this reason, registered subtypes ofaudio, image,text, image, audio, andvideo,video should not contain embedded information that is really of a different type. Such compoundtypesformats should be represented using the "multipart" or "application" types.Borenstein & Freed [Page 8] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994Parameters are modifiers of the content-subtype, and as such do not fundamentally affect therequirementsnature of thehost system. Although mostcontent. The set of meaningful parametersmake sense onlydepends on the content-type and subtype. Most parameters are associated withcertain content-types, othersa single specific subtype. However, a given top-level content-type may define parameters which are"global" in the sense that they might applyapplicable to anysubtype.subtype of that type. For example, the "charset" parameter is applicable to any subtype of "text", while the "boundary" parametermakes sense onlyis required for any subtype of the "multipart"content-type, but the "charset" parameter might make sense with severalcontent-type. There are NO globally-meaningful parameters that apply to all content-types.An initial set of seven Content-Types is defined by this document. This setTruly global mechanisms are best addressed, in the MIME model, by the definition of additional Content-* header fields. An initial set of seven top-levelnamesContent-Types is defined by this document. Five of these are discrete types whose content is essentially opaque as far as MIME processing is concerned. The remaining two are composite types whose contents require additional handling by MIME processors. This set of top-level Content-Types is intended to be substantially complete. It is expected that additions to the larger set of supported types can generally be accomplished by the creation of new subtypes of these initial types. In the future, more top-level types may be defined only byana standards-track extension to this standard. If anotherprimarytop- level type is to be used for any reason, it must be given a name starting with "X-" to indicate its non-standard status and to avoid a potential conflict with a future official name. 5.2.1. Syntax of the Content-Type Header Field In the Augmented BNF notation of RFC 822, a Content-Type header field value is defined as follows: Expires May 1995 [Page 15] Internet Draft MIME Part One November 1994 content := "Content-Type" ":" type "/" subtype *(";" parameter) ;case-insensitive matchingMatching of type and subtype is ; ALWAYS case-insensitive type :="application"discrete-type /"audio"composite-type discrete-type := "text" / "image" /"message""audio" /"multipart""video" /"text""application" /"video"extension-token composite-type := "message" / "multipart" / extension-token; All values case-insensitiveextension-token :=x-token /iana-token / ietf-token / x-token iana-token := <a publicly-defined extension token, registered with IANA, as specified inappendix E>RFC REG [RFC-REG]> ietf-token := <a publicly-defined extension token, initially registered with IANA and subsequently standardized by the IETF> x-token := <The two characters "X-" or "x-" followed, with no intervening white space, by any token> subtype :=token ; case-insensitive Borenstein & Freed [Page 9] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994extension-token parameter := attribute "=" value attribute := token; case-insensitivevalue := token / quoted-string token := 1*<any(ASCII)(US-ASCII) CHAR except SPACE, CTLs, or tspecials> tspecials := "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <">/"/" / "[" / "]" / "?" / "=" ; Must be in quoted-string, ; to use within parameter values Note that the definition of "tspecials" is the same as the RFC 822 definition of "specials" with the addition of the three characters "/", "?", and "=", and the removal of ".". Expires May 1995 [Page 16] Internet Draft MIME Part One November 1994 Note also that a subtype specification isMANDATORY. ThereMANDATORY -- it may not be omitted from a Content-Type header field. As such, there are no default subtypes. The type, subtype, and parameter names are not case sensitive. For example, TEXT, Text, and TeXt are allequivalent.equivalent top-level Content Types. Parameter values are normally case sensitive, butcertain parameterssometimes are interpretedto be case- insensitive,in a case-insensitive fashion, depending on the intended use. (For example, multipart boundaries are case-sensitive, but the"access- type""access-type" parameter for message/External-body is not case-sensitive.) Note that the value of a quoted string parameter does not include the quotes. That is, the quotation marks in a quoted-string are not a part of the value ofan object,the parameter, but are merely used to delimit thatobject.parameter value. In addition, comments are allowed in accordance with RFC 822 rules for structured header fields. Thus the following twoforms:forms Content-type: text/plain; charset=us-ascii (Plain text) Content-type: text/plain; charset="us-ascii" are completely equivalent. Beyond this syntax, the only syntactic constraint on the definition of subtype names is the desire that their uses must not conflict. That is, it would be undesirable to have two different communities using "Content-Type: application/foobar" to mean two different things. TheBorenstein & Freed [Page 10] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994process of defining new content-subtypes, then, is not intended to be a mechanism for imposing restrictions, but simply a mechanism for publicizing the usages. There are, therefore, two acceptable mechanisms for defining new Content-Type subtypes:1.(1) Private values (starting with "X-") may be defined bilaterally between two cooperating agents without outside registration or standardization.2.(2) New standard valuesmustMUST be documented, registered with, and approved by IANA, as described inAppendix E. Where intended for public use, the formats they refer to must also be defined byRFC REG. Expires May 1995 [Page 17] Internet Draft MIME Part One November 1994 5.2.2. Definition of apublished specification, and possibly offered for standardization.Top-Level Content-Type Theseven standard initial predefined Content-Types aredefinition of a top-level content-type consists of: (1) a name and a description of the type, including criteria for whether a particular type would qualify under that type, (2) the names and definitions of parameters, if any, which are defined for all subtypes of that type (including whether such parameters are required or optional), (3) how a user agent and/or gateway should handle unknown subtypes of this type, (4) general considerations on gatewaying objects of this top-level type, if any, and (5) any restrictions on content-transfer-encodings for objects of this top-level type. 5.2.3. Initial Set of Top-Level Content-Types The initial seven standard top-level Content-Types are detailed in the bulk of this document.TheyThe five discrete top- level Content-Types are: (1) text -- textual information. Theprimary subtype, "plain",subtype "plain" in particular indicates plain (unformatted) text. No special software is required to get the full meaning of the text, aside from support for the indicated character set.SubtypesOther subtypes are to be used for enriched text in forms where application software may enhance the appearance of the text, but such software must not be required in order to get the general idea of the content. Possible subtypes thus include anyreadableword processor format that can be read without resorting to software that understands the format. In particular, formats that employ embeddded binary formatting information are not considered directly readable. A very simple and portable subtype, richtext, was defined in RFC 1341 [RFC-1341], with a further revision in RFC 1563[RFC-1563]. multipart[RFC-1563] under the name "enriched". Expires May 1995 [Page 18] Internet Draft MIME Part One November 1994 (2) image --data consisting of multiple parts of independent data types. Four initialimage data. Image requires a display device (such as a graphical display, a graphics printer, or a FAX machine) to view the information. Initial subtypes aredefined, including the primary "mixed" subtype, "alternative"defined forrepresenting the same data in multipletwo widely-used image formats,"parallel" for parts intended to be viewed simultaneously,jpeg and"digest" for multipart entities in which each part is of type "message". messagegif. (3) audio -- audio data. Audio requires anencapsulated message. A body of Content-Type "message" is itself all or part of a fully formatted RFC 822 conformant message which may contain its own different Content-Type header Borenstein & Freed [Page 11] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 field. The primary subtype is "rfc822". The "partial" subtype is defined for partial messages, to permit the fragmented transmission of bodies that are thought to be too large to be passed through mail transport facilities. Another subtype, "External-body", is defined for specifying large bodies by reference to an external data source. image -- image data. Image requires a display device (such as a graphical display, a printer, or a FAX machine) to view the information. Initial subtypes are defined for two widely-used image formats, jpeg and gif. audio -- audio data, with initial subtype "basic". Audio requires an audio output device (such as a speakeraudio output device (such as a speaker or a telephone) to "display" the contents. An initial subtype "basic" is defined in this document. (4) video -- video data. Video requires the capability to display moving images, typically including specialized hardware and software.TheAn initial subtype "mpeg" is"mpeg".defined in this document. (5) application -- some other kind of data, typically either uninterpreted binary data or information to be processed by a mail-based application. Theprimary subtype, "octet-stream",subtype "octet-stream" is to be used in the case of uninterpreted binary data, in which case the simplest recommended action is to offer to write the information into a file for the user.An additional subtype, "PostScript",The "PostScript" subtype is also defined fortransportingthe transport of PostScriptdocuments in bodies.material. Other expected uses for "application" include spreadsheets, data for mail-based scheduling systems, and languages for "active" (computational)email. (Note that active emailemail, andother application data may entail severalword processing formats that are not directly readable. Note that securityconsiderations, whichconsiderations may exist for some types of application data, most notably application/PostScript and any form of active mail. These issues are discussed later in thismemo, particularly in the contextdocument. The two composite top-level Content-Types are: (1) multipart -- data consisting ofapplication/PostScript.) Default RFC 822 messagesmultiple parts of independent data types. Four subtypes aretyped by this protocol as plain text in the US-ASCII character set, which can be explicitly specified as "Content-type: text/plain; charset=us-ascii". If no Content-Type is specified, this default is assumed. Ininitially defined, including thepresence of a MIME-Version headerbasic "mixed" subtype specifying a generic mixed set of parts, "alternative" for representing the same data in multiple formats, "parallel" for parts intended to be viewed simultaneously, and "digest" for multipart entities in which each part is of type "message". Expires May 1995 [Page 19] Internet Draft MIME Part One November 1994 (2) message -- an encapsulated message. A body of Content-Type "message" is itself all or part of some kind of message object. Such objects may in turn contain other messages and body parts of their own. The "rfc822" subtype is used when the encpsulated content is itself an RFC 822 message. The "partial" subtype is defined for partial RFC 822 messages, to permit the fragmented transmission of bodies that are thought to be too large to be passed through mail transport facilities in one piece. Another subtype, "external-body", is defined for specifying large bodies by reference to an external data source. Default RFC 822 messages without a MIME Content-Type header are taken by this protocol to be plain text in the US-ASCII character set, which can be explicitly specified as: Content-type: text/plain; charset=us-ascii This default is assumed if no Content-Type is specified. In the presence of a MIME-Version header field, a receiving User Agent can also assume that plain US-ASCII text was the sender's intent.InPlain US-ASCII text must still be assumed in the absence of a MIME-Version specification,plain US-ASCII text must still be assumed, Borenstein & Freed [Page 12] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994but the sender's intent might have been otherwise. RATIONALE: In the absence of any Content-Type header field or MIME-Version header field, it is impossible to be certain that a message is actually text in the US-ASCII character set, since it might well be a message that, usingthesome set of nonstandard conventions that predate this document, includes text in another character set or non-textual data in a manner that cannot be automatically recognized (e.g., a uuencoded compressed UNIX tar file). Although there is no fully acceptable alternative to treating such untyped messages as "text/plain; charset=us-ascii", implementors should remain aware that if a message lacks both the MIME-Version and the Content-Type header fields, it may in practice contain almost anything. It should be noted that the list of Content-Type values given here may be augmented in time, via the mechanisms described above, and that the set of subtypes is expected to grow substantially. Expires May 1995 [Page 20] Internet Draft MIME Part One November 1994 When a mail reader encounters mail with an unknown Content- type value, it should generally treat it as equivalent to "application/octet-stream", as described later in this document.Borenstein & Freed [Page 13] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 5 The5.3. Content-Transfer-Encoding Header Field Many Content-Types which couldusefullybe usefully transported via email are represented, in their "natural" format, as 8-bit character or binary data. Such data cannot be transmitted over some transport protocols. For example, RFC 821 (SMTP) restricts mail messages to 7-bit US-ASCII data with lines no longer than 1000 characters. It is necessary, therefore, to define a standard mechanism forre-encodingencoding such data into a 7-bit short-line format.This document specifies that such encodings will be indicated by a new "Content-Transfer-Encoding" header field. The Content-Transfer-Encoding field is used to indicate the typeProper labelling oftransformation that has been used in order to represent the bodyunencoded material inan acceptable manner for transport. Unlike Content-Types, a proliferation of Content-Transfer- Encoding values is undesirable and unnecessary. However, establishing only a single Content-Transfer-Encoding mechanism does not seem possible. There is a tradeoff between the desire for a compact and efficient encoding of largely-binary data and the desireless restrictive formats fora readable encoding of data that is mostly, but not entirely, 7-bit data. For this reason, at least two encoding mechanisms are necessary: a "readable" encoding and a "dense" encoding. The Content-Transfer-Encoding fielddirect use over less restrictive transports isdesigned to specify an invertible mapping between the "native" representation of a type of data and a representationalso desireable. This document specifies thatcan be readily exchanged using 7 bit mail transport protocols,suchas those definedencodings will be indicated byRFC 821 (SMTP).a new "Content-Transfer-Encoding" header field. This field has not been defined by any previous standard. 5.3.1. Content-Transfer-Encoding Syntax The Content-Transfer-Encoding field's value is a single token specifying the type of encoding, as enumerated below. Formally: encoding := "Content-Transfer-Encoding" ":" mechanism mechanism := "7bit"; case-insensitive/ "8bit" / "binary" / "quoted-printable" / "base64" /"8bit" / "binary"ietf-token / x-tokenBorenstein & Freed [Page 14] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994These values are not casesensitive. That is,sensitive -- Base64 and BASE64 and bAsE64 are all equivalent. An encoding type of 7BIT requires that the body is already in aseven-bit mail- ready7-bit mail-ready representation. This is the default value -- that is,"Content-Transfer-Encoding:"Content-Transfer- Encoding: 7BIT" is assumed if the Content-Transfer-Encoding header field is not present. Expires May 1995 [Page 21] Internet Draft MIME Part One November 1994 5.3.2. Content-Transfer-Encoding Semantics This single token actually provides two pieces of information. It specifies what sort of encoding transformation the body was subjected to, and it specifies what the domain of the result is. Three transformations are currently defined: identity, the "quoted-printable" encoding, and the "base64" encoding. The domains are "binary", "8bit" and "7bit". The values"8bit","7bit", "8bit", and "binary" all mean thatNOthe identity (i.e. NO) encoding transformation has been performed.However,As such, theyare potentially usefulserve simply asindicationsindicators of thekinddomain ofdata contained intheobject,body part data, andtherefore ofprovide useful information about thekindsort of encoding that mightneed tobeperformedneeded for transmission in a given transport system.In particular: "7bit" means that the data isThe terms "7bit data", "8bit data", and "binary data" are allrepresented as short linesdefined in Section 4. The quoted-printable and base64 encodings transform their input from an arbitrary domain into material in the "7bit" domain, thus making it safe to carry over restricted transports. The specific definition ofUS-ASCII data. "8bit" means thatthelinestransformations areshort, but there maygiven below. The proper Content-Transfer-Encoding label must always benon-ASCII characters (octets with the high-order bit set). "Binary" means that not only may non-ASCIIused. Labelling unencoded data containing 8-bit charactersbe present, but also that the lines are not necessarily short enough for SMTP transport. The difference between "8bit" (or any other conceivable bit-width token) and the "binary" tokenas "7bit" isthat "binary" doesnotrequire adherence to any limits on line length or to the SMTP CRLF semantics, while the bit-width tokens do require such adherence. If the body containsallowed, nor is labelling unencoded non-line- oriented datain any bit-widthas anything other than7-bit, the appropriate bit-width Content-Transfer-Encoding token must be used (e.g., "8bit" for unencoded 8 bit wide data). If the body contains binary data, the"binary"Content-Transfer-Encoding token must be used. NOTE: The distinction between theallowed. Unlike Content-Type subtypes, a proliferation of Content- Transfer-Encoding valuesof "binary", "8bit", etc. mayis both undesirable and unnecessary. However, establishing only a single transformation into the "7bit" domain does not seemunimportant, in that all of them really mean "none" -- that is, there has been nopossible. There is a tradeoff between the desire for a compact and efficient encoding ofthelargely-binary data and the desire fortransport. However, clear labeling will bea readable encoding ofenormous value to gateways between future mail transport systems with differing capabilities in transportingdata thatdois mostly, but notmeet the restrictions of RFC 821 transport.entirely, 7-bit. For this reason, at least two encoding mechanisms are necessary: a "readable" encoding (quoted-printable) and a "dense" encoding (base64). Mail transport for unencoded 8-bit data is defined inRFC-1426 [RFC-1426].RFC 1652 [RFC-1652]. As of the publication ofBorenstein & Freed [Page 15] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994this document, there are no standardized Internet mail transports for which it is legitimate to include unencoded binary data in mail bodies. Expires May 1995 [Page 22] Internet Draft MIME Part One November 1994 Thus there are no circumstances in which the "binary" Content-Transfer-Encoding is actuallylegalvalid on the Internet. However, in the event that binary mail transport becomes a reality in Internet mail, or when this document is used in conjunction with any other binary-capable transport mechanism, binary bodies should belabeledlabelled as such using this mechanism. NOTE: The five values defined for theContent- Transfer-EncodingContent-Transfer- Encoding field imply nothing about the Content-Type other than the algorithm by which it was encoded or the transport system requirements if unencoded. Implementors may, if necessary, define newContent- Transfer-EncodingContent-Transfer- Encoding values, but must use an x-token, which is a name prefixed by"X-""X-", to indicate its non-standard status, e.g., "Content-Transfer-Encoding: x-my-new-encoding". However, unlike Content-Types and subtypes, the creation of new Content-Transfer-Encoding values isexplicitly and stronglySTRONGLY discouraged, as it seems likely to hinder interoperability with little potential benefit.TheirSuch use is therefore allowed only as the result of an agreement between cooperating user agents. If a Content-Transfer-Encoding header field appears as part of a message header, it applies to the entire body of that message. If a Content-Transfer-Encoding header field appears as part of a body part's headers, it applies only to the body of that body part. If an entity is of type "multipart"or "message",the Content-Transfer-Encoding is not permitted to have any value other thana bit width (e.g.,"7bit","8bit", etc.)"8bit" or "binary". Even more severe restrictions apply to some subtypes of the "message" type. It should be noted that email is character-oriented, so that the mechanisms described here are mechanisms for encoding arbitrary octet streams, not bit streams. If a bit stream is to be encoded via one of these mechanisms, it must first be converted to an 8-bit byte stream using the network standard bit order ("big-endian"), in which the earlier bits in a stream become the higher-order bits in a 8-bit byte. A bit stream not ending at an 8-bit boundary must be padded withBorenstein & Freed [Page 16] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994zeroes. This document provides a mechanism for noting the addition of such padding in the case of theapplicationapplication/octet-stream Content-Type, which has a "padding" parameter. Expires May 1995 [Page 23] Internet Draft MIME Part One November 1994 The encoding mechanisms defined here explicitly encode all data inASCII.US-ASCII. Thus, for example, suppose an entity has header fields such as: Content-Type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: base64 This must be interpreted to mean that the body is a base64ASCIIUS-ASCII encoding of data that was originally in ISO-8859-1, and will be in that character set again after decoding. The following sections will define the two standard encoding mechanisms. The definition of newcontent-transfer- encodingscontent-transfer-encodings is explicitly discouraged and should only occur when absolutely necessary. All content-transfer-encoding namespace except that beginning with "X-" is explicitly reserved to the IANA for future use. Private agreements aboutcontent-transfer-encodingscontent- transfer-encodings are also explicitly discouraged. Certain Content-Transfer-Encoding values may only be used on certain Content-Types. In particular, it isexpressly forbiddenEXPRESSLY FORBIDDEN to use any encodings other than "7bit", "8bit", or "binary" with anyContent-Typecomposite Content-Type, i.e. one that recursively includes other Content-Typefields, notablyfields. Currently the only composite Content-Types are "multipart" and"message" Content-Types."message". All encodings that are desired for bodies of type multipart or message must be done at the innermost level, by encoding the actual body that needs to be encoded. It should also be noted that, by definition, if a"multipart" or "message"composite entity has a transfer-encoding value such as "7bit", but one of the enclosed parts has a less restrictive value such as "8bit", then either the outer "7bit" labelling is in error, because8 bit8-bit data are included, or the inner "8bit" labelling placed an unnecessarily high demand on the transport system because the actual included data were actually7bit-safe.7-bit-safe. NOTE ON ENCODING RESTRICTIONS: Though the prohibition against usingcontent-transfer- encodingscontent-transfer-encodings on composite body dataof type multipart or messagemayBorenstein & Freed [Page 17] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994seem overly restrictive, it is necessary to prevent nested encodings, in which data are passed through an encoding algorithm multiple times, and must be decoded multiple times in order to be properly viewed. Nested encodings add considerable complexity to user agents:asideAside from the obvious efficiency problems with such multiple encodings, they Expires May 1995 [Page 24] Internet Draft MIME Part One November 1994 can obscure the basic structure of a message. In particular, they can imply that several decoding operations are necessary simply to find out what types ofobjectsbodies a message contains. Banning nested encodings may complicate the job of certain mail gateways, but this seems less of a problem than the effect of nested encodings on user agents. NOTE ON THE RELATIONSHIP BETWEEN CONTENT-TYPE ANDCONTENT-TRANSFER-ENCODING:CONTENT- TRANSFER-ENCODING: It may seem that theContent-Transfer-EncodingContent-Transfer- Encoding could be inferred from the characteristics of the Content-Type that is to be encoded, or, at the very least, that certain Content-Transfer-Encodings could be mandated for use with specific Content-Types. There are several reasons why this is not the case. First, given the varying types of transports used for mail, some encodings may be appropriate for someContent- Type/transportContent-Type/transport combinations and not for others. (For example, in an 8-bit transport, no encoding would be required for text in certain character sets, while such encodings are clearly required for 7-bit SMTP.) Second, certain Content-Types may require different types of transfer encoding under different circumstances. For example, many PostScript bodies might consist entirely of short lines of 7-bit data and hence requirelittle ornoencoding.encoding at all. Other PostScript bodies (especially those using Level 2 PostScript's binary encoding mechanism) may only be reasonably represented using a binary transport encoding. Finally, sinceContent-TypeContent- Type is intended to be an open-ended specification mechanism, strict specification of an association between Content-Types and encodings effectively couples the specification of an application protocol with a specific lower-levelBorenstein & Freed [Page 18] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994transport. This is not desirable since the developers of a Content-Type should not have to be aware of all the transports in use and what their limitations are. NOTE ON TRANSLATING ENCODINGS: Thequoted- printablequoted-printable and base64 encodings are designed so that conversion between them is possible. The only issue that arises in such a conversion is the handling of line breaks. When converting fromquoted-printablequoted- printable to base64 a line break must be converted into a CRLF sequence. Similarly, a CRLF sequence in base64 data must be converted to a quoted-printable line break, but ONLY when converting text data. Expires May 1995 [Page 25] Internet Draft MIME Part One November 1994 NOTE ON CANONICAL ENCODING MODEL: There was some confusion, in earlier drafts of thismemo,document, regarding the model for when email data was to be converted to canonical form and encoded, and in particular how this process would affect the treatment of CRLFs, given that the representation of newlines varies greatly from system to system, and the relationship betweencontent-transfer- encodingscontent-transfer-encodings and character sets.For this reason, aA canonical model for encoding is presented as AppendixG. Borenstein & Freed [Page 19] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 5.1F for this reason. 5.3.3. Quoted-Printable Content-Transfer-Encoding The Quoted-Printable encoding is intended to represent data that largely consists of octets that correspond to printable characters in theASCIIUS-ASCII character set. It encodes the data in such a way that the resulting octets are unlikely to be modified by mail transport. If the data being encoded are mostlyASCIIUS-ASCII text, the encoded form of the data remains largely recognizable by humans. A body which is entirely US- ASCII may also be encoded in Quoted-Printable to ensure the integrity of the data should the message pass through a character-translating, and/or line-wrapping gateway. In this encoding, octets are to be represented as determined by the following rules:Rule #1:(1) (General 8-bit representation) Any octet, except those indicating a line break according to the newline convention of the canonical (standard) form of the data being encoded, may be represented by an "=" followed by a two digit hexadecimal representation of the octet's value. The digits of the hexadecimal alphabet, for this purpose, are "0123456789ABCDEF". Uppercase letters must be used when sending hexadecimal data, though a robust implementation may choose to recognize lowercase letters on receipt. Thus, for example, the decimal value 12(ASCII(US-ASCII form feed) can be represented by "=0C", and the decimal value 61(ASCII(US- ASCII EQUAL SIGN) can be represented by "=3D".ExceptThis rule must be followed except when the following rules allow an alternativeencoding, this rule is mandatory. Rule #2:encoding. (2) (Literal representation) Octets with decimal values of 33 through 60 inclusive, and 62 through 126, inclusive, Expires May 1995 [Page 26] Internet Draft MIME Part One November 1994 MAY be represented as theASCIIUS-ASCII characters which correspond to those octets (EXCLAMATION POINT through LESS THAN, and GREATER THAN through TILDE, respectively).Rule #3:(3) (WhiteSpace):Space) Octets with values of 9 and 32 MAY be represented asASCIIUS-ASCII TAB (HT) and SPACE characters, respectively, but MUST NOT be so represented at the end of an encoded line. Any TAB (HT) or SPACE characters on an encoded line MUST thus be followed on that line by a printable character. In particular, an "=" at the end of an encoded line,Borenstein & Freed [Page 20] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994indicating a soft line break (see rule #5) may follow one or more TAB (HT) or SPACE characters. It follows that an octet with decimal value 9 or 32 appearing at the end of an encoded line must be represented according to Rule #1. This rule is necessary because some MTAs (Message Transport Agents, programs which transport messages from one user to another, or perform a part of such transfers) are known to pad lines of text with SPACEs, and others are known to remove "white space" characters from the end of a line. Therefore, when decoding a Quoted-Printable body, any trailing white space on a line must be deleted, as it will necessarily have been added by intermediate transport agents.Rule #4(4) (LineBreaks):Breaks) A line break in a text body,independent of what its representation is followingrepresented as a CRLF sequence in the text canonicalrepresentation of the data being encoded,form, must be represented by a (RFC 822) line break, which is also a CRLF sequence, in the Quoted-Printable encoding. Since the canonical representation of types other than text do not generally include the representation of linebreaks,breaks as CRLF sequences, no hard line breaks (i.e. line breaks that are intended to be meaningful and to be displayed to the user) should occur in thequoted-printablequoted- printable encoding of such types.Of course, occurrences ofSequences like "=0D", "=0A", "=0A=0D" and "=0D=0A" willeventually be encountered. In general, however, base64 is preferred over quoted- printable for binary data.routinely appear in non-text data represented in quoted-printable, of course. Note that many implementations may elect to encode the local representation of various content types directly, as described in AppendixG.F. In particular, this may apply to plain text material on systems that use newline conventions other than CRLF delimiters. Such Expires May 1995 [Page 27] Internet Draft MIME Part One November 1994 an implementation is permissible, but the generation of line breaks must be generalized to account for the case where alternate representations of newline sequences are used.Rule #5(5) (Soft LineBreaks):Breaks) The Quoted-Printable encoding REQUIRES that encoded lines be no more than 76 characters long. If longer lines are to be encoded with the Quoted-Printable encoding,'soft'"soft" line breaks must be used. An equal sign as the last character on a encoded line indicates such a non-significant('soft')("soft") line break in the encoded text. Thus if the "raw" formBorenstein & Freed [Page 21] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994of the line is a single unencoded line that says: Now's the time for all folk to come to the aid of their country. This can be represented, in the Quoted-Printable encoding,asas: Now's the time = for all folk to come= to the aid of their country. This provides a mechanism with which long lines are encoded in such a way as to be restored by the user agent. The 76 character limit does not count the trailing CRLF, but counts all other characters, including any equal signs. Since the hyphen character ("-") is represented as itself in the Quoted-Printable encoding, care must be taken, when encapsulating a quoted-printable encoded body in a multipart entity, to ensure that the encapsulation boundary does not appear anywhere in the encoded body. (A good strategy is to choose a boundary that includes a character sequence such as "=_" which can never appear in a quoted-printable body. See the definition of multipart messages later in this document.) NOTE: The quoted-printable encoding represents something of a compromise between readability and reliability in transport. Bodies encoded with the quoted-printable encoding will work reliably over most mail gateways, but may not work perfectly over a few gateways, notably those involving translation into EBCDIC.(In theory, an EBCDIC gateway could decode a quoted-printable body and re-encode it using base64, but such gateways do not yet exist.)A higher level of confidence is offered by the base64 Content-Transfer-Encoding. A way to get reasonably reliable Expires May 1995 [Page 28] Internet Draft MIME Part One November 1994 transport through EBCDIC gateways is to also quote the US- ASCII characters !"#$@[\]^`{|}~Borenstein & Freed [Page 22] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994according to rule #1. See Appendix B for more information. Because quoted-printable data is generally assumed to be line-oriented, it is to be expected that the representation of the breaks between the lines of quoted printable data may be altered in transport, in the same manner that plain text mail has always been altered in Internet mail when passing between systems with differing newline conventions. If such alterations are likely to constitute a corruption of the data, it is probably more sensible to use the base64 encoding rather than the quoted-printable encoding. WARNING TO IMPLEMENTORS: If binary data are encoded in quoted-printable, care must be taken to encode CR and LF characters as "=0D" and "=0A", respectively. In particular, a CRLF sequence in binary data should be encoded as "=0D=0A". Otherwise, if CRLF were represented as a hard line break, it might be incorrectly decoded on platforms with different line break conventions. For formalists, the syntax of quoted-printable data is described by the following grammar: quoted-printable := ([*(ptext / SPACE / TAB) ptext] ["="] CRLF) ; Maximum line length of 76 characters ; excluding CRLF ptext := octet / safe-char safe-char := <anyASCIIUS-ASCII character except "=", SPACE, or TAB> ;charactersCharacters not listed as "mail-safe" in ; Appendix B;are also not recommended. octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") ;octetOctet must be used for characters > 127, =, ; SPACE, or TAB,;and is recommended for any ; characters not listed in;Appendix B as ; "mail-safe".Borenstein & Freed [Page 23]Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 29] Internet Draft MIME Part One November 19945.2IMPORTANT NOTE: The addition of LWSP between the elements shown in this BNF is NOT allowed since this BNF does not specify a structured header field. 5.3.4. Base64 Content-Transfer-Encoding The Base64 Content-Transfer-Encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. The encoding and decoding algorithms are simple, but the encoded data are consistently only about 33 percent larger than the unencoded data. This encoding is virtually identical to the one used in Privacy Enhanced Mail (PEM) applications, as defined in RFC1421. The base64 encoding is adapted from RFC 1421, with one change: base64 eliminates the "*" mechanism for embedded clear text.1421 [RFC-1421]. A 65-character subset of US-ASCII is used, enabling 6 bits to be represented per printable character. (The extra 65th character, "=", is used to signify a special processing function.) NOTE: This subset has the important property that it is represented identically in all versions of ISO 646, includingUS ASCII,US-ASCII, and all characters in the subset are also represented identically in all versions of EBCDIC. Other popular encodings, such as the encoding used by the uuencode utility and the base85 encoding specified as part of Level 2 PostScript, do not share these properties, and thus do not fulfill the portability requirements a binary transport encoding for mail must meet. The encoding process represents 24-bit groups of input bits as output strings of 4 encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating 3 8-bit input groups. These 24 bits are then treated as 4 concatenated 6-bit groups, each of which is translated into a single digit in the base64 alphabet. When encoding a bit stream via the base64 encoding, the bit stream must be presumed to be ordered with themost- significant-bitmost-significant-bit first. That is, the first bit in the stream will be the high-order bit in the first 8-bit byte, and the eighth bit will be the low-order bit in the first 8-bit byte, and so on. Each 6-bit group is used as an index into an array of 64 printable characters. The character referenced by the index is placed in the output string. These characters, identified Expires May 1995 [Page 30] Internet Draft MIME Part One November 1994 in Table 1, below, are selected so as to be universally representable, and the set excludes characters withBorenstein & Freed [Page 24] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994particular significance to SMTP (e.g., ".", CR, LF) and to the encapsulation boundaries defined in this document (e.g., "-"). Table 1: The Base64 Alphabet Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y The encoded output stream(encoded bytes)must be represented in lines of no more than 76 characters each. All line breaks or other characters not found in Table 1 must be ignored by decoding software. In base64 data, characters other than those in Table 1, line breaks, and other white space probably indicate a transmission error, about which a warning message or even a message rejection might be appropriate under some circumstances. Special processing is performed if fewer than 24 bits are available at the end of the data being encoded. A full encoding quantum is always completed at the end of a body. When fewer than 24 input bits are available in an input group, zero bits are added (on the right) to form an integral number of 6-bit groups. Padding at the end of the data is performed using the'='"=" character. Since all base64 input is an integral number of octets, only the following cases can arise: (1) the final quantum of encoding input is an integral multiple of 24 bits; here, the final unit of encoded output Expires May 1995 [Page 31] Internet Draft MIME Part One November 1994 will be an integral multiple of 4Borenstein & Freed [Page 25] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994characters with no "=" padding, (2) the final quantum of encoding input is exactly 8 bits; here, the final unit of encoded output will be two characters followed by two "=" padding characters, or (3) the final quantum of encoding input is exactly 16 bits; here, the final unit of encoded output will be three characters followed by one "=" padding character. Because it is used only for padding at the end of the data, the occurrence of any'='"=" characters may be taken as evidence that the end of the data has been reached (without truncation in transit). No such assurance is possible, however, when the number of octets transmitted was a multiple of three. Any characters outside of the base64 alphabet are to be ignored in base64-encoded data. The same applies to anyillegalinvalid sequence of characters in the base64 encoding, such as "=====" Care must be taken to use the proper octets for line breaks if base64 encoding is applied directly to text material that has not been converted to canonical form. In particular, text line breaks must be converted into CRLF sequences prior to base64 encoding. The important thing to note is that this may be done directly by the encoder rather than in a prior canonicalization step in some implementations. NOTE: There is no need to worry about quoting apparent encapsulation boundaries withinbase64- encodedbase64-encoded parts of multipart entities because no hyphen characters are used in the base64 encoding.Borenstein & Freed [Page 26] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 6 Additional Content- Header Fields 6.1 Optional5.4. Content-ID Header Field In constructing a high-level user agent, it may be desirable to allow one body to make reference to another. Accordingly, bodies may belabeledlabelled using the "Content-ID" header field, which is syntactically identical to the "Message-ID" header field: id := "Content-ID" ":" msg-id Like the Message-ID values, Content-ID values must be generated to be world-unique. Expires May 1995 [Page 32] Internet Draft MIME Part One November 1994 The Content-ID value may be used for uniquely identifying MIME entities in several contexts, particularly forcacheingcaching data referenced by the message/external-body mechanism. Although the Content-ID header is generally optional, its use ismandatoryMANDATORY in implementations which generate data of the optional MIME Content-type "message/external-body". That is, each message/external-body entity must have a Content-ID field to permitcacheingcaching of such data. It is also worth noting that the Content-ID value has special semantics in the case of the multipart/alternativecontent-type.content- type. This is explained in the section of this document dealing with multipart/alternative.6.2 Optional5.5. Content-Description Header Field The ability to associate some descriptive information with a given body is often desirable. For example, it may be useful to mark an "image" body as "a picture of the Space Shuttle Endeavor." Such text may be placed in theContent- DescriptionContent-Description header field. This header field is always optional. description := "Content-Description" ":" *text The description is presumed to be given in the US-ASCII character set, although the mechanism specified in[RFC- 1522]RFC MIME- HEADERS [RFC-MIME-HEADERS] may be used for non-US-ASCII Content-Description values.Borenstein & Freed [Page 27]5.6. Additional MIME Header Fields Future documents may elect to define additional MIME header fields for various purposes. Any new header field that further describes the content of a message should begin with the string "Content-" to allow such fields which appear in a message header to be distinguished from ordinary RFC 822 message header fields. MIME-extension-field := <Any RFC 822 header field which begins with the string "Content-"> Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 33] Internet Draft MIME Part One November 19947 The6. Predefined Content-Type Values This document defines seven initial Content-Type values and an extension mechanism for private or experimental types. Further standard types must be defined by new published specifications. It is expected that most innovation in new types of mail will take place as subtypes of the seven types defined here. The most essential characteristics of the seven content-types are summarized in AppendixF. 7.1E. 6.1. Discrete Content-Type Values Five of the seven initial Content-Type values refer to discrete bodies. The content of such entities is handled by non-MIME mechanisms; they are opaque to MIME processors. 6.1.1. Text Content-Type The text Content-Type is intended for sending material which is principally textual in form.It is the default Content- Type.A "charset" parameter may be used to indicate the character set of the body text for some text subtypes, notably including theprimary subtype,subtype "text/plain", which indicates plain (unformatted) text. The defaultContent- TypeContent-Type for Internet mail if none is specified is "text/plain; charset=us-ascii". Beyond plain text, there are many formats for representing what might be known as "extended text" -- text with embedded formatting and presentation information. An interesting characteristic of many such representations is that they are to some extent readable even without the software that interprets them. It is useful, then, to distinguish them, at the highest level, from such unreadable data as images, audio, or text represented in an unreadable form. In the absence of appropriate interpretation software, it is reasonable to show subtypes of text to the user, while it is not reasonable to do so with most nontextual data. Such formatted textual data should be represented using subtypes of text. Plausible subtypes of text are typically given by the common name of the representation format, e.g.,"text/richtext" [RFC-1341]. 7.1.1"text/enriched" [RFC-1563]. Expires May 1995 [Page 34] Internet Draft MIME Part One November 1994 6.1.1.1. Representation of Line Breaks Thecharset parametercanonical form of any MIME text type MUST represent a line break as a CRLF sequence. Similarly, any occurrence of CRLF in text MUST represent a line break. Use of CR and LF outside of line break sequences is also forbidden. This rule applies regardless of format or character set or sets involved. 6.1.1.2. Charset Parameter A critical parameter that may be specified in theContent- TypeContent-Type field for text/plain data is the character set. This is specified with a "charset" parameter, as in: Content-type: text/plain;charset=us-ascii Borenstein & Freed [Page 28] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994charset=iso-8859-1 Unlike some other parameter values, the values of the charset parameter are NOT case sensitive. The default character set, which must be assumed in the absence of a charset parameter, is US-ASCII. The specification for any future subtypes of "text" must specify whether or not they will also utilize a "charset" parameter, and may possibly restrict its values as well. When used with a particular body, the semantics of the "charset" parameter should be identical to those specified here for "text/plain", i.e., the body consists entirely of characters in the given charset. In particular, definers of future text subtypes should pay close attention the the implications ofmultibytemultioctet character sets for their subtype definitions. This RFC specifies the definition of the charset parameter for the purposes of MIME to bea unique mappingthe name of abyte stream to glyphs, a mapping which does not require external profiling information. An initial list of predefinedcharacter set, as "character set" as defined in Section 4 of this document. The rules regarding line breaks detailed in the previous section must also be observed -- a character set whose definition does not conform to these rules cannot be used in a MIME text type. An initial list of predefined character set names can be found at the end of this section. Additional character sets may be registered withIANA, although the standardization of their use requires the usual IAB review and approval.IANA as described in RFC REG. Expires May 1995 [Page 35] Internet Draft MIME Part One November 1994 Note that if the specified character set includes 8-bit data, a Content-Transfer-Encoding header field and a corresponding encoding on the data are required in order to transmit the body via some mail transfer protocols, such as SMTP. The default character set, US-ASCII, has been the subject of some confusion and ambiguity in the past. Not only were there some ambiguities in the definition, there have been wide variations in practice. In order to eliminate such ambiguity and variations in the future, it is strongly recommended that new user agents explicitly specify a character set via the Content-Type header field. "US-ASCII" does not indicate an arbitraryseven-bit7-bit character code, but specifies that the body uses character coding that uses the exact correspondence ofcodesoctets to characters specified inASCII.US-ASCII. National use variations of ISO 646 [ISO-646] are NOTASCIIUS-ASCII and their use in Internet mail is explicitly discouraged. The omission of the ISO 646 character set is deliberate in this regard. The character set name of"US- ASCII""US-ASCII" explicitly refers to ANSI X3.4-1986 [US-ASCII] only. The character set name "ASCII" is reserved and must not beBorenstein & Freed [Page 29] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994used for any purpose. NOTE: RFC 821 explicitly specifies "ASCII", and references an earlier version of the American Standard. Insofar as one of the purposes of specifying a Content-Type and character set is to permit the receiver to unambiguously determine how the sender intended the coded message to be interpreted, assuming anything other than "strict ASCII" as the default would risk unintentional and incompatible changes to the semantics of messages now being transmitted. This also implies that messages containing characters coded according to national variations on ISO 646, or usingcode- switchingcode-switching procedures (e.g., those of ISO 2022), as well as 8-bit or multiple octet character encodings MUST use an appropriate character set specification to be consistent with this specification. The complete US-ASCII character set is listed in[US-ASCII].ANSI X3.4- 1986. Note that the control characters including DEL (0-31, 127) have no defined meaning apart from the combination CRLF(ASCII(US-ASCII values 13 and 10) indicating a new line. Two of the characters have de facto meanings in wide use: FF (12) often means "start subsequent text on the beginning of a new page"; and TAB or HT (9) often (though not always) means "move the cursor to the next available column after the current position where the column number is a multiple of 8 (counting the first Expires May 1995 [Page 36] Internet Draft MIME Part One November 1994 column as column 0)." Apart from this, any use of the control characters or DEL in a body must be part of a private agreement between the sender and recipient. Such private agreements are discouraged and should be replaced by the other capabilities of this document. NOTE: Beyond US-ASCII, an enormous proliferation of character sets is possible. It is the opinion of the IETF working group that a large number of character sets is NOT a good thing. We would prefer to specify asingleSINGLE character set that can be used universally for representing all of the world's languages in electronic mail. Unfortunately, existing practice in several communities seems to point to the continued use of multiple character sets in the near future. ForBorenstein & Freed [Page 30] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994this reason, we define names for a small number of character sets for which a strong constituent base exists. The defined charset values are: (1) US-ASCII -- as defined in ANSI X3.4-1986 [US-ASCII]. (2) ISO-8859-X -- where "X" is to be replaced, as necessary, for the parts of ISO-8859[ISO- 8859].[ISO-8859]. Note that the ISO 646 character sets have deliberately been omitted in favor of their 8859 replacements, which are the designated character sets for Internet mail. As of the publication of this document, the legitimate values for "X" are the digits 1 through 9. All of these character sets are used as pure 7- or 8-bit sets without any shift or escape functions. The meaning of shift and escape sequences in these character sets is not defined. The character sets specified above are the ones that were relatively uncontroversial during the drafting of MIME. This document does not endorse the use of any particular character set other than US-ASCII, and recognizes that the future evolution of world character sets remains unclear. It is expected that in the future, additional character sets will be registered for use in MIME. Note that the character set used, if anything other thanUS-ASCII,US- ASCII, must always be explicitly specified in the Content-Type field. Expires May 1995 [Page 37] Internet Draft MIME Part One November 1994 No other character set name may be used in Internet mail without the publication of a formal specification and its registration with IANA, or by private agreement, in which case the character set name must begin with "X-". Implementors are discouraged from defining new character sets for mail use unless absolutely necessary. The "charset" parameter has been defined primarily for the purpose of textual data, and is described in this section for that reason. However, it is conceivable thatnon- textualnon-textual data might also wish to specify a charset value for some purpose, in which case the same syntax and values should be used.Borenstein & Freed [Page 31] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994In general, mail-sending softwaremustshould always use the "lowest common denominator" character set possible. For example, if a body contains only US-ASCII characters, itmustshould be marked as being in the US-ASCII character set, not ISO-8859-1, which, like all the ISO-8859 family of character sets, is a superset of US-ASCII. More generally, if a widely-used character set is a subset of another character set, and a body contains only characters in the widely-used subset, itmustshould belabeledlabelled as being in that subset. This will increase the chances that the recipient will be able to view the mail correctly.7.1.2 The Text/plain subtype6.1.1.3. Plain Subtype Theprimarysimplest and most important subtype of text is "plain". This indicates plain (unformatted) text. The default Content-Type for Internet mail, "text/plain;charset=us-ascii",charset=us- ascii", describes existing Internet practice. That is, it is the type of body defined by RFC 822. No other text subtype is defined by this document.The formal grammar for the content-type header field for6.1.1.4. Unrecognized Subtypes Unrecognized subtypes of textisshould be treated asfollows: text-type := "text" "/" text-subtype [";" "charset" "=" charset] text-subtype :=subtype "plain"/ extension-tokenas long as the MIME implementation knows how to handle the charset. Unrecognized subtypes which also specify an unrecognized charset:= "us-ascii" / "iso-8859-1" / "iso-8859-2" / "iso- 8859-3" / "iso-8859-4" / "iso-8859-5" / "iso-8859-6" / "iso- 8859-7" / "iso-8859-8" / "iso-8859-9" / extension-token ; case insensitive Borenstein & Freed [Page 32]should be treated as "application/octet- stream". Expires11/20/94 draft-ietf-822-mime-00.txtMay1994 7.2 The Multipart Content-Type In the case of multiple part entities, in which one or more different sets of data are combined in a single body, a "multipart"1995 [Page 38] Internet Draft MIME Part One November 1994 6.1.2. Image Content-Typefield must appear inA Content-Type of "image" indicates that theentity's header. Thebodymust then contain one or more "body parts," each preceded bycontains anencapsulation boundary, andimage. The subtype names thelast one followed by a closing boundary. Each part starts with an encapsulation boundary,specific image format. These names are not case sensitive. Two initial subtypes are "jpeg" for the JPEG format, JFIF encoding, andthen contains a body part consisting"gif" for GIF format [GIF]. The list ofheader area, a blank line, and a body area. Thus a body partimage subtypes given here issimilar to an RFC 822 message in syntax, but different in meaning. A body partneither exclusive nor exhaustive, and isNOTexpected tobe interpretedgrow asactually being an RFC 822 message. To begin with, NO header fieldsmore types areactually required in body parts. A body part that startsregistered with IANA, as described in RFC REG. Unrecognized subtypes of image should at ablank line, therefore, is allowed and is a body part for which all default values are tominiumum beassumed. In such a case, the absencetreated as "application/octet-stream". Implementations may optionally elect to pass subtypes of image that they do not specifically recognize to a robust general-purpose image viewing application, if such an application is available. 6.1.3. Audio Content-Typeheader field impliesA Content-Type of "audio" indicates that thecorrespondingbody contains audio data. Although there isplain US-ASCII text.not yet a consensus on an "ideal" audio format for use with computers, there is a pressing need for a format capable of providing interoperable behavior. Theonly header fieldsinitial subtype of "basic" is specified to meet this requirement by providing an absolutely minimal lowest common denominator audio format. It is expected thathave defined meaningricher formats forbody parts are thosehigher quality and/or lower bandwidth audio will be defined by a later document. The content of thenames"audio/basic" subtype is single channel audio encoded using 8-bit ISDN mu-law [PCM] at a sample rate ofwhich begin with "Content-". All other header fields are generally to be ignored in body parts. Although they8000 Hz. Unrecognized subtypes of audio shouldgenerallyat a miniumum beretained in mail processing, theytreated as "application/octet-stream". Implementations maybe discarded by gateways if necessary. Such other fields are permittedoptionally elect toappear in body parts but must not be depended on. "X-" fields may be created for experimental or private purposes, with the recognitionpass subtypes of audio thatthe informationtheycontain may be lost at some gateways. NOTE: The distinction between an RFC 822 message anddo not specifically recognize to abody partrobust general-purpose audio playing application, if such an application issubtle, but important. A gateway betweenavailable. Expires May 1995 [Page 39] Internetand X.400 mail, for example, must be able to tellDraft MIME Part One November 1994 6.1.4. Video Content-Type A Content-Type of "video" indicates that thedifference between abodypart thatcontainsan image andabody part that contains an encapsulated message, the body of which is an image. In order to represent the latter, the body part must have "Content-Type: message", and its body (after the blank line) must be the encapsulated message,time-varying-picture image, possibly withits own "Content-Type: image" header field.color and coordinated sound. Theuse of similar syntax facilitates the conversion of messagesterm "video" is used extremely generically, rather than with reference tobody parts,any particular technology or format, andvice versa, but the distinction between the two must be understood by implementors. (For the special case in which all parts actually are messages, a "digest" subtype is Borenstein & Freed [Page 33] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 also defined.) As stated previously, each body partispreceded by an encapsulation boundary.not meant to preclude subtypes such as animated drawings encoded compactly. Theencapsulation boundary MUST NOT appear inside any of the encapsulated parts. Thus, it is crucial that the composing agent be ablesubtype "mpeg" refers to video coded according tochoose and specifytheunique boundaryMPEG standard [MPEG]. Note thatwill separatealthough in general this document strongly discourages theparts. All present and future subtypesmixing ofthe "multipart" type must use an identical syntax. Subtypes may differmultiple media intheir semantics,a single body, it is recognized that many so-called "video" formats include a representation for synchronized audio, andmay impose additional restrictions on syntax, but must conform to the required syntaxthis is explicitly permitted forthe multipart type. This requirement ensures that all conformant user agents willsubtypes of "video". Unrecognized subtypes of video should atleasta minumum beabletreated as "application/octet-stream". Implementations may optionally elect torecognize and separate the parts of any multipart entity, evenpass subtypes of video that they do not specifically recognize to a robust general-purpose video display application, if such anunrecognized subtype. As stated in the definition of the Content-Transfer-Encoding field, no encoding other than "7bit", "8bit", or "binary"application ispermitted for entities of type "multipart".available. 6.1.5. Application Content-Type Themultipart delimiters and header fields are always represented as 7-bit ASCII"application" Content-Type is to be used for discrete data which do not fit in anycase (thoughof theheader fields may encode non- ASCII header text as per [RFC-1522]),other categories, and particularly for datawithin the body parts canto beencoded onprocessed by mail-based uses of application programs. This is information which must be processed by an application before it is viewable or usable to apart-by-part basis, with Content-Transfer-Encoding fieldsuser. Expected uses foreach appropriate body part. Mail gateways, relays,Content-Type application include mail-based file transfer, spreadsheets, data for mail-based scheduling systems, andother mail handling agents are commonly known to alter the top-level header of an RFC 822 message. Inlanguages for "active" (computational) email. (The latter, in particular,they frequently add, remove, or reorder header fields. Such alterationscan pose security problems which must be understood by implementors, and areexplicitly forbidden for the body part headers embeddedconsidered in detail in thebodies of messages of type "multipart." 7.2.1 Multipart: The common syntax All subtypesdiscussion of"multipart" sharethe application/PostScript content-type.) For example, acommon syntax, defined in this section. A simple example ofmeeting scheduler might define amultipart message also appears in this section.standard representation for information about proposed meeting dates. Anexample ofintelligent user agent would use this information to conduct amore complex multipart message is givendialog with the user, and might then send further mail based on that dialog. More generally, there have been Expires May 1995 [Page 40] Internet Draft MIME Part One November 1994 several "active" messaging languages developed inAppendix C. The Content-Type field for multipart entities requires one parameter, "boundary",whichis used to specifyprograms in a suitably specialized language are sent through theencapsulation boundary. The encapsulation boundary ismail and automatically run in the recipient's environment. Such applications may be defined asa line consisting entirelysubtypes of the "application" Content-Type. This document defines twohyphen characters ("-", decimal code 45) followed bysubtypes: octet-stream, and PostScript. The subtype of application will often be theboundary Borenstein & Freed [Page 34] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 parameter value fromname of theContent-Type header field. NOTE: The hyphens areapplication forrough compatibility withwhich theearlier RFC 934 methoddata are intended. This does not mean, however, that any application program name may be used freely as a subtype ofmessage encapsulation, and for easeapplication. Usage ofsearching for the boundaries in some implementations. However, it shouldany subtype (other than subtypes beginning with "x-") must benoted that multipart messages are NOT completely compatibleregistered withRFC 934 encapsulations;IANA, as described inparticular, they do not obeyRFC934 quoting conventions for embedded linesREG. 6.1.5.1. Octet-Stream Subtype The "octet-stream" subtype is used to indicate thatbegin with hyphens. This mechanism was chosen overa body contains arbitrary binary data. The set of currently defined parameters is: (1) TYPE -- theRFC 934 mechanism because the latter causes lines to grow with each level of quoting. The combinationgeneral type or category ofthis growth with the fact that SMTP implementations sometimes wrap long lines made the RFC 934 mechanism unsuitablebinary data. This is intended as information foruse intheevent that deeply-nested multipart structuring is ever desired. WARNING TO IMPLEMENTORS: The grammarhuman recipient rather than forparameters onany automatic processing. (2) PADDING -- theContent-type field is suchnumber of bits of padding thatit is often necessarywere appended toenclosetheboundaries in quotes onbit-stream comprising theContent-type line. This is not always necessary, but never hurts. Implementors should be sureactual contents tostudyproduce thegrammar carefullyenclosed 8-bit byte-oriented data. This is useful for enclosing a bit-stream inorder to avoid producing illegal Content-type fields. Thus,atypical multipart Content-Type header field might look like this: Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08jU534c0p Butbody when thefollowingtotal number of bits isillegal: Content-Type: multipart/mixed; boundary=gc0p4Jq0M:2Yt08jU534c0p (becausenot a multiple of 8. Both of these parameters are optional. An additional parameter, "CONVERSIONS", was defined in RFC 1341 but has since been removed. RFC 1341 also defined thecolon) and must insteaduse of a "NAME" parameter which gave a suggested file name to berepresented as Content-Type: multipart/mixed; boundary="gc0p4Jq0M:2Yt08jU534c0p" This indicates thatused if theentity consistsdata were to be written to a file. This has been deprecated in anticipation ofseveral parts, each itself withastructure that is syntactically identicalseparate Content- Disposition header field, to be defined in a subsequent RFC. The recommended action for anRFC 822 message, exceptimplementation that receives application/octet-stream mail is to simply offer to put theheader area might be completely empty, and that the parts are each preceded by the line Borenstein & Freed [Page 35]data in a file, with any Content-Transfer-Encoding undone, or Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 41] Internet Draft MIME Part One November 1994--gc0p4Jq0M:2Yt08jU534c0p Note that the encapsulation boundary must occur at the beginning of a line, i.e., following a CRLF, and that the initial CRLF is consideredperhaps tobe attacheduse it as input to a user-specified process. To reduce theencapsulation boundary rather than partdanger of transmitting rogue programs through thepreceding part. The boundary must be followed immediately either by another CRLF and the header fields for the next part, or by two CRLFs, in which case there are no header fields for the next part (andmail, it istherefore assumed to be of Content-Type text/plain). NOTE: The CRLF precedingstrongly recommended that implementations NOT implement a path-search mechanism whereby an arbitrary program named in theencapsulation lineContent-Type parameter (e.g., an "interpreter=" parameter) isconceptually attached tofound and executed using theboundary so that it is possible to have a part that does not end withmail body as input. 6.1.5.2. PostScript Subtype A Content-Type of "application/postscript" indicates aCRLF (line break). Body parts that must be considered to end with line breaks, therefore, must havePostScript program. Currently twoCRLFs precedingvariants of theencapsulation line,PostScript language are allowed; thefirst of whichoriginal level 1 variant ispart of the preceding body part,described in [POSTSCRIPT] and thesecond of whichmore recent level 2 variant ispartdescribed in [POSTSCRIPT2]. PostScript is a registered trademark of Adobe Systems, Inc. Use of theencapsulation boundary. Encapsulation boundaries must not appear within the encapsulations,MIME content-type "application/postscript" implies recognition of that trademark andmust be no longer than 70 characters, not countingall thetwo leading hyphens.rights it entails. Theencapsulation boundary followingPostScript language definition provides facilities for internal labelling of thelast body part is a distinguished delimiter that indicates that no further body parts will follow. Suchspecific language features adelimiter is identical to the previous delimiters, withgiven program uses. This labelling, called theaddition of twoPostScript document structuring conventions, or DSC, is very general and provides substantially morehyphens atinformation than just theendlanguage level. The use ofthe line: --gc0p4Jq0M2Yt08jU534c0p-- There appearsdocument structuring conventions, while not required, is strongly recommended as an aid to interoperability. Documents which lack proper structuring conventions cannot beroom for additional information priortested tothe first encapsulation boundary and following the final boundary. These areas should generally be left blank, and implementations must ignore anything that appears before the first boundarysee whether orafter the last one. NOTE: These "preamble" and "epilogue" areas are generallynotused because ofthey will work in a given environment. As such, some systems may assume thelack of proper typingworst and refuse to process unstructured documents. The execution ofthese partsgeneral-purpose PostScript interpreters entails serious security risks, and implementors are discouraged from simply sending PostScript email bodies to "off-the-shelf" interpreters. While it is usually safe to send PostScript to a printer, where thelack of clear semanticspotential forhandling these areas at gateways, particularly X.400 gateways. However, rather than leaving the preamble area blank, many MIME Borenstein & Freed [Page 36] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 implementations have found this to be a convenient place to insert an explanatory note for recipients who read the message with pre-MIME software, since such notes will be ignoredharm is greatly constrained byMIME-compliant software. NOTE: Because encapsulation boundaries must not appear intypical printer environments, implementors should consider all of thebody parts being encapsulated, a user agent must exercise carefollowing before they add interactive display of PostScript bodies tochoose a unique boundary.their mail readers. Theboundary in the example above could have been the resultremainder ofan algorithm designed to produce boundaries with a very low probabilitythis section outlines some, though probably not all, ofalready existing in the data to be encapsulated without having to prescanthedata. Alternate algorithms might result in more 'readable' boundaries for a recipientpossible problems withan old user agent, but would require more attention to the possibility thatsending PostScript Expires May 1995 [Page 42] Internet Draft MIME Part One November 1994 through theboundary might appearmail. (1) Dangerous operations in theencapsulated part. The simplest boundary possiblePostScript language include, but may not be limited to, the PostScript operators "deletefile", "renamefile", "filenameforall", and "file". "File" is only dangerous when applied to somethinglike "---", with a closing boundary of "-----". Asother than standard input or output. Implementations may also define additional nonstandard file operators; these may also pose avery simple example,threat to security. "Filenameforall", thefollowing multipart messagewildcard file search operator, may appear at first glance to be harmless. Note, however, that this operator hastwo parts, both of them plain text, one of them explicitly typed and one of them implicitly typed: From: Nathaniel Borenstein <nsb@bellcore.com> To: Ned Freed <ned@innosoft.com> Subject: Sample message MIME-Version: 1.0 Content-type: multipart/mixed; boundary="simple boundary" This isthepreamble. It ispotential to reveal information about what files the recipient has access to, and this information may itself beignored, though it is a handy place for mail composerssensitive. Message senders should avoid the use of potentially dangerous file operators, since these operators are quite likely toinclude an explanatory notebe unavailable in secure PostScript implementations. Message receiving and displaying software should either completely disable all potentially dangerous file operators or take special care not tonon-MIME conformant readers. --simple boundary This is implicitly typed plain ASCII text. It does NOT end with a linebreak. --simple boundary Content-type: text/plain; charset=us-ascii This is explicitly typed plain ASCII text. Borenstein & Freed [Page 37] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 It DOES end with a linebreak. --simple boundary-- This is the epilogue. It is alsodelegate any special authority to their operation. These operators should beignored. The useviewed as being done by an outside agency when interpreting PostScript documents. Such disabling and/or checking should be done completely outside ofa Content-Typethe reach ofmultipart in a body part within another multipart entity is explicitly allowed. In such cases, for obvious reasons,the PostScript language itself; caremustshould be taken toensureinsure thateach nested multipart entity must use a different boundary delimiter. See Appendix Cno method exists foran examplere-enabling full- function versions ofnested multipart entities.these operators. (2) Theuse of the multipart Content-Type with only a single body partPostScript language provides facilities for exiting the normal interpreter, or server, loop. Changes made in this "outer" environment are customarily retained across documents, and may in some cases beusefulretained semipermanently incertain contexts, and is explicitly permitted.nonvolatile memory. Theonly mandatory parameter foroperators associated with exiting themultipart Content-Type isinterpreter loop have theboundary parameter, which consists of 1potential to70 characters frominterfere with subsequent document processing. As such, their unrestrained use constitutes asetthreat ofcharacters known toservice denial. PostScript operators that exit the interpreter loop include, but may not bevery robust through email gateways,limited to, the exitserver andNOT ending with white space. (If a boundary appearsstartjob operators. Message sending software should not generate PostScript that depends on exiting the interpreter loop toend with white space,operate, since thewhite space mustability to exit will probably bepresumedunavailable in secure PostScript implementations. Message receiving and displaying software should Expires May 1995 [Page 43] Internet Draft MIME Part One November 1994 completely disable the ability tohave been addedmake retained changes to the PostScript environment bya gateway,eliminating or disabling the "startjob" andmust"exitserver" operations. If these operations cannot bedeleted.) It is formally specified by the following BNF: boundary := 0*69<bchars> bcharsnospace bchars := bcharsnospace / " " bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-" / "." / "/" / ":" / "=" / "?" Overall,eliminated or completely disabled thebody of a multipart entity maypassword associated with them should at least bespecified as follows: multipart-body := preamble 1*encapsulation close-delimiter epilogue encapsulation := delimiter body-part CRLF delimiter := "--" boundary CRLF ; taken from Content-Type field. ; There must be no space Borenstein & Freed [Page 38] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 ; between "--" and boundary. close-delimiter := "--" boundary "--" CRLF ; Again, no space by "--", preamble := discard-text ; to be ignored upon receipt. epilogue := discard-text ;set to a hard-to-guess value. (3) PostScript provides operators for setting system-wide and device-specific parameters. These parameter settings may beignored upon receipt. discard-text := *(*text CRLF) body-part := <"message" as defined in RFC 822, with all header fields optional,retained across jobs andwith the specified delimiter not occurring anywhere in the message body, either on a line by itself or as a substring anywhere. Note that the semantics ofmay potentially pose apart differ fromthreat to thesemanticscorrect operation ofa message, as described in the text.> NOTE: In certain transport enclaves, RFC 822 restrictions such astheoneinterpreter. The PostScript operators thatlimits bodies to printable ASCII charactersset system and device parameters include, but may not bein force. (That is,limited to, thetransport domains may resemble standard Internet mail transport as specified in RFC821"setsystemparams" andassumed by RFC822, but without certain restrictions.) The relaxation of these restrictions"setdevparams" operators. Message sending software shouldbe construed as locally extendingnot generate PostScript that depends on thedefinitionsetting ofbodies, for examplesystem or device parameters toinclude octets outside of the ASCII range, as long asoperate correctly. The ability to set theseextensions are supported by the transport and adequately documented in the Content-Transfer-Encoding header field. However,parameters will probably be unavailable inno event are headers (either message headers or body- part headers) allowed to contain anything other than ASCII characters. NOTE: Conspicuously missing from the multipart type is a notion of structured, related body parts. In general, it seems premature to try to standardize interpart structure yet. It is recommended that those wishing to provide a more structured or integrated multipart messaging facilitysecure PostScript implementations. Message receiving and displaying software shoulddefine a subtype of multipart that is syntactically identical, but that always expectsdisable theinclusion of a distinguished part that Borenstein & Freed [Page 39] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 can be usedability tospecify the structurechange system andintegration of the other parts, probably referring to them by their Content-ID field.device parameters. Ifthis approach is used, other implementations will not recognize the new subtype, but will treat it asthese operators cannot be completely disabled theprimary subtype (multipart/mixed) and will thuspassword associated with them should at least beableset toshow the usera hard-to-guess value. (4) Some PostScript implementations provide nonstandard facilities for theparts thatdirect loading and execution of machine code. Such facilities arerecognized. 7.2.2 The Multipart/mixed (primary) subtype The primary subtype for multipart, "mixed", is intended forquite obviously open to substantial abuse. Message sending software should not make usewhen the body partsof such features. Besides being totally hardware-specific, they areindependent and needalso likely to bebundledunavailable ina particular order. Any multipart subtypes that an implementation does not recognize must be treated as beingsecure implementations ofsubtype "mixed". 7.2.3 The Multipart/alternative subtype The multipart/alternative type is syntactically identicalPostScript. Message receiving and displaying software should not allow such operators tomultipart/mixed, but the semantics are different. In particular, each of the partsbe used if they exist. (5) PostScript is an"alternative" versionextensible language, and many, if not most, implementations ofthe same information. Systemsit provide a number of their own extensions. This document does not deal with such extensions explicitly since they constitute an unknown factor. Message sending software shouldrecognize that the contentnot make use ofthe various partsnonstandard extensions; they areinterchangeable. Systemslikely to be missing from some implementations. Message receiving and displaying software shouldchoose the "best" type based on the local environmentmake sure that any nonstandard PostScript operators are secure andpreferences, in some cases even through user interaction. As with multipart/mixed, the orderdon't present any kind ofbody partsthreat. Expires May 1995 [Page 44] Internet Draft MIME Part One November 1994 (6) It issignificant. In this case, the alternatives appear in an orderpossible to write PostScript that consumes huge amounts ofincreasing faithfulnessvarious system resources. It is also possible to write PostScript programs that loop indefinitely. Both types of programs have theoriginal content. In general,potential to cause damage if sent to unsuspecting recipients. Message-sending software should avoid thebest choiceconstruction and dissemination of such programs, which isthe LAST partantisocial. Message receiving and displaying software should provide appropriate mechanisms to abort processing of atype supported by the recipient system's local environment. Multipart/alternative may be used, for example, to send mail indocument after afancy text format in such a way that it can easily be displayed anywhere: From: Nathaniel Borenstein <nsb@bellcore.com> To: Ned Freed <ned@innosoft.com> Subject: Formatted text mail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=boundary42 --boundary42 Borenstein & Freed [Page 40] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Content-Type: text/plain; charset=us-ascii ...plain text version of message goes here.... --boundary42 Content-Type: text/richtext .... RFC 1341 richtext version of same message goes here ... --boundary42 Content-Type: text/x-whatever .... fanciest version of same message goes here ... --boundary42-- In this example, users whose mail system understood the "text/x-whatever" format would see only the fancy version, while other users would see only the richtext or plain text version, depending on the capabilitiesreasonable amount oftheir system.time has elapsed. Ingeneral, user agents that compose multipart/alternative entities must place the body parts in increasing order of preference, that is, with the preferred format last. For fancy text, the sending user agent should put the plainest format first and the richest format last. Receiving user agentsaddition, PostScript interpreters shouldpick and displaybe limited to thelast format they are capableconsumption ofdisplaying. In the case where oneonly a reasonable amount ofthe alternativesany given system resource. (7) It isitself of type "multipart" and contains unrecognized sub-parts, the user agent may choose eitherpossible toshow that alternative, an earlier alternative, or both. NOTE: From an implementor's perspective,include raw binary information inside PostScript in various forms. This is not recommended for use in email, both because itmight seem more sensible to reverse this ordering,is not supported by all PostScript interpreters andhave the plainest alternative last. However, placingbecause it significantly complicates theplainest alternative first is the friendliest possible option when multipart/alternative entities are viewed usinguse of anon-MIME-conformant mail reader. While this approach does impose some burden on conformant mail readers, interoperability with older mail readers was deemed toMIME Content- Transfer-Encoding. (Without such binary, PostScript may typically bemore importantviewed as line-oriented data. The treatment of CRLF sequences becomes extremely problematic if binary and line-oriented data are mixed inthis case. Ita single Postscript data stream.) (8) Finally, bugs may exist in some PostScript interpreters which could possibly be exploited to gain unauthorized access to a recipient's system. Apart from noting this possibility, there is no specific action to take to prevent this, apart from thecase that some user agents,timely correction of such bugs ifthey can recognize more than oneany are found. 6.1.5.3. Other Application Subtypes It is expected that many other subtypes ofthe formats,application willpreferbe defined in the future. MIME implementations must at a minimum treat any unrecognized subtypes as being equivalent tooffer Borenstein & Freed [Page 41]"application/octet-stream". Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 45] Internet Draft MIME Part One November 1994the user the choice6.2. Composite Content-Type Values The remaining two ofwhich formatthe seven initial Content-Type values refer toview. This makes sense, for example, if mail includes bothcomposite entities. Composite entities are handled using MIME mechanisms -- anicely-formatted image version and an easily-edited text version. What is most critical, however, is thatMIME processor typically handles theuser not automatically be shownbody directly. 6.2.1. Multipart Content-Type In the case of multipleversionspart entities, in which one or more different sets of data are combined in a single body, a "multipart" Content-Type field must appear in thesame data. Either the user should be shown the last recognized versionentity's header. The body must then contain one orshould be givenmore "body parts," each preceded by an encapsulation boundary, and thechoice. NOTE ON THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE:last one followed by a closing boundary. Each part starts with an encapsulation boundary, and then contains a body part consisting of amultipart/alternative entity represents the same data, but the mappings between the two are not necessarily without information loss. For example, informationheader area, a blank line, and a body area. Thus a body part islost when translating ODAsimilar toPostScript or plain text. It is recommended that each part should have aan RFC 822 message in syntax, but differentContent-ID valueinthe case where the information content of the two parts is not identical. However, where the information contentmeaning. A body part isidentical -- for example, where several parts of type "message/external-body" specify alternate waysNOT toaccess the identical data -- the same Content-ID field value shouldbeused, to optimize any cacheing mechanismsinterpreted as actually being an RFC 822 message. To begin with, NO header fields are actually required in body parts. A body part thatmight be present on the recipient's end. However, itstarts with a blank line, therefore, isrecommended that the Content-IDallowed and is a body part for which all default valuesused by the parts should notare to be assumed. In such a case, thesame Content-ID valueabsence of a Content-Type header indicates thatdescribesthemultipart/alternative ascorresponding body has awhole, if there is any such Content-ID field. That is, one Content-ID value will refer tocontent-type of "text/plain; charset=US-ASCII"". The only header fields that have defined meaning for body parts are those themultipart/alternative entity, while one or morenames of which begin with "Content-". All otherContent-ID values will referheader fields are generally tothe parts inside it. Borenstein & Freed [Page 42] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 7.2.4 The Multipart/digest subtype This document defines a "digest" subtype of the multipart Content-Type. This type is syntactically identicalbe ignored in body parts. Although they should generally be retained in mail processing, they may be discarded by gateways if necessary. Such other fields are permitted tomultipart/mixed,appear in body parts but must not be depended on. "X-" fields may be created for experimental or private purposes, with thesemantics are different. In particular, in a digest,recognition that thedefault Content-Type value forinformation they contain may be lost at some gateways. NOTE: The distinction between an RFC 822 message and a body part ischanged from "text/plain" to "message/rfc822". This is donesubtle, but important. A gateway between Internet and X.400 mail, for example, must be able toallowtell the difference between amore readable digest formatbody part thatis largely compatible (except forcontains an image and a body part that contains an encapsulated message, thequoting convention) with RFC 934. A digest in this format might, then, look something like this: From: Moderator-Address To: Recipient-List MIME-Version: 1.0 Subject:body of which is a Expires May 1995 [Page 46] InternetDigest, volume 42 Content-Type: multipart/digest; boundary="---- next message ----" ------ next message ---- From: someone-else Subject: my opinion ...body goes here ... ------ next message ---- From: someone-else-again Subject: my different opinion ... anotherDraft MIME Part One November 1994 GIF image. In order to represent the latter, the bodygoes here... ------ next message ------ 7.2.5part must have "Content-Type: message/rfc822", and its body (after the blank line) must be the encapsulated message, with its own "Content-Type: image/gif" header field. TheMultipart/parallel subtype This document defines a "parallel" subtypeuse of similar syntax facilitates themultipart Content-Type. This type is syntactically identicalconversion of messages tomultipart/mixed,body parts, and vice versa, but thesemantics are different. In particular, in a parallel entity,distinction between theorder of bodytwo must be understood by implementors. (For the special case in which all parts actually are messages, a "digest" subtype isnot significant. Borenstein & Freed [Page 43] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 A common presentation of this typealso defined.) As stated previously, each body part isto display allpreceded by an encapsulation boundary. The encapsulation boundary MUST NOT appear inside any of theparts simultaneously on hardware and softwareencapsulated parts. Thus, it is crucial thatare capable of doing so. However,the composingagents shouldagent beaware that many mail readers will lack this capabilityable to choose and specify a unique boundary that willshowseparate theparts serially in any event. 7.2.6 Other Multipart subtypes Other multipartparts. All present and future subtypesare expected inof thefuture. MIME implementations"multipart" type must use an identical syntax. Subtypes may differ ingeneral treat unrecognized subtypes of multipart as being equivalent to "multipart/mixed". The formal grammar for content-type header fields for multipart data is given by: multipart-type := "multipart" "/" multipart-subtype ";" "boundary" "=" boundary multipart-subtype := "mixed" / "parallel" / "digest" / "alternative" / extension-token 7.3 The Message Content-Type It is frequently desirable, in sending mail,their semantics, and may impose additional restrictions on syntax, but must conform toencapsulate another mail message. For this common operation, a special Content-Type, "message", is defined. The primary subtype, message/rfc822, has no required parameters intheContent- Type field. Additional subtypes, "partial" and "External- body", do haverequiredparameters. These subtypes are explained below. NOTE: It has been suggested that subtypes of message might be definedsyntax forforwarded or rejected messages. However, forwarded and rejected messages can be handled as multipart messages in which the first part contains any control or descriptive information, and a second part, of type message/rfc822, istheforwarded or rejected message. Composing rejection and forwarding messages in this mannermultipart type. This requirement ensures that all conformant user agents willpreserve the type information on the original message and allow it toat least becorrectly presentedable tothe recipient,recognize andhence is strongly encouraged.separate the parts of any multipart entity, even of an unrecognized subtype. As stated in the definition of the Content-Transfer-Encoding field, no encoding other than "7bit", "8bit", or "binary" isBorenstein & Freed [Page 44] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994permitted formessages or partsentities of type"message". Even stronger restrictions apply to the subtypes "message/partial" and "message/external-body", as specified below."multipart". Themessagemultipart delimiters and header fields are always represented as 7-bit US-ASCII in anycase,case (though the header fields may encode non-US-ASCII header text as per RFC MIME-HEADERS, and data within the body parts canstillbeencoded, in which case theencoded on a part-by-part basis, with Content-Transfer-Encodingheader field in the encapsulated message will reflect this. Non-ASCII text in the headers of an encapsulated message can be specified using the mechanisms described in [RFC-1522]. Mail gateways,fields for each appropriate body part. Message transport agents, relays, andother mail handling agentsgateways are commonly known to alter the top-level header of an RFC 822 message. In particular, they frequently add, remove, or reorder header fields. Such alterations are explicitly forbidden for theencapsulatedheadersembedded in the bodies of messages of type "message." 7.3.1 The Message/rfc822 (primary) subtype A Content-Typeof"message/rfc822" indicates that theany bodycontains an encapsulated message, with the syntax ofpart which occurs within anRFC 822 message. However, unlike top-level RFC 822 messages, the restriction that each message/rfc822enclosing multipart bodymust includepart. Expires May 1995 [Page 47] Internet Draft MIME Part One November 1994 6.2.1.1. Common Syntax This section defines a"From", "Date", and at least one destination header is removed and replaced with the requirement that at least onecommon syntax for subtypes of"From", "Subject", or "Date"multipart. All subtypes of multipart mustbe present. It should be noted that, despite theuse this syntax. A simple example ofthe numbers "822",amessage/rfc822 entity can include enhanced information as definedmultipart message also appears in thisdocument. In other words,section. An example of amessage/rfc822more complex multipart messagemay be a MIME message. 7.3.2 The Message/Partial subtype A subtype of message, "partial",isdefinedgiven inorder to allow large objectsAppendix C. The Content-Type field for multipart entities requires one parameter, "boundary", which is used tobe deliveredspecify the encapsulation boundary. The encapsulation boundary is defined asseveral separate piecesa line consisting entirely ofmail and automatically reassembledtwo hyphen characters ("-", decimal value 45) followed by thereceiving user agent. (The concept is similar to IP fragmentation/reassembly inboundary parameter value from thebasic Internet Protocols.) This mechanism can be used when intermediate transport agents limit the size of individual messages that can be sent.Content-Type"message/partial" thus indicates thatheader field. NOTE: The hyphens are for rough compatibility with thebody contains a fragmentearlier RFC 934 method ofa larger message. Three parameters must be specified in the Content-Type fieldmessage encapsulation, and for ease oftype message/partial: The first, "id", is a unique Borenstein & Freed [Page 45] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 identifier, as close to a world-unique identifier as possible, to be used to match the parts together. (In general,searching for theidentifier is essentially a message-id; if placedboundaries indouble quotes,some implementations. However, itcanshould beany message-id, in accordancenoted that multipart messages are NOT completely compatible withthe BNF for "parameter" given earlierRFC 934 encapsulations; inthis specification.) The second, "number", an integer, isparticular, they do not obey RFC 934 quoting conventions for embedded lines that begin with hyphens. This mechanism was chosen over thepart number, which indicates where this part fits intoRFC 934 mechanism because thesequencelatter causes lines to grow with each level offragments.quoting. Thethird, "total", another integer, is the total numbercombination ofparts. This third subfieldthis growth with the fact that SMTP implementations sometimes wrap long lines made the RFC 934 mechanism unsuitable for use in the event that deeply-nested multipart structuring isrequiredever desired. WARNING TO IMPLEMENTORS: The grammar for parameters on thefinal part, andContent-type field isoptional (though encouraged)such that it is often necessary to enclose the boundaries in quotes on theearlier parts. Note also that these parameters mayContent-type line. This is not always necessary, but never hurts. Implementors should begivensure to study the grammar carefully inany order.order to avoid producing invalid Content-type fields. Thus,part 2 ofa3-part message may have either of the followingtypical multipart Content-Type headerfields: Content-Type: Message/Partial; number=2; total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com"field might look like this: Content-Type:Message/Partial; id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; number=2multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p Butpart 3 MUST specifythetotal number of parts: Content-Type: Message/Partial; number=3; total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com" Note that part numbering begins with 1,following is not0. When the partsvalid: Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p (because ofa message broken up in this manner are put together,theresult is a complete MIME entity, which may have its own Content-Type header field, and thus may contain any other data type. Message fragmentationcolon) andreassembly: The semantics of a reassembled partial messagemust instead bethose ofrepresented as Expires May 1995 [Page 48] Internet Draft MIME Part One November 1994 Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p" This Content-Type value indicates that the"inner" message, rather thancontent consists of one or more parts, each with amessage containingstructure that is syntactically identical to an RFC 822 message, except that theinner message. This makes it possible, for example,header area is allowed tosend a large audio message as several partial messages,be completely empty, andstill have it appear tothat therecipient as a simple audio message rather than as an encapsulated message containing an audio message. That is,parts are each preceded by the line --gc0pJq0M:08jU534c0p The encapsulation boundary MUST occur at the beginning of a line, i.e., following a CRLF, and themessageinitial CRLF is considered to be"transparent". Borenstein & Freed [Page 46] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 When generating and reassembling the parts of a message/partial message, the headers of the encapsulated message must be merged withattached to theheadersencapsulation boundary rather than part of theenclosing entities. In this process the following rulespreceding part. The boundary must beobserved: (1) All offollowed immediately either by another CRLF and the header fieldsfrom the initial enclosing entity (part one), except those that start with "Content-" andfor thespecificnext part, or by two CRLFs, in which case there are no header fields"Subject", "Message-ID", "Encrypted", and "MIME-Version",must be copied, in order,for the next part (and it is therefore assumed to be of Content-Type text/plain). NOTE: The CRLF preceding thenew message. (2) Only those header fields inencapsulation line is conceptually attached to theenclosed message which startboundary so that it is possible to have a part that does not end with"Content-" and "Subject", "Message-ID", "Encrypted", and "MIME-Version"a CRLF (line break). Body parts that must beappended, in order,considered to end with line breaks, therefore, must have two CRLFs preceding theheader fieldsencapsulation line, the first of which is part of thenew message. Any header fields inpreceding body part, and theenclosed messagesecond of whichdo not start with "Content-" (except for "Message-ID", "Encrypted", and "MIME-Version") will be ignored. (3) Allis part of theheader fields fromencapsulation boundary. Encapsulation boundaries must not appear within thesecondencapsulations, andany subsequent messages willmust beignored. For example, if an audio message is broken intono longer than 70 characters, not counting the twoparts,leading hyphens. The encapsulation boundary following thefirstlast body partmight look something like this: X-Weird-Header-1: Foo From: Bill@host.com To: joe@otherhost.com Subject: Audio mail (part 1 of 2) Message-ID: <id1@host.com> MIME-Version: 1.0 Content-type: message/partial; id="ABC@host.com"; number=1; total=2 X-Weird-Header-1: Bar X-Weird-Header-2: Hello Message-ID: <anotherid@foo.com> Subject: Audio mail MIME-Version: 1.0 Content-type: audio/basic Borenstein & Freed [Page 47] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Content-transfer-encoding: base64 ... first half of encoded audio data goes here... andis a distinguished delimiter that indicates that no further body parts will follow. Such a delimiter is identical to thesecond half might look something like this: From: Bill@host.com To: joe@otherhost.com Subject: Audio mail (part 2 of 2) MIME-Version: 1.0 Message-ID: <id2@host.com> Content-type: message/partial; id="ABC@host.com"; number=2; total=2 ... second halfprevious delimiters, with the addition ofencoded audio data goes here... Then, whentwo more hyphens at thefragmented message is reassembled,end of theresulting messageline: --gc0pJq0M:08jU534c0p-- There appears to bedisplayedroom for additional information prior to theuserfirst encapsulation boundary and following the final boundary. These areas shouldlook something like this: X-Weird-Header-1: Foo From: Bill@host.com To: joe@otherhost.com Subject: Audio mail Message-ID: <anotherid@foo.com> MIME-Version: 1.0 Content-type: audio/basic Content-transfer-encoding: base64 ...generally be left blank, and implementations must ignore anything that appears before the firsthalfboundary or after the last one. Expires May 1995 [Page 49] Internet Draft MIME Part One November 1994 NOTE: These "preamble" and "epilogue" areas are generally not used because ofencoded audio data goes here... ... second halfthe lack ofencoded audio data goes here... Note on encodingproper typing ofMIME entities encapsulated inside message/partial entities: Because datathese parts and the lack oftype "message" may never be encoded in base64 or quoted-printable, a problem might arise if message/partial entities are constructed in an environment that supports binary or 8-bit transport. The problem is thatclear semantics for handling these areas at gateways, particularly X.400 gateways. However, rather than leaving thebinary data wouldpreamble area blank, many MIME implementations have found this to besplit into multiple message/partial objects, each of them requiring binary transport. If such objects were encountered at a gateway intoa7-bit transport environment, there would be no wayconvenient place toproperly encode them for the 7-bit world, aside from waitinginsert an explanatory note forall of the parts, reassembling the message, and then encodingrecipients who read thereassembled datamessage with pre-MIME software, since such notes will be ignored by MIME- compliant software. NOTE: Because encapsulation boundaries must not appear inbase64 or quoted-printable. Since it is possible that differentthe body partsmight go through different gateways, even Borenstein & Freed [Page 48] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 this is not an acceptable solution. For this reason, it is specified that MIME entities of type message/partialbeing encapsulated, a user agent mustalways haveexercise care to choose acontent-transfer-encoding of 7-bit (the default). In particular, evenunique boundary. The boundary inenvironments that support binary or 8-bit transport,theuseexample above could have been the result of an algorithm designed to produce boundaries with acontent-transfer- encoding of "8bit" or "binary" is explicitly prohibited for entitiesvery low probability oftype message/partial. It shouldalready existing in the data to benoted that, because some message transfer agents may chooseencapsulated without having toautomatically fragment large messages, and because such agents may use different fragmentation thresholds, it is possible thatprescan thepieces ofdata. Alternate algorithms might result in more "readable" boundaries for apartial message, upon reassembly, may prove themselvesrecipient with an old user agent, but would require more attention tocomprise a partial message. This is explicitly permitted. It should also be notedthe possibility that theinclusion of a "References" fieldboundary might appear in theheaders of the second and subsequent piecesencapsulated part. The simplest boundary possible is something like "---", with a closing boundary of "-----". As afragmented message that references the Message-Id onvery simple example, theprevious piece may befollowing multipart message has two parts, both ofbenefit to mail readers that understandthem plain text, one of them explicitly typed andtrack references. However, the generationone ofsuch "References" fieldsthem implicitly typed: From: Nathaniel Borenstein <nsb@bellcore.com> To: Ned Freed <ned@innosoft.com> Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) Subject: Sample message MIME-Version: 1.0 Content-type: multipart/mixed; boundary="simple boundary" This isentirely optional. Finally, it should be noted that the "Encrypted" header field has been made obsolete by Privacy Enhanced Messaging (PEM), but the rules above are believed to describethecorrect waypreamble. It is totreat it ifbe ignored, though it isencountered in the context of conversion to and from message/partial fragments. 7.3.3 The Message/External-Body subtype The external-body subtype indicates that the actual body data are not included, but merely referenced. In this case, the parameters describeamechanismhandy place foraccessing the external data. Whenmail composers to include anentityexplanatory note to non-MIME conformant readers. --simple boundary This isof type "message/external-body", it consists of a header, two consecutive CRLFs, and the message header for the encapsulated message. If another pair of consecutive CRLFs appears, this of course ends the message header for the encapsulated message. However, since the encapsulated message's body is itself external, itimplicitly typed plain US-ASCII text. It does NOTappear in the area that follows. For example, consider the following message:end with a linebreak. --simple boundary Content-type:message/external-body; Borenstein & Freed [Page 49]text/plain; charset=us-ascii Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 50] Internet Draft MIME Part One November 1994access-type=local-file; name="/u/nsb/Me.gif" Content-type: image/gif Content-ID: <id42@guppylake.bellcore.com> Content-Transfer-Encoding: binary THIS IS NOT REALLY THE BODY! The area at the end, which might be called the "phantom body",This isignored for most external-body messages. However, it may be used to contain auxiliary information for some such messages, as indeed itexplicitly typed plain US-ASCII text. It DOES end with a linebreak. --simple boundary-- This iswhentheaccess-typeepilogue. It is"mail-server". Of the access-types defined by this document, the phantomalso to be ignored. The use of a Content-Type of multipart in a body part within another multipart entity isused only when the access-type is "mail-server".explicitly allowed. Inall othersuch cases, for obvious reasons, care must be taken to ensure that each nested multipart entity uses a different boundary delimiter. See Appendix C for an example of nested multipart entities. The use of thephantommultipart Content-Type with only a single body part may be useful in certain contexts, and isignored.explicitly permitted. The onlyalways-mandatorymandatory global parameter formessage/external- body is "access-type"; all oftheother parameters may be mandatory or optional depending onmultipart Content-Type is thevalueboundary parameter, which consists ofaccess-type. ACCESS-TYPE -- A case-insensitive word, indicating the supported access mechanism by which the file or data may1 to 70 characters from a set of characters known to beobtained. Values include, but are not limited to, "FTP", "ANON-FTP", "TFTP", "AFS", "LOCAL-FILE",very robust through email gateways, and"MAIL-SERVER". Future values, except for experimental values beginningNOT ending with white space. (If a boundary appears to end with"X- ",white space, the white space must beregistered with IANA, as described in Appendix E . In addition,presumed to have been added by a gateway, and must be deleted.) It is formally specified by the followingthree parameters are optional for ALL access-types: EXPIRATION -- The date (inBNF: boundary := 0*69<bchars> bcharsnospace bchars := bcharsnospace / " " bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-" / "." / "/" / ":" / "=" / "?" Overall, theRFC 822 "date-time" syntax,body of a multipart entity may be specified asextended byfollows: dash-boundary := "--" boundary ; boundary taken from Content-Type ; field. Expires May 1995 [Page 51] Internet Draft MIME Part One November 1994 multipart-body := preamble dash-boundary [*LWSP-char] CRLF body-part *encapsulation close-delimiter [*LWSP-char] CRLF epilogue encapsulation := delimiter [*LWSP-char] CRLF body-part delimiter := CRLF dash-boundary close-delimiter := CRLF dash-boundary "--" preamble := discard-text epilogue := discard-text discard-text := *text *(*text CRLF) ; To be ignored upon receipt. body-part := <"message" as defined in RFC1123 to permit 4 digits822, with all header fields optional, not starting with the specified dash-boundary, and with the delimiter not occurring anywhere in theyear field) after whichmessage body. Note that theexistencesemantics of a part differ from theexternal data is not guaranteed. SIZE -- The size (in octets)semantics of a message, as described in thedata.text.> IMPORTANT NOTE: Theintentaddition of LWSP between the elements shown in thisparameterBNF isto help the recipient decide whether orNOT allowed since this BNF does notto expendspecify a structured header field. NOTE: In certain transport enclaves, RFC 822 restrictions such as thenecessary resourcesone that limits bodies toretrieveprintable US-ASCII characters may not be in force. (That is, theexternal data. Note that this describestransport domains may resemble standard Internet mail transport as specified in RFC 821 and assumed by RFC 822, but without certain restrictions.) The relaxation of these restrictions should be construed as locally extending thesizedefinition of bodies, for example to include octets outside of thedataUS-ASCII range, as long as these extensions are supported by the transport and adequately documented inits canonical form, that is, before any Content- Transfer-Encoding has been applied or aftertheBorenstein & Freed [Page 50]Content-Transfer- Encoding header field. However, in no event are headers (either message headers or body-part headers) allowed to contain anything other than US-ASCII characters. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 52] Internet Draft MIME Part One November 1994data have been decoded. PERMISSION -- A case-insensitive field that indicates whether or notNOTE: Conspicuously missing from the multipart type is a notion of structured, related body parts. In general, it seems premature to try to standardize interpart structure yet. It isexpectedrecommended thatclients might also attemptthose wishing tooverwrite the data. By default,provide a more structured orif permission is "read", the assumptionintegrated multipart messaging facility should define a subtype of multipart that is syntactically identical, but thatthey are not, andalways expects the inclusion of a distinguished part thatifcan be used to specify thedata is retrieved once, it is never needed again.structure and integration of the other parts, probably referring to them by their Content- ID field. IfPERMISSION is "read-write",thisassumptionapproach isinvalid,used, other implementations will not recognize the new subtype, but will treat it as the primary subtype (multipart/mixed) andany local copy mustwill thus beconsidered no more than a cache. "Read" and "Read-write" are the only defined values of permission. The precise semantics ofable to show theaccess-types defined here are described inuser thesectionsparts thatfollow.are recognized. 6.2.1.2. Handling Nested Messages and Multiparts Theencapsulated headers"message/rfc822" subtype defined inALL message/external-body entities MUST includeaContent-ID header field to give a unique identifier by which to reference thesubsequent section of this document has no terminating condition other than running out of data.This identifierSimilarly, an improperly truncated multipart object maybe used for cacheing mechanisms,not have any terminating boundary marker, andfor recognizing the receipt of the data when the access-typedoes arise in practice due to mail system malfunctions. It is"mail-server". Note that, as specified here, the tokensessential thatdescribe external-body data,suchas file names and mail server commands,objects be handled correctly when they are themselves imbedded inside of another multipart structure. MIME implementations are therefore required tobe inrecognize outer level boundary markers at ANY level of inner nesting. It is not sufficient to only check for theUS-ASCII character set. If this proves problematic in practice, a new mechanism may be required as a future extension to MIME, either as newly defined access-types for message/external-bodynext expected marker orby someothermechanism. As with message/partial, itterminating condition. 6.2.1.3. Mixed Subtype The "mixed" subtype of multipart isspecifiedintended for use when the body parts are independent and need to be bundled in a particular order. Any multipart subtypes thatMIME entities of type message/external-bodyan implementation does not recognize mustalways have a content- transfer-encodingbe treated as being of7-bit (the default).subtype "mixed". 6.2.1.4. Alternative Subtype The multipart/alternative type is syntactically identical to multipart/mixed, but the semantics are different. In particular,even in environments that support binary or 8-bit transport, the use of a content-transfer-encoding of "8bit" or "binary" is explicitly prohibited for entities of type message/external-body. 7.3.3.1 The "ftp" and "tftp" access-types An access-typeeach ofFTP or TFTP indicates thatthemessage bodyparts isaccessible as a file using the FTP [RFC-959] or TFTP [RFC-783] protocols, respectively. For these access-types, the following additional parameters are mandatory: Borenstein & Freed [Page 51]an "alternative" version of Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 53] Internet Draft MIME Part One November 1994NAME -- The name ofthefilesame information. Systems should recognize thatcontains the actual body data. SITE -- A machine from whichthefile may be obtained, usingcontent of thegiven protocol. This must be a fully qualified domain name, not a nickname. Before any datavarious parts areretrieved, using FTP,interchangeable. Systems should choose theuser will generally need to be asked to provide a login id"best" type based on the local environment anda password forpreferences, in some cases even through user interaction. As with multipart/mixed, themachine named by the site parameter. For security reasons, such an id and password are not specified as content-type parameters, but must be obtained from the user.order of body parts is significant. Inaddition, the following parameters are optional: DIRECTORY -- A directory from which the data named by NAME should be retrieved. MODE -- A case-insensitive string indicatingthis case, themodealternatives appear in an order of increasing faithfulness tobe used when retrievingtheinformation. The legal values for access-type "TFTP" are "NETASCII", "OCTET", and "MAIL", as specified byoriginal content. In general, theTFTP protocol [RFC-783]. The legal values for access-type "FTP" are "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n"best choice isa decimal integer, typically 8. These correspond totherepresentation types "A" "E" "I" and "L n" as specifiedLAST part of a type supported by theFTP protocol [RFC-959]. Note that "BINARY" and "TENEX" are not valid values for MODE, but that "OCTET" or "IMAGE" or "LOCAL8" shouldrecipient system's local environment. Multipart/alternative may beused instead. IF MODE is not specified, the default value is "NETASCII"used, forTFTP and "ASCII" otherwise. 7.3.3.2 The "anon-ftp" access-type The "anon-ftp" access-type is identical to the "ftp" access type, except that the user need not be askedexample, toprovidesend mail in aname and password for the specified site. Instead, the ftp protocol will be used with login "anonymous" andfancy text format in such apasswordway thatcorresponds to the user's email address. 7.3.3.3 The "local-file" and "afs" access-typesit can easily be displayed anywhere: From: Nathaniel Borenstein&<nsb@bellcore.com> To: Ned Freed[Page 52] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 An access-type<ned@innosoft.com> Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) Subject: Formatted text mail MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=boundary42 --boundary42 Content-Type: text/plain; charset=us-ascii ... plain text version of"local-file" indicates thatmessage goes here ... --boundary42 Content-Type: text/enriched ... RFC 1563 text/enriched version of same message goes here ... --boundary42 Content-Type: application/x-whatever ... fanciest version of same message goes here ... --boundary42-- In this example, users whose mail system understood theactual body is accessible as a file on"application/x-whatever" format would see only thelocal machine. An access-type of "afs" indicates thatfancy version, while other users would see only thefile is accessible viaenriched or plain text version, depending on theglobal AFS filecapabilities of their Expires May 1995 [Page 54] Internet Draft MIME Part One November 1994 system. Inboth cases, only a single parameter is required: NAME -- The name of the filegeneral, user agents thatcontainscompose multipart/alternative entities must place theactualbodydata. The following optional parameter may be used to describe the localityparts in increasing order ofreference for the data,preference, that is, with thesite or sites at whichpreferred format last. For fancy text, thefilesending user agent should put the plainest format first and the richest format last. Receiving user agents should pick and display the last format they are capable of displaying. In the case where one of the alternatives isexpected to be visible: SITE -- A domain specifier for a machine or setitself ofmachines that are known to have access totype "multipart" and contains unrecognized sub-parts, thedata file. Asterisksuser agent maybe used for wildcard matchingchoose either toa part of a domain name, such as "*.bellcore.com", to indicate a set of machines on which the data should be directly visible, while a single asterisk may be used to indicate a fileshow thatis expectedalternative, an earlier alternative, or both. NOTE: From an implementor's perspective, it might seem more sensible tobe universally available, e.g., via a global file system. 7.3.3.4 The "mail-server" access-type The "mail-server" access-type indicates thatreverse this ordering, and have theactual bodyplainest alternative last. However, placing the plainest alternative first isavailable fromthe friendliest possible option when multipart/alternative entities are viewed using a non-MIME- conformant mailserver. The mandatory parameter forreader. While thisaccess-type is: SERVER -- The email address of theapproach does impose some burden on conformant mailserver from which the actual body data can be obtained. Becausereaders, interoperability with older mailservers accept a variety of syntaxes,readers was deemed to be more important in this case. It may be the case that some user agents, if they can recognize more than one ofwhich is multiline,thefull commandformats, will prefer tobe sentoffer the user the choice of which format toaview. This makes sense, for example, if mailserver is not included asincludes both aparameter on the content-type line. Instead, it is provided as the "phantom body" when the content-type is message/external-bodynicely-formatted image version andthe access- typean easily-edited text version. What ismail-server. An optional parameter for this access-type is: SUBJECT -- The subject thatmost critical, however, isto be used in the mailthatis sent to obtainthedata. Note that keying mail servers on Subject lines is NOT recommended, but such mail servers are known to exist. Borenstein & Freed [Page 53] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Note that MIME doesuser notdefine a mail server syntax. Rather, it allows the inclusionautomatically be shown multiple versions ofarbitrary mail server commands inthephantom body. Implementations must includesame data. Either thephantom body inuser should be shown thebodylast recognized version or should be given the choice. NOTE ON THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE: Each part of a multipart/alternative entity represents themessage it sends tosame data, but themail server address to retrievemappings between therelevant data. Ittwo are not necessarily without information loss. For example, information isworth noting that, unlike other access-types, mail- server accesslost when translating ODA to PostScript or plain text. It isasynchronous and will happen at an unpredictable timerecommended that each part should have a different Content-ID value in thefuture. For this reason, itcase where the information content of the two parts isimportant that there be a mechanism by whichnot identical. And when thereturned data can be matched up withinformation content is identical -- for example, where several parts of type "message/external-body" specify alternate ways to access theoriginal message/external- body entity. MIME mailservers must useidentical data -- the same Content-ID field value should be used, to optimize any caching mechanisms that might be present on thereturned message that wasrecipient's end. However, the Expires May 1995 [Page 55] Internet Draft MIME Part One November 1994 Content-ID values usedinby theoriginal message/external-body entity, to facilitate such matching. 7.3.3.5 Examples and Further Explanations Withparts should NOT be theemerging possibility of very wide-area file systems, it becomes very hard to know in advancesame Content-ID value that describes theset of machines wheremultipart/alternative as afile will andwhole, if there is any such Content-ID field. That is, one Content-ID value willnot be accessible directly from the file system. Therefore it may make sense to provide both a file name,refer tobe tried directly, andthename ofmultipart/alternative entity, while one or moresites from which the file is known to be accessible. An implementation can try to retrieve remote files using FTP or anyotherprotocol, using anonymous file retrieval or prompting the user for the necessary name and password. If an external body is accessible via multiple mechanisms,Content-ID values will refer to thesender may include multipleparts inside it. 6.2.1.5. Digest Subtype This document defines a "digest" subtype oftype message/external-body within an entity of type multipart/alternative. However,theexternal-body mechanismmultipart Content-Type. This type isnot intended to be limitedsyntactically identical tofile retrieval, as shown bymultipart/mixed, but themail-server access-type. Beyond this, one can imagine, for example, usingsemantics are different. In particular, in avideo server for external references to video clips. If an entity is of type "message/external-body", then the body of the entity will contain the header fields ofdigest, theencapsulated message. Thedefault Content-Type value for a bodyitselfpart is changed from "text/plain" tobe found in the external location."message/rfc822". Thismeansis done to allow a more readable digest format thatif the body of the "message/external-body" message contains two consecutive CRLFs, everything after those pairsisNOT part oflargely compatible (except for themessage itself. For most message/external-body messages,quoting convention) with RFC 934. A digest in thistrailing area must simply be ignored. However, it is a convenient place for additional data that cannot be included Borenstein & Freed [Page 54]format might, then, look something like this: From: Moderator-Address To: Recipient-List Date: Mon, 22 Mar 1994 13:34:51 +0000 Subject: Internet Digest, volume 42 MIME-Version: 1.0 Content-Type: multipart/digest; boundary="---- next message ----" ------ next message ---- From: someone-else Date: Fri, 26 Mar 1993 11:13:32 +0200 Subject: my opinion ...body goes here ... ------ next message ---- From: someone-else-again Date: Fri, 26 Mar 1993 10:07:13 -0500 Subject: my different opinion ... another body goes here ... Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 56] Internet Draft MIME Part One November 1994in the content-type header field. In particular, if------ next message ------ 6.2.1.6. Parallel Subtype This document defines a "parallel" subtype of the"access-type" valuemultipart Content-Type. This type is"mail-server", then the trailing area must contain commands to be sentsyntactically identical to multipart/mixed, but themail server at the address given by the value of the SERVER parameter. The embedded message header fields which appearsemantics are different. In particular, in a parallel entity, the order of body parts is not significant. A common presentation ofthe message/external-body data must be usedthis type is todeclare the Content-typedisplay all of theexternal body if it is anything other than plain ASCII text, sinceparts simultaneously on hardware and software that are capable of doing so. However, composing agents should be aware that many mail readers will lack this capability and will show theexternal body does not have a header section to declare its type. Similarly,parts serially in anyContent-transfer-encoding other than "7bit"event. 6.2.1.7. Other Multipart Subtypes Other multipart subtypes are expected in the future. MIME implementations mustalso be declared here. Thus a complete message/external-body message, referring to a documentinPostScript format, might look like this: From: Whomever To: Someone Subject: whatever MIME-Version: 1.0 Message-ID: <id1@host.com> Content-Type: multipart/alternative; boundary=42 Content-ID: <id001@guppylake.bellcore.com> --42 Content-Type: message/external-body; name="BodyFormats.ps"; site="thumper.bellcore.com"; access-type=ANON-FTP; directory="pub"; mode="image"; expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" Content-type: application/postscript Content-ID: <id42@guppylake.bellcore.com> --42 Content-Type: message/external-body; name="/u/nsb/writing/rfcs/RFC-MIME.ps"; site="thumper.bellcore.com"; access-type=AFS expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" Content-type: application/postscript Content-ID: <id42@guppylake.bellcore.com> Borenstein & Freed [Page 55] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 --42 Content-Type: message/external-body; access-type=mail-server server="listserv@bogus.bitnet"; expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" Content-type: application/postscript Content-ID: <id42@guppylake.bellcore.com> get RFC-MIME.DOC --42-- Note thatgeneral treat unrecognized subtypes of multipart as being equivalent to "multipart/mixed". 6.2.2. Message Content-Type It is frequently desirable, in sending mail, to encapsulate another mail message. A special Content-Type, "message", is defined to facilitate this. In particular, theabove examples, the default Content- transfer-encoding"rfc822" subtype of"7bit""message" isassumedused to encapsulate RFC 822 messages. NOTE: It has been suggested that subtypes of message might be defined for forwarded or rejected messages. However, forwarded and rejected messages can be handled as multipart messages in which theexternal postscript data. Likefirst part contains any control or descriptive information, and a second part, of type message/rfc822, is themessage/partial type,forwarded or rejected message. Composing rejection and forwarding messages in this manner will preserve themessage/external-bodytypeis intendedinformation on the original message and allow it to betransparent, that is,correctly presented toconveythedata type in the external body rather than to convey a message with a bodyrecipient, and hence is strongly encouraged. Expires May 1995 [Page 57] Internet Draft MIME Part One November 1994 Subtypes ofthat type. Thus the headersmessage often impose restrictions onthe outerwhat encodings are allowed. These restrictions are described in conjunction with each specific subtype. Mail gateways, relays, andinner parts must be merged usingother mail handling agents are commonly known to alter thesame rules as for message/partial.top-level header of an RFC 822 message. In particular,this means that the Content-typethey frequently add, remove, or reorder headeris overridden, but the From and Subject headers are preserved. Note that since the external bodiesfields. Such alterations arenot transported as mail, they need not conform toexplicitly forbidden for the7-bit and line length requirements, but mightencapsulated headers embedded infact be binary files. Thus a Content-Transfer-Encoding is not generally necessary, though it is permitted. Note thatthebodybodies ofa messagemessages of type"message/external- body" is governed by"message." 6.2.2.1. RFC822 Subtype A Content-Type of "message/rfc822" indicates that the body contains an encapsulated message, with thebasicsyntaxforof an RFC 822 message.In particular, anything beforeHowever, unlike top-level RFC 822 messages, thefirst consecutive pair of CRLFs isrestriction that each message/rfc822 body must include a "From", "Date", and at least one destination headerinformation, while anything after itisbody information, whichremoved and replaced with the requirement that at least one of "From", "Subject", or "Date" must be present. No encoding other than "7bit", "8bit", or "binary" isignoredpermitted formost access-types.parts of type "message/rfc822". Theformal grammar for content-typemessage header fieldsfor data of type message is given by: message-type := "message" "/" message-subtype message-subtype := "rfc822" Borenstein & Freed [Page 56] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 / "partial" 2#3partial-param / "external-body" 1*external-param / extension-token partial-param := (";" "id" "=" value) / (";" "number" "=" 1*DIGIT) / (";" "total" "=" 1*DIGIT) ; id & number required; total required for last part external-param := (";" "access-type" "=" atype) / (";" "expiration" "=" date-time) ; Note that date-time is quoted / (";" "size" "=" 1*DIGIT) / (";" "permission" "=" ("read" / "read- write")) ; Permission is case-insensitive / (";" "name" "=" value) / (";" "site" "=" value) / (";" "dir" "=" value) / (";" "mode" "=" value) / (";" "server" "=" value) / (";" "subject" "=" value) ; access-type required; others required based on access-type atype := "ftp" / "anon-ftp" / "tftp" / "local-file" / "afs" / "mail-server" / extension-token ; Case-insensitive Borenstein & Freed [Page 57] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 7.4 The Application Content-Type The "application" Content-Type is to be used for data which do not fitare always US-ASCII in anyof the other categories,case, andparticularly fordatatowithin the body can still beprocessed by mail-based uses of application programs. This is informationencoded, in whichmust be processed by an application before it is viewable or usable to a user. Expected uses for Content-Type application include mail- based file transfer, spreadsheets, data for mail-based scheduling systems, and languages for "active" (computational) email. (The latter,case the Content- Transfer-Encoding header field inparticular,the encapsulated message will reflect this. Non-US-ASCII text in the headers of an encapsulated message canpose security problems which mustbeunderstood by implementors, and are considered in detailspecified using the mechanisms described in RFC MIME-HEADERS. It should be noted that, despite thediscussionuse of theapplication/PostScript content-type.) For example, a meeting scheduler might definenumbers "822", astandard representation formessage/rfc822 entity can include enhanced informationabout proposed meeting dates. An intelligent user agent would use this information to conduct a dialog with the user, and might then send further mail based on that dialog. More generally, there have been several "active" messaging languages developed in which programsas defined in this document. In other words, asuitably specialized language are sent through the mail and automatically run in the recipient's environment. Such applicationsmessage/rfc822 message may be a MIME message. 6.2.2.2. Partial Subtype The "partial" subtype is defined to allow large entities to be delivered assubtypesseveral separate pieces of mail and automatically reassembled by the"application" Content-Type. This document defines two subtypes: octet-stream,receiving user agent. (The concept is similar to IP fragmentation andPostScript. In general,reassembly in thesubtype of application will oftenbasic Internet Protocols.) This mechanism can be used when intermediate transport agents limit thenamesize ofthe application for which the data are intended. This does not mean, however,individual Expires May 1995 [Page 58] Internet Draft MIME Part One November 1994 messages thatany application program name maycan beused freely assent. Content-Type "message/partial" thus indicates that the body contains asubtypefragment ofapplication. Such usages (other than subtypes beginning with "x-")a larger message. Three parameters must beregistered with IANA, as describedspecified inAppendix E. 7.4.1 The Application/Octet-Stream (primary) subtype The primary subtypethe Content-Type field ofapplication, "octet-stream", maytype message/partial: The first, "id", is a unique identifier, as close to a world-unique identifier as possible, to be used toindicate that a body contains binary data. The set of possible parameters includes, but is not limited to: TYPE --match thegeneral type or category of binary data. This is intended as information forparts together. (In general, thehuman recipient rather than for any automatic processing. Borenstein & Freed [Page 58] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 PADDING --identifier is essentially a message-id; if placed in double quotes, it can be ANY message-id, in accordance with thenumber of bits of padding that were appended toBNF for "parameter" given earlier in this specification.) The second, "number", an integer, is thebit-stream comprisingpart number, which indicates where this part fits into theactual contents to producesequence of fragments. The third, "total", another integer, is theenclosed byte-oriented data.total number of parts. This third subfield isuseful for enclosing a bit-streamrequired on the final part, and is optional (though encouraged) on the earlier parts. Note also that these parameters may be given in any order. Thus, part 2 of abody when3-part message may have either of the following header fields: Content-Type: Message/Partial; number=2; total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com" Content-Type: Message/Partial; id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; number=2 But part 3 MUST specify the total number ofbits isparts: Content-Type: Message/Partial; number=3; total=3; id="oc=jpbe0M2Yt4s@thumper.bellcore.com" Note that part numbering begins with 1, nota multiple of0. When thebyte size. An additional parameter, "conversions", was definedparts of a message broken up in[RFC-1341] but has been removed. RFC 1341 also definedthis manner are put together, theuse ofresult is a"NAME" parametercomplete MIME entity, whichgavemay have its own Content-Type header field, and thus may contain any other data type. 6.2.2.2.1. Message Fragmentation and Reassembly The semantics of asuggested file name toreassembled partial message must beused ifthose of thedata were to be written to a file. This has been deprecated in anticipation"inner" message, rather than of aseparate Content-Disposition header field, to be defined in a subsequent RFC. The recommended actionmessage containing Expires May 1995 [Page 59] Internet Draft MIME Part One November 1994 the inner message. This makes it possible, foran implementation that receives application/octet-stream mail is to simply offerexample, toput the data insend afile, with any Content-Transfer-Encoding undone, or perhaps to use itlarge audio message asinputseveral partial messages, and still have it appear toa user-specified process. To reduce the danger of transmitting rogue programs throughthemail, it is strongly recommended that implementations NOT implementrecipient as apath-search mechanism wherebysimple audio message rather than as anarbitrary program named in the Content-Type parameter (e.g.,encapsulated message containing an"interpreter=" parameter) is found and executed usingaudio message. That is, themail body as input. 7.4.2 The Application/PostScript subtype A Content-Type of "application/postscript" indicates a PostScript program. Currently two variantsencapsulation of thePostScript language are allowed; the original level 1 variantmessage isdescribed in [POSTSCRIPT]considered to be "transparent". When generating and reassembling themore recent level 2 variant is described in [POSTSCRIPT2]. PostScript is a registered trademarkparts ofAdobe Systems, Inc. Usea message/partial message, the headers of theMIME content-type "application/postscript" implies recognitionencapsulated message must be merged with the headers ofthat trademark and alltherights it entails. The PostScript language definition provides facilities for internal labelingenclosing entities. In this process the following rules must be observed: (1) All of thespecific language features a given program uses. This labeling, calledheader fields from thePostScript document structuring conventions, is very generalinitial enclosing entity (part one), except those that start with "Content-" andprovides substantially more information than justthelanguage level. Borenstein & Freed [Page 59] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 The use of document structuring conventions, while not required, is strongly recommended as an aid to interoperability. Documents which lack proper structuring conventions cannotspecific header fields "Subject", "Message-ID", "Encrypted", and "MIME-Version", must betestedcopied, in order, tosee whether or not they will workthe new message. (2) Only those header fields ina given environment. As such, some systems may assumetheworstenclosed message which start with "Content-" andrefuse to process unstructured documents. The execution of general-purpose PostScript interpreters entails serious security risks,"Subject", "Message-ID", "Encrypted", andimplementors are discouraged from simply sending PostScript email bodies to "off-the-shelf" interpreters. While it is usually safe to send PostScript"MIME-Version" must be appended, in order, toa printer, where the potential for harm is greatly constrained, implementors should consider all ofthefollowing before they add interactive display of PostScript bodies to their mail readers. The remainder of this section outlines some, though probably not all,header fields of thepossible problems with sending PostScript through the mail. Dangerous operationsnew message. Any header fields in thePostScript language include, but mayenclosed message which do not start with "Content-" (except for "Message-ID", "Encrypted", and "MIME-Version") will belimited to,ignored. (3) All of thePostScript operators deletefile, renamefile, filenameforall,header fields from the second andfile. Fileany subsequent messages will be ignored. 6.2.2.2.2. Fragmentation and Reassembly Example If an audio message isonly dangerous when applied to something other than standard input or output. Implementations may also define additional nonstandard file operators; these may also pose a threat to security. Filenameforall,broken into two parts, thewildcard file search operator, may appear atfirstglance to be harmless. Note, however, that this operator has the potential to reveal information about what files the recipient has access to,part might look something like this: X-Weird-Header-1: Foo From: Bill@host.com To: joe@otherhost.com Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) Subject: Audio mail (part 1 of 2) Message-ID: <id1@host.com> MIME-Version: 1.0 Content-type: message/partial; id="ABC@host.com"; number=1; total=2 Expires May 1995 [Page 60] Internet Draft MIME Part One November 1994 X-Weird-Header-1: Bar X-Weird-Header-2: Hello Message-ID: <anotherid@foo.com> Subject: Audio mail MIME-Version: 1.0 Content-type: audio/basic Content-transfer-encoding: base64 ... first half of encoded audio data goes here ... andthis information may itself be sensitive. Message senders should avoidtheusesecond half might look something like this: From: Bill@host.com To: joe@otherhost.com Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) Subject: Audio mail (part 2 ofpotentially dangerous file operators, since these operators are quite likely to be unavailable in secure PostScript implementations. Message- receiving and -displaying software should either completely disable all potentially dangerous file operators or take special care not to delegate any special authority to their operation. These operators should be viewed as being done by an outside agency when interpreting PostScript documents. Such disabling and/or checking should be done completely outside2) MIME-Version: 1.0 Message-ID: <id2@host.com> Content-type: message/partial; id="ABC@host.com"; number=2; total=2 ... second half of encoded audio data goes here ... Then, when thereach offragmented message is reassembled, thePostScript language itself; care shouldresulting message to betakendisplayed toinsure that no method exists for re- enabling full-function versions of these operators. Borenstein & Freed [Page 60] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 The PostScript language provides facilities for exitingthenormal interpreter, or server, loop. Changes made in this "outer" environment are customarily retained across documents, anduser should look something like this: X-Weird-Header-1: Foo From: Bill@host.com To: joe@otherhost.com Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) Subject: Audio mail Message-ID: <anotherid@foo.com> MIME-Version: 1.0 Content-type: audio/basic Content-transfer-encoding: base64 ... first half of encoded audio data goes here ... ... second half of encoded audio data goes here ... Because data of type "message" mayin some casesnever beretained semipermanentlyencoded innonvolatile memory. The operators associated with exiting the interpreter loop have the potential to interfere with subsequent document processing. As such, their unrestrained use constitutesbase64 or quoted-printable, athreat of service denial. PostScript operators that exit the interpreter loop include, but may not be limited to, the exitserver and startjob operators. Message-sending software should not generate PostScriptproblem might arise if message/partial entities are constructed in an environment thatdepends on exiting the interpreter loop to operate.supports binary or 8-bit transport. Theability to exit will probably be unavailable in secure PostScript implementations. Message-receiving and -displaying software should, if possible, disable the ability to make retained changes to the PostScript environment, and eliminateproblem is that thestartjob and exitserver commands. If these commands cannotbinary data would beeliminated, the password associated withsplit into multiple message/partial messages, Expires May 1995 [Page 61] Internet Draft MIME Part One November 1994 each of themshouldrequiring binary transport. If such messages were encountered atleasta gateway into a 7-bit transport environment, there would besetno way toa hard-to-guess value. PostScript provides operatorsproperly encode them forsetting system-wide and device-specific parameters. These parameter settings may be retained across jobs and may potentially pose a threat tothecorrect operation7-bit world, aside from waiting for all of theinterpreter. The PostScript operators that set system and device parameters include, but may not be limited to,fragments, reassembling thesetsystemparamsinner message, andsetdevparams operators. Message-sending software shouldthen encoding the reassembled data in base64 or quoted-printable. Since it is possible that different fragments might go through different gateways, even this is notgenerate PostScriptan acceptable solution. For this reason, it is specified thatdepends onMIME entities of type message/partial must always have a content-transfer-encoding of 7-bit (the default). In particular, even in environments that support binary or 8-bit transport, thesettinguse ofsystema content- transfer-encoding of "8bit" ordevice parameters"binary" is explicitly prohibited for entities of type message/partial. Because some message transfer agents may choose tooperate correctly. The abilityautomatically fragment large messages, and because such agents may use very different fragmentation thresholds, it is possible that the pieces of a partial message, upon reassembly, may prove themselves toset these parameters will probably be unavailablecomprise a partial message. This is explicitly permitted. The inclusion of a "References" field insecure PostScript implementations. Message-receivingthe headers of the second and-displaying software should, if possible, disablesubsequent pieces of a fragmented message that references theabilityMessage-Id on the previous piece may be of benefit tochange systemmail readers that understand anddevice parameters. If these operators cannot be disabled,track references. However, thepassword associated with themgeneration of such "References" fields is entirely optional. Finally, it shouldat leastbeset to a hard-to-guess value. Some PostScript implementations provide nonstandard facilities fornoted that thedirect loading"Encrypted" header field has been made obsolete by Privacy Enhanced Messaging (PEM) [RFC1421, RFC1422, RFC1423, andexecution of machine code. Such facilitiesRFC1424], but the rules above arequite obviously opennevertheless believed tosubstantial abuse. Message-sending software should not make use of such features. Besides being totally hardware- specific, they are also likelydescribe the correct way tobe unavailabletreat it if it is encountered insecure implementationsthe context ofPostScript. Message-receivingconversion to and-displaying software shouldfrom message/partial fragments. 6.2.2.3. External-Body Subtype The external-body subtype indicates that the actual body data are notallow such operators to be used if they exist. Borenstein & Freed [Page 61]included, but merely referenced. In this case, the parameters describe a mechanism for accessing the external data. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 62] Internet Draft MIME Part One November 1994PostScript isWhen anextensible language, and many, if not most, implementationsentity is of type "message/external-body", itprovide a number of their own extensions. This document does not deal with such extensions explicitly since they constitute an unknown factor. Message-sending software should not make useconsists ofnonstandard extensions; they are likely to be missing from some implementations. Message-receiving and -displaying software should make sure that any nonstandard PostScript operators are securea header, two consecutive CRLFs, anddon't present any kind of threat. It is possible to write PostScript that consumes huge amountsthe message header for the encapsulated message. If another pair ofvarious system resources. It is also possible to write PostScript programs that loop infinitely. Both typesconsecutive CRLFs appears, this ofprograms havecourse ends thepotential to cause damage if sent to unsuspecting recipients. Message-sending software should avoidmessage header for theconstruction and dissemination of such programs, whichencapsulated message. However, since the encapsulated message's body isantisocial. Message-receiving and -displaying software should provide appropriate mechanisms to abort processing of a document after a reasonable amount of time has elapsed. In addition, PostScript interpreters shoulditself external, it does NOT appear in the area that follows. For example, consider the following message: Content-type: message/external-body; access-type=local-file; name="/u/nsb/Me.gif" Content-type: image/gif Content-ID: <id42@guppylake.bellcore.com> Content-Transfer-Encoding: binary THIS IS NOT REALLY THE BODY! The area at the end, which might belimited tocalled theconsumption of only a reasonable amount of any given system resource. It"phantom body", ispossibleignored for most external-body messages. However, it may be used toinclude raw binarycontain auxiliary informationinside PostScript in various forms. This is not recommendedforuse in email, both becausesome such messages, as indeed it isnot supported by all PostScript interpreters and because it significantly complicateswhen theuse of a MIME Content-Transfer-Encoding. (Without such binary, PostScript may typically be viewed as line-oriented data.access-type is "mail- server". Thetreatment of CRLF sequences becomes extremely problematic if binary and line-oriented data are mixed in a single Postscript data stream.) Finally, bugs may existonly access-type defined insome PostScript interpreters which could possibly be exploited to gain unauthorized access to a recipient's system. Apart from notingthispossibility, there is no specific action to take to prevent this, apart fromdocument that uses thetimely correction of such bugs if any are found. 7.4.3 Other Application subtypes Itphantom body isexpected that many"mail-server", but othersubtypes of application willaccess-types may be defined in thefuture. MIME implementations must generally treat any unrecognized subtypes as being equivalent to application/octet-stream. Borenstein & Freed [Page 62] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 The formal grammar for content-type header fields for application data is given by: application-type := "application" "/" application-subtype application-subtype := ("octet-stream" *stream-param) / "postscript" / extension-token stream-param := (";" "type" "=" value) / (";" "padding" "=" padding) padding := "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" 7.5 The Image Content-Type A Content-Type of "image" indicatesfuture in other documents thatthe body contains an image.use this area. Thesubtype namesencapsulated headers in ALL message/external-body entities MUST include a Content-ID header field to give a unique identifier by which to reference thespecific image format. These names are case insensitive. Two initial subtypes are "jpeg"data. This identifier may be used forthe JPEG format, JFIF encoding,caching mechanisms, and"gif"forGIF format [GIF]. The listrecognizing the receipt ofimage subtypes given here is neither exclusive nor exhaustive, andthe data when the access-type isexpected to grow"mail-server". Note that, asmore types are registered with IANA,specified here, the tokens that describe external-body data, such asdescribedfile names and mail server commands, are required to be inAppendix E. The formal grammar forthecontent-type header fieldUS-ASCII character set. If this proves problematic in practice, a new mechanism may be required as a future extension to MIME, either as newly defined access-types fordatamessage/external-body or by some other mechanism. As with message/partial, MIME entities of typeimage is given by: image-type := "image" "/" ("gif" / "jpeg" / extension-token) 7.6 The Audio Content-Type A Content-Typemessage/external-body MUST have a content-transfer-encoding of"audio" indicates7-bit (the default). In particular, even in environments that support binary or 8-bit transport, thebody contains audio data. Although there is not yet a consensus on an "ideal" audio format forusewith computers, there is a pressing need for a format capable of providing interoperable behavior. The initial subtypeof"basic" is specified to meet this requirement by providing an absolutely minimal lowest common denominator audio format. It is expected that richer formats for higher quality and/or lower bandwidth audio will be defined byalater document. Borenstein & Freed [Page 63]content- Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 63] Internet Draft MIME Part One November 1994The content of the "audio/basic" subtype is audio encoded using 8-bit ISDN mu-law [PCM]. When this subtype is present, a sample ratetransfer-encoding of8000 Hz and a single channel"8bit" or "binary" isassumed. The formal grammar for the content-type header fieldexplicitly prohibited fordataentities of typeaudio is given by: audio-type := "audio" "/" ("basic" / extension-token) 7.7message/external-body. 6.2.2.3.1. General External-Body Parameters TheVideo Content-Type A Content-Type of "video" indicatesparameters thatthe body contains a time-varying-picture image, possibly with color and coordinated sound. The term "video" ismay be usedextremely generically, rather thanwithreference toanyparticular technologymessage/external-body are: (1) ACCESS-TYPE -- A word indicating the supported access mechanism by which the file orformat, anddata may be obtained. This word is notmeant to preclude subtypes suchcase sensitive. Values include, but are not limited to, "FTP", "ANON-FTP", "TFTP", "LOCAL- FILE", and "MAIL-SERVER". Future values, except for experimental values beginning with "X-", must be registered with IANA, asanimated drawings encoded compactly.described in RFC REG. This parameter is unconditionally mandatory and MUST be present on EVERY message/external-body. (2) EXPIRATION -- Thesubtype "mpeg" refers to video coded according todate (in theMPEG standard [MPEG]. Note that althoughRFC 822 "date-time" syntax, as extended by RFC 1123 to permit 4 digits ingeneral this document strongly discouragesthemixing of multiple media in a single body, it is recognized that many so-called "video" formats include a representation for synchronized audio, and this is explicitly permitted for subtypes of "video". The formal grammar foryear field) after which thecontent-type header field for dataexistence oftype video is given by: video-type := "video" "/" ("mpeg" / extension-token) 7.8 Experimental Content-Type Values A Content-Type value beginning withthecharacters "X-"external data isa private value, tonot guaranteed. This parameter may be usedby consenting mail systems by mutual agreement. Any format without a rigorous and public definition must be namedwithan "X-" prefix,ANY access-type andpublicly specified values shall never begin with "X-". (Older versions of the widely-used Andrew system use the "X-BE2" name, so new systems should probably choose a different name.) In general, the use of "X-" top-level typesisstrongly discouraged. Implementors should invent subtypesALWAYS optional. (3) SIZE -- The size (in octets) of theexisting types whenever possible.data. Theinventionintent ofnew Borenstein & Freed [Page 64] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 typesthis parameter isintended to be restricted primarilyto help thedevelopment of new media types for email, such as digital odorsrecipient decide whether orholography, andnotfor new data formats in general. In many cases, a subtype of application will be more appropriate than a new top-level type. Summary Usingto expend theMIME-Version, Content-Type, and Content-Transfer- Encoding header fields, it is possiblenecessary resources toinclude, in a standardized way, arbitrary types of data objectsretrieve the external data. Note that this describes the size of the data in its canonical form, that is, before any Content-Transfer-Encoding has been applied or after the data have been decoded. This parameter may be used withRFC 822 conformant mail messages. No restrictions imposed by either RFC 821ANY access-type and is ALWAYS optional. (4) PERMISSION -- A case-insensitive field that indicates whether orRFC 822not it is expected that clients might also attempt to overwrite the data. By default, or if permission is "read", the assumption is that they areviolated,not, andcare has been taken to avoid problems caused by additional restrictions imposed bythat if thecharacteristics of some Internet mail transport mechanisms (see Appendix B). The "multipart"data is retrieved once, it is never needed again. If PERMISSION is "read-write", this assumption is invalid, and"message" Content-Types allow mixingany local copy must be considered no more than a cache. "Read" andhierarchical structuring"Read- write" are the only defined values ofobjectspermission. This parameter may be used with ANY access-type and is Expires May 1995 [Page 64] Internet Draft MIME Part One November 1994 ALWAYS optional. The precise semantics ofdifferent typesthe access-types defined here are described ina single message. Further Content-Types provide a standardized mechanism for tagging messagesthe sections that follow. 6.2.2.3.2. The 'ftp' and 'tftp' Access-Types An access-type of FTP or TFTP indicates that the message bodypartsis accessible asaudio, image,a file using the FTP [RFC-959] orseveral other kinds of data. A distinguished parameter syntax allows further specification of data format details, particularlyTFTP [RFC- 783] protocols, respectively. For these access-types, thespecification of alternate character sets. Additional optional header fields provide mechanisms for certain extensions deemed desirable by many implementors. Finally, a number of useful Content-Types are defined for general use by consenting user agents, notably message/partial, and message/external-body. Security Considerations Security issuesfollowing additional parameters arediscussed in Section 7.4.2 and in Appendix F. Implementors should pay special attention to the security implications of any mail content-types that can cause the remote executionmandatory: (1) NAME -- The name ofany actions intherecipient's environment. In such cases,file that contains thediscussion ofactual body data. (2) SITE -- A machine from which theapplication/postscript content-type in Section 7.4.2file mayserve asbe obtained, using the given protocol. This must be amodel for considering other content-types with remote execution capabilities. Borenstein & Freed [Page 65] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Authors' Addresses For more information,fully qualified domain name, not a nickname. (3) Before any data are retrieved, using FTP, theauthors of this document mayuser will generally need to becontacted via Internet mail: Nathaniel S. Borenstein First Virtual Holdings 25 Washington Avenue Morristown, NJ 07960 Email: nsb@nsb.fv.com Phone: +1 201 540 8967 Fax: +1 201 993 3032 Ned Freed Innosoft International, Inc. 250 West First Street Suite 240 Claremont, CA 91711 Phone: +1 909 624 7907 Fax: +1 909 621 5319 Email: ned@innosoft.com MIME isasked to provide aresult oflogin id and a password for thework ofmachine named by theInternet Engineering Task Force Working Group on Email Extensions. The chairman of that group, Greg Vaudreuil, maysite parameter. For security reasons, such an id and password are not specified as content-type parameters, but must bereached at: Gregory M. Vaudreuil Tigon Corporation 17060 Dallas Parkway Dallas Texas, 75248 214-733-2722 Email: gvaudre@cnri.reston.va.us Borenstein & Freed [Page 66]obtained from the user. In addition, the following parameters are optional: (1) DIRECTORY -- A directory from which the data named by NAME should be retrieved. (2) MODE -- A case-insensitive string indicating the mode to be used when retrieving the information. The valid values for access-type "TFTP" are "NETASCII", "OCTET", and "MAIL", as specified by the TFTP protocol [RFC- 783]. The valid values for access-type "FTP" are "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n" is a decimal integer, typically 8. These correspond to the representation types "A" "E" "I" and "L n" as specified by the FTP protocol [RFC-959]. Note that "BINARY" and "TENEX" are not valid values for MODE and that "OCTET" or "IMAGE" or "LOCAL8" should be used instead. IF MODE is not specified, the default value is "NETASCII" for TFTP and "ASCII" otherwise. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 65] Internet Draft MIME Part One November 1994Acknowledgements This document6.2.2.3.3. The 'anon-ftp' Access-Type The "anon-ftp" access-type is identical to theresult of"ftp" access type, except that thecollective effort ofuser need not be asked to provide alarge number of people, at several IETF meetings, on the IETF-SMTPname andIETF-822 mailing lists,password for the specified site. Instead, the ftp protocol will be used with login "anonymous" andelsewhere. Although any enumeration seems doomeda password that corresponds tosuffer from egregious omissions,thefollowing are amonguser's email address. 6.2.2.3.4. The 'local-file' Access-Type An access-type of "local-file" indicates that themany contributors to this effort: Harald Tveit Alvestrand Timo Lehtinen Randallactual body is accessible as a file on the local machine. Two additional parameters are defined for this access type: (1) NAME -- The name of the file that contains the actual body data. This parameter is mandatory for the "local- file" access-type. (2) SITE -- A domain specifier for a machine or set of machines that are known to have access to the data file. This optional parameter is used to describe the locality of reference for the data, that is, the site or sites at which the file is expected to be visible. Asterisks may be used for wildcard matching to a part of a domain name, such as "*.bellcore.com", to indicate a set of machines on which the data should be directly visible, while a single asterisk may be used to indicate a file that is expected to be universally available, e.g., via a global file system. 6.2.2.3.5. The 'mail-server' Access-Type The "mail-server" access-type indicates that the actual body is available from a mail server. Two additional parameters are defined for this access-type: (1) SERVER -- The email address of the mail server from which the actual body data can be obtained. This parameter is mandatory for the "mail-server" access- type. (2) SUBJECT -- The subject that is to be used in the mail that is sent to obtain the data. Note that keying mail Expires May 1995 [Page 66] Internet Draft MIME Part One November 1994 servers on Subject lines is NOT recommended, but such mail servers are known to exist. This is an optional parameter. Because mail servers accept a variety of syntaxes, some of which is multiline, the full command to be sent to a mail server is not included as a parameter on the content-type line. Instead, it is provided as the "phantom body" when the content-type is message/external-body and the access-type is mail-server. Note that MIME does not define a mail server syntax. Rather, it allows the inclusion of arbitrary mail server commands in the phantom body. Implementations must include the phantom body in the body of the message it sends to the mail server address to retrieve the relevant data. Unlike other access-types, mail-server access is asynchronous and will happen at an unpredictable time in the future. For this reason, it is important that there be a mechanism by which the returned data can be matched up with the original message/external-body entity. MIME mailservers must use the same Content-ID field on the returned message that was used in the original message/external-body entity, to facilitate such matching. 6.2.2.3.6. Examples and Further Explanations When the external-body mechanism is used in conjunction with the multipart/alternative Content-Type it extends the functionality of multipart/alternative to include the case where the same object is provided in the same format but via different accces mechanisms. When this is done the originator of the message must order the part first in terms of preferred formats and then by preferred access mechanisms. The recipient's viewer should then evaluate the list both in terms of format and access mechanisms. With the emerging possibility of very wide-area file systems, it becomes very hard to know in advance the set of machines where a file will and will not be accessible directly from the file system. Therefore it may make sense to provide both a file name, to be tried directly, and the name of one or more sites from which the file is known to be accessible. An Expires May 1995 [Page 67] Internet Draft MIME Part One November 1994 implementation can try to retrieve remote files using FTP or any other protocol, using anonymous file retrieval or prompting the user for the necessary name and password. If an external body is accessible via multiple mechanisms, the sender may include multiple parts of type message/external- body within an entity of type multipart/alternative. However, the external-body mechanism is not intended to be limited to file retrieval, as shown by the mail-server access-type. Beyond this, one can imagine, for example, using a video server for external references to video clips. The embedded message header fields which appear in the body of the message/external-body data must be used to declare the Content-type of the external body if it is anything other than plain US-ASCII text, since the external body does not have a header section to declare its type. Similarly, any Content- transfer-encoding other than "7bit" must also be declared here. Thus a complete message/external-body message, referring to a document in PostScript format, might look like this: From: Whomever To: Someone Date: Whenever Subject: whatever MIME-Version: 1.0 Message-ID: <id1@host.com> Content-Type: multipart/alternative; boundary=42 Content-ID: <id001@guppylake.bellcore.com> --42 Content-Type: message/external-body; name="BodyFormats.ps"; site="thumper.bellcore.com"; mode="image"; access-type=ANON-FTP; directory="pub"; expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" Content-type: application/postscript Content-ID: <id42@guppylake.bellcore.com> --42 Content-Type: message/external-body; access-type=local-file; name="/u/nsb/writing/rfcs/RFC-MIME.ps"; site="thumper.bellcore.com"; expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" Expires May 1995 [Page 68] Internet Draft MIME Part One November 1994 Content-type: application/postscript Content-ID: <id42@guppylake.bellcore.com> --42 Content-Type: message/external-body; access-type=mail-server server="listserv@bogus.bitnet"; expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" Content-type: application/postscript Content-ID: <id42@guppylake.bellcore.com> get RFC-MIME.DOC --42-- Note that in the above examples, the default Content- transfer-encoding of "7bit" is assumed for the external postscript data. Like the message/partial type, the message/external-body type is intended to be transparent, that is, to convey the data type in the external body rather than to convey a message with a body of that type. Thus the headers on the outer and inner parts must be merged using the same rules as for message/partial. In particular, this means that the Content- type header is overridden, but the From and Subject headers are preserved. Note that since the external bodies are not transported as mail, they need not conform to the 7-bit and line length requirements, but might in fact be binary files. Thus a Content-Transfer-Encoding is not generally necessary, though it is permitted. Note that the body of a message of type "message/external- body" is governed by the basic syntax for an RFC 822 message. In particular, anything before the first consecutive pair of CRLFs is header information, while anything after it is body information, which is ignored for most access-types. Expires May 1995 [Page 69] Internet Draft MIME Part One November 1994 6.2.2.4. Other Message Subtypes MIME implementations must in general treat unrecognized subtypes of message as being equivalent to "application/octet-stream". Expires May 1995 [Page 70] Internet Draft MIME Part One November 1994 7. Experimental Content-Type Values A Content-Type value beginning with the characters "X-" is a private value, to be used by consenting mail systems by mutual agreement. Any format without a rigorous and public definition must be named with an "X-" prefix, and publicly specified values shall never begin with "X-". (Older versions of the widely used Andrew system use the "X-BE2" name, so new systems should probably choose a different name.) In general, the use of "X-" top-level types is strongly discouraged. Implementors should invent subtypes of the existing types whenever possible. The invention of new types is intended to be restricted primarily to the development of new media types for email, such as digital odors or holography, and not for new data formats in general. In many cases, a subtype of application will be more appropriate than a new top-level type. Expires May 1995 [Page 71] Internet Draft MIME Part One November 1994 8. Summary Using the MIME-Version, Content-Type, and Content-Transfer- Encoding header fields, it is possible to include, in a standardized way, arbitrary types of data objects with RFC 822 conformant mail messages. No restrictions imposed by either RFC 821 or RFC 822 are violated, and care has been taken to avoid problems caused by additional restrictions imposed by the characteristics of some Internet mail transport mechanisms (see Appendix B). The "multipart" and "message" Content-Types allow mixing and hierarchical structuring of objects of different types in a single message. Further Content-Types provide a standardized mechanism for tagging messages or body parts as audio, image, or several other kinds of data. A distinguished parameter syntax allows further specification of data format details, particularly the specification of alternate character sets. Additional optional header fields provide mechanisms for certain extensions deemed desirable by many implementors. Finally, a number of useful Content-Types are defined for general use by consenting user agents, notably message/partial, and message/external-body. Expires May 1995 [Page 72] Internet Draft MIME Part One November 1994 9. Security Considerations Security issues are discussed in the context of the application/postscript type and in Appendix E. Implementors should pay special attention to the security implications of any mail content-types that can cause the remote execution of any actions in the recipient's environment. In such cases, the discussion of the application/postscript type may serve as a model for considering other content-types with remote execution capabilities. Expires May 1995 [Page 73] Internet Draft MIME Part One November 1994 10. Authors' Addresses For more information, the authors of this document may be contacted via Internet mail: Nathaniel S. Borenstein First Virtual Holdings 25 Washington Avenue Morristown, NJ 07960 USA Email: nsb@nsb.fv.com Phone: +1 201 540 8967 Fax: +1 201 993 3032 Ned Freed Innosoft International, Inc. 1050 East Garvey Avenue South West Covina, CA 91790 USA Email: ned@innosoft.com Phone: +1 818 919 3600 Fax: +1 818919 3614 MIME is a result of the work of the Internet Engineering Task Force Working Group on Email Extensions. The chairman of that group, Greg Vaudreuil, may be reached at: Gregory M. Vaudreuil Tigon Corporation 17060 Dallas Parkway Dallas Texas, 75248 Email: greg.vaudreuil@ons.octel.com Phone: +1 214 733 2722 Expires May 1995 [Page 74] Internet Draft MIME Part One November 1994 11. Acknowledgements This document is the result of the collective effort of a large number of people, at several IETF meetings, on the IETF-SMTP and IETF-822 mailing lists, and elsewhere. Although any enumeration seems doomed to suffer from egregious omissions, the following are among the many contributors to this effort: Harald Tveit Alvestrand Marc Andreessen Randall AtkinsonJohn R. MacMillanBob Braden Philippe BrandonRick McGowanBrian Capouch Kevin CarossoLeo MclaughlinUhhyung ChoiGoli Montaser-KohsariPeter Clitherow Dave Collier-Brown Cristian ConstantinofKeith MooreJohn Coonrod Mark CrispinTom MooreDave CrockerErik NaggumStephen Crocker Terry CrowleyMark NeedlemanWalt DanielsJohn NoerenbergJim Davis Frank DawsonMats OhrmanAxel Deininger Hitoshi DoiJulian OnionsKevin DonnellyMichael PattonSteve Dorner Keith EdwardsDavid J. PepperChris EichBlake C. RamsdellDana S. Emery Johnny ErikssonLuc RooijakkersCraig EverhartMarshall T. RosePatrikF.ltstr.m Jonathan RosenbergFaltstrom Erik E. FairJan RynningRoger FajmanHarri SalminenAlain FontaineMichael SandersonMartin Forssen James M. GalvinMasahiro SekiguchiStephen Gildea Philip GladstoneMark ShermanThomas Gordon Keld Simonsen Terry Gray Phill GrossBob SmartJames HamiltonPeter Speck Steve Hardcastle-Kille Henry SpencerDavid HerronEinar StefferudMark Horton Bruce HowardMichael SteinBill JanssenKlaus SteinbergerOlleJ.rnefors Peter SvanbergJarnefors Risto KankkunenJames ThompsonPhil KarnSteve UhlerAlan KatzStuart VanceTim KehresErik van der Poel Borenstein & Freed [Page 67] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994Neil KatinGuido van RossumSteve Kille Kyuho KimPeter VanderbiltAnders KlemetsGreg VaudreuilJohn KlensinEd VielmettiValdis KletniekRyan WaldronJim KnowlesWally WedelStev KnowlesSven-Ove WestbergBob KummerfeldBrian WideenPekka KytolaaksoJohn WobusStellanLagerstr.m Glenn WrightLagerstrom Vincent LauRayan ZachariassenTimo Lehtinen Donald LindsayDavid Zimmerman Marc Andreessen Bob Braden Brian Capouch Peter Clitherow Dave Collier-Brown John Coonrod Stephen Crocker Jim Davis Axel Deininger Dana S Emery Martin Forssen Stephen Gildea Terry Gray Mark HortonWarner Losh Carlyn Lowery Laurence Lundblade Charles Lynn John R. MacMillan Larry Masinter Rick McGowan Michael J. McInerny Expires May 1995 [Page 75] Internet Draft MIME Part One November 1994 Leo Mclaughlin Goli Montaser-Kohsari Keith Moore Tom Moore Erik Naggum Mark Needleman John Noerenberg Mats Ohrman Julian Onions Michael Patton David J. Pepper Erik van der Poel Jon Postel Blake C. Ramsdell Christer Romson Luc Rooijakkers Marshall T. Rose Jonathan Rosenberg Guido van Rossum Jan Rynning Harri Salminen Michael Sanderson Yutaka Sato Markku Savela Richard Alan Schafer Masahiro Sekiguchi Mark Sherman Bob Smart Peter Speck Henry Spencer Einar Stefferud Michael Stein Klaus Steinberger Peter Svanberg James Thompson Steve Uhler Stuart Vance Peter Vanderbilt Greg Vaudreuil Ed Vielmetti Larry W. Virden Ryan Waldron Rhys Weatherly Jay Weber Dave Wecker Wally Wedel Sven-Ove Westberg Brian Wideen John Wobus Glenn Wright Rayan Zachariassen David Zimmerman The authors apologize for any omissions from this list, whichare certainly unintentional. Borenstein & Freed [Page 68] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Appendix A -- Minimal MIME-Conformance The mechanisms described in this document are open-ended. It is definitely not expected that all implementations will support all of the Content-Types described, nor that they will all share the same extensions. In order to promote interoperability, however, it is useful to define the concept of "MIME-conformance" to define a certain level of implementation that allows the useful interworking of messages with content that differs from US ASCII text. In this section, we specify the requirements for such conformance. A mail user agent that is MIME-conformant MUST: 1. Always generate a "MIME-Version: 1.0" header field. 2. Recognize the Content-Transfer-Encoding header field, and decode all received data encoded with either the quoted-printable or base64 implementations. Encode any data sent that is not in seven-bit mail-ready representation using one of these transformations and include the appropriate Content-Transfer-Encoding header field, unless the underlying transport mechanism supports non-seven-bit data, as SMTP does not. 3. Recognize and interpret the Content-Type header field, and avoid showing users raw data with a Content-Type field other than text. Be able to send at least text/plain messages, with the character set specified as a parameter if it is not US-ASCII. 4. Explicitly handle the following Content-Type values, to at least the following extents: Text: -- Recognize and display "text" mail with the character set "US-ASCII." -- Recognize other character sets at least to the extent of being able to inform the user about what character set the message uses. Borenstein & Freed [Page 69]are certainly unintentional. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 76] Internet Draft MIME Part One November 1994 Appendix A --Recognize the "ISO-8859-*" character sets to the extentMIME Conformance The mechanisms described in this document are open-ended. It is definitely not expected that all implementations will support all ofbeing able to display those charactersthe Content-Types described, nor thatare common to ISO-8859-* and US-ASCII, namelythey will allcharacters represented by octet values 0-127. -- For unrecognized subtypes, show or offer to showshare theusersame extensions. In order to promote interoperability, however, it is useful to define the"raw" versionconcept ofthe data after conversion"MIME-conformance" to define a certain level of implementation that allows the useful interworking of messages with content that differs fromcanonical form to local form. Message: -- Recognize and display at leastUS-ASCII text. In this section, we specify theprimary (822) encapsulation inrequirements for sucha way as to preserve any recursive structure,conformance. A mail user agent thatis, displaying or offering to display the encapsulated data in accordance with its Content-type. Multipart: --is MIME-conformant MUST: (1) Always generate a "MIME-Version: 1.0" header field. (2) Recognize theprimary (mixed) subtype. Display all relevant information on the message level and the body partContent-Transfer-Encoding headerlevelfield andthen displaydecode all received data encoded with either the quoted-printable oroffer to display eachbase64 implementations. Any non-7- bit data that is sent without encoding must be properly labelled with a content-transfer-encoding of 8bit or binary, as appropriate. If thebody parts individually. --underlying transport does not support 8bit or binary (as SMTP [RFC821] does not), the snder is required to both encode and label data using an appropriate Content-Transfer-Encoding such as quoted-printable or base64. (3) Recognize and interpret the"alternative" subtype,Content-Type header field, and avoid showingthe user redundant parts of multipart/alternative mail. -- Recognize the "multipart/digest" subtype, specifically using "message/rfc822" ratherusers raw data with a Content-Type field other than"text/plain" astext. Be able to send at least text/plain messages, with thedefault content-type for encapsulations inside "multipart/digest" entities. -- Treat any unrecognized subtypescharacter set specified as a parameter ifthey were "mixed". Application: -- Offerit is not US-ASCII. (4) Explicitly handle theabilityfollowing Content-Type values, toremove either ofat least thetwo types of Content-Transfer- Encoding defined in this documentfollowing extents: Text: -- Recognize andputdisplay "text" mail with theresulting information in a user file. Borenstein & Freed [Page 70]character set "US-ASCII." Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 77] Internet Draft MIME Part One November 19945. Upon encountering any unrecognized Content- Type, an implementation must treat it as if it had a Content-Type of "application/octet-stream" with no parameter sub-arguments. How such data are handled is up-- Recognize other character sets at least toan implementation, but likely options for handling such unrecognized data include offeringtheuserextent of being able towrite it into a file (decoded from its mail transport format) or offeringinform the userto name a program to whichabout what character set thedecoded data should be passed as input. Unrecognized predefined types, which in a MIME- conformant mailer might still include audio, image, or video, should also be treated in this way. A user agent that meetsmessage uses. -- Recognize theabove conditions is said"ISO-8859-*" character sets tobe MIME-conformant. The meaningthe extent ofthis phrase isbeing able to display those characters thatit is assumedare common tobe "safe"ISO-8859-* and US-ASCII, namely all characters represented by octet values 0-127. -- For unrecognized subtypes in a known character set, show or offer tosend virtually any kindshow the user the "raw" version ofproperly-markedthe datato usersafter conversion ofsuch mail systems, because such systems will at least be able to treatthedatacontent from canonical form to local form. -- Treat material in an unknown character set asundifferentiated binary, and will not simply splashif itontowere "application/octet-stream". Image, audio, and video: -- At a minumum provide facilities to Treat any unrecognized subtypes as if they were "application/octet-stream". Application: -- Offer thescreenability to remove either ofunsuspecting users. There is another sensethe quoted- printable or base64 encodings defined inwhich it is always "safe" to send datathis document if they were used and put the resulting information in aformat that is MIME-conformant, which is that such data will not break or be broken by any known systems that are conformant with RFC 821user file. Multipart: -- Recognize the mixed subtype. Display all relevant information on the message level andRFC 822. User agents that are MIME-conformant havetheadditional guarantee thatbody part header level and then display or offer to display each of the body parts individually. -- Recognize the "alternative" subtype, and avoid showing the userwill not be shown data that were never intended to be viewed as text. Borenstein & Freed [Page 71]redundant parts of multipart/alternative mail. -- Recognize the "multipart/digest" subtype, specifically using "message/rfc822" rather than "text/plain" as the default content-type for encapsulations inside "multipart/digest" entities. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 78] Internet Draft MIME Part One November 1994Appendix B--General Guidelines For Sending Email Data Internet email is not a perfect, homogeneous system. Mail may become corrupted at several stages in its travel to a final destination. Specifically, email sent throughout the Internet may travel across many networking technologies. Many networkingTreat any unrecognized subtypes as if they were "mixed". Message: -- Recognize andmail technologies do not support the full functionality possible indisplay at least theSMTP transport environment. Mail traversing these systems is likely to be modifiedprimary (RFC822) encapsulation in such a way as to preserve any recursive structure, thatit can be transported. There exist many widely-deployed non-conformant MTAs in the Internet. These MTAs, speaking the SMTP protocol, alter messages on the flyis, displaying or offering totake advantage ofdisplay theinternalencapsulated datastructure of the hostsin accordance with its Content-type. -- Treat any unrecognized subtypes as if theyare implemented on, or are just plain broken. The following guidelines may be useful to anyone devisingwere "application/octet-stream". (5) Upon encountering any unrecognized Content-Type, an implementation must treat it as if it had adata format (Content-Type) that will survive the widest rangeContent- Type ofnetworking technologies and known broken MTAs unscathed. Note that anything encoded in the base64 encoding will satisfy these rules, but that some well-known mechanisms, notably the UNIX uuencode facility, will not. Note also that anything encoded in the Quoted-Printable encoding will survive most gateways intact, but possibly not some gateways"application/octet-stream" with no parameter sub-arguments. How such data are handled is up tosystems that use the EBCDIC character set. (1) Under some circumstances the encoding usedan implementation, but likely options for handling such unrecognized datamay change as part of normal gateway orinclude offering the useragent operation. In particular, conversion from base64toquoted-printable and vice versa may be necessary. This may result in the confusion of CRLF sequences with line breaks in text bodies. As such,write it into a file (decoded from its mail transport format) or offering thepersistence of CRLF as something other thanuser to name aline break must not be relied on. (2) Many systems may electprogram torepresent and store text data using local newline conventions. Local newline conventions may not matchwhich theRFC822 CRLF convention -- systems are knowndecoded data should be passed as input. A user agent thatuse plain CR, plain LF, CRLF, or counted records.meets the above conditions is said to be MIME-conformant. Theresultmeaning of this phrase is thatisolated CR and LF characters are not well tolerated in general; they may be lost or convertedit is assumed todelimiters on some systems, and hence must not be relied on. Borenstein & Freed [Page 72] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 (3) TAB (HT) characters may be misinterpreted or maybeautomatically converted"safe" tovariable numberssend virtually any kind ofspaces. This is unavoidable in some environments, notably those not based on the ASCII character set. Such conversion is STRONGLY DISCOURAGED, but it may occur,properly- marked data to users of such mail systems, because such systems will at least be able to treat the data as undifferentiated binary, andmail formats mustwill notrely onsimply splash it onto thepersistencescreen ofTAB (HT) characters. (4) Lines longer than 76 characters may be wrapped or truncated in some environments. Line wrapping and line truncation are STRONGLY DISCOURAGED, but unavoidableunsuspecting users. There is another sense insome cases. Applicationswhichrequire long lines must somehow differentiate between soft and hard line breaks. (A simple way to do thisit is always "safe" touse the quoted-printable encoding.) (5) Trailing "white space" characters (SPACE, TAB (HT)) onsend data in aline mayformat that is MIME-conformant, which is that such data will not break or bediscardedbroken bysome transport agents, while other transport agents may pad linesany known systems that are conformant withthese characters soRFC 821 and RFC 822. User agents thatall lines in a mail fileareof equal length. The persistence of trailing white space, therefore, mustMIME-conformant have the additional guarantee that the user will not berelied on. (6) Many mail domains use variations on the ASCII character set, or use character sets suchshown data that were never intended to be viewed asEBCDIC which contain most buttext. Expires May 1995 [Page 79] Internet Draft MIME Part One November 1994 Appendix B -- Guidelines For Sending Email Data Internet email is notall ofa perfect, homogeneous system. Mail may become corrupted at several stages in its travel to a final destination. Specifically, email sent throughout theUS-ASCII characters. The correct translation of charactersInternet may travel across many networking technologies. Many networking and mail technologies do not support the full functionality possible in the"invariant" set cannot be depended on across character converting gateways. For example, this situationSMTP transport environment. Mail traversing these systems is likely to be modified in such aproblem when sending uuencoded information across BITNET, an EBCDIC system. Similar problemsway that it canoccur without crossing a gateway, sincebe transported. There exist manyInternet hosts use character sets other than ASCII internally. The definition of Printable Strings in X.400 adds further restrictionswidely-deployed non-conformant MTAs incertain special cases. In particular,theonly characters that are known to be consistent across all gateways areInternet. These MTAs, speaking the73 characters that correspond toSMTP protocol, alter messages on theupper and lower case letters A-Z and a-z,fly to take advantage of the10 digits 0-9, andinternal data structure of the hosts they are implemented on, or are just plain broken. The followingeleven special characters: "'" (ASCII code 39) "(" (ASCII code 40) ")" (ASCII code 41) Borenstein & Freed [Page 73] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 "+" (ASCII code 43) "," (ASCII code 44) "-" (ASCII code 45) "." (ASCII code 46) "/" (ASCII code 47) ":" (ASCII code 58) "=" (ASCII code 61) "?" (ASCII code 63) A maximally portable mail representation, such as the base64 encoding, will confine itselfguidelines may be useful torelatively short linesanyone devising a data format (Content-Type) that will survive the widest range oftextnetworking technologies and known broken MTAs unscathed. Note that anything encoded inwhichtheonly meaningful characters are taken from this set of 73 characters. (7) Some mail transport agentsbase64 encoding will satisfy these rules, but that some well-known mechanisms, notably the UNIX uuencode facility, willcorrupt datanot. Note also thatincludes certain literal strings. In particular, a period (".") alone on a line is known to be corrupted byanything encoded in the Quoted-Printable encoding will survive most gateways intact, but possibly not some(incorrect) SMTP implementations, and a linegateways to systems thatstarts withuse thefive characters "From " (the fifthEBCDIC characteris a SPACE) are commonly corrupted as well. A careful composition agent can prevent these corruptions by encodingset. (1) Under some circumstances the encoding used for data(e.g.,may change as part of normal gateway or user agent operation. In particular, conversion from base64 to quoted-printable and vice versa may be necessary. This may result in thequoted- printable encoding, "=46rom " in placeconfusion of"From " atCRLF sequences with line breaks in text bodies. As such, thestartpersistence of CRLF as something other than aline,line break must not be relied on. (2) Many systems may elect to represent and"=2E" in place of "." alone on a line. Please note thatstore text data using local newline conventions. Local newline conventions may not match theabove list is NOT a list of recommended practices for MTAs. RFC 821 MTAsRFC822 CRLF convention -- systems areprohibited from altering the character of white spaceknown that use plain CR, plain LF, CRLF, orwrapping long lines. These BADcounted records. The result is that isolated CR andillegal practicesLF characters areknownnot well tolerated in general; they may Expires May 1995 [Page 80] Internet Draft MIME Part One November 1994 be lost or converted tooccurdelimiters onestablished networks,some systems, andimplementations shouldhence must not berobustrelied on. (3) TAB (HT) characters may be misinterpreted or may be automatically converted to variable numbers of spaces. This is unavoidable indealing withsome environments, notably those not based on thebad effects they can cause. Borenstein & Freed [Page 74] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Appendix C -- A Complex Multipart Example What followsUS-ASCII character set. Such conversion is STRONGLY DISCOURAGED, but it may occur, and mail formats must not rely on theoutlinepersistence ofa complex multipart message. This message has five parts toTAB (HT) characters. (4) Lines longer than 76 characters may bedisplayed serially: two introductory plain text parts, an embedded multipart message, a richtext part, and a closing encapsulated text messagewrapped or truncated ina non-ASCII character set. The embedded multipart message has two parts to be displayedsome environments. Line wrapping and line truncation are STRONGLY DISCOURAGED, but unavoidable inparallel, a picturesome cases. Applications which require long lines must somehow differentiate between soft andan audio fragment. MIME-Version: 1.0 From: Nathaniel Borenstein <nsb@bellcore.com> To: Ned Freed <ned@innosoft.com> Subject: A multipart example Content-Type: multipart/mixed; boundary=unique-boundary-1 Thishard line breaks. (A simple way to do this is to use thepreamble area ofquoted-printable encoding.) (5) Trailing "white space" characters (SPACE, TAB (HT)) on amultipart message. Mail readersline may be discarded by some transport agents, while other transport agents may pad lines with these characters so thatunderstand multipart format should ignore this preamble. If you are reading this text, you might want to consider changing toall lines in a mailreader that understands how to properly display multipart messages. --unique-boundary-1 ...Some text appears here... [Note thatfile are of equal length. The persistence of trailing white space, therefore, must not be relied on. (6) Many mail domains use variations on thepreceding blank line means no header fields were given and this is text, with charset US ASCII. It could have been done with explicit typingUS-ASCII character set, or use character sets such asin the next part.] --unique-boundary-1 Content-type: text/plain; charset=US-ASCII This could have been partEBCDIC which contain most but not all of theprevious part, but illustrates explicit versus implicit typingUS-ASCII characters. The correct translation ofbody parts. --unique-boundary-1 Content-Type: multipart/parallel; boundary=unique-boundary-2 --unique-boundary-2 Borenstein & Freed [Page 75] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Content-Type: audio/basic Content-Transfer-Encoding: base64 ... base64-encoded 8000 Hz single-channel mu-law-format audio data goes here.... --unique-boundary-2 Content-Type: image/gif Content-Transfer-Encoding: base64 ... base64-encoded image data goes here.... --unique-boundary-2-- --unique-boundary-1 Content-type: text/richtext This is <bold><italic>richtext.</italic></bold> <smaller>as defined in RFC 1341</smaller> <nl><nl>Isn't it <bigger><bigger>cool?</bigger></bigger> --unique-boundary-1 Content-Type: message/rfc822 From: (mailbox in US-ASCII) To: (addresscharacters not inUS-ASCII) Subject: (subjectthe "invariant" set cannot be depended on across character converting gateways. For example, this situation is a problem when sending uuencoded information across BITNET, an EBCDIC system. Similar problems can occur without crossing a gateway, since many Internet hosts use character sets other than US- ASCII internally. The definition of Printable Strings inUS-ASCII) Content-Type: Text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: Quoted-printable ... Additional textX.400 adds further restrictions inISO-8859-1 goes here ... --unique-boundary-1-- Borenstein & Freed [Page 76] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Appendix D -- Collected Grammar This appendix containscertain special cases. In particular, thecomplete BNF grammar foronly characters that are known to be consistent across all gateways are thesyntax specified by this document. By itself, however, this grammar is incomplete. It refers to several entities73 characters thatare defined by RFC 822. Rather than reproduce those definitions here,correspond to the upper andrisk unintentional differences betweenlower case letters A-Z and a-z, thetwo, this document simply refers10 digits 0-9, and thereaderfollowing eleven special characters: "'" (US-ASCII decimal value 39) Expires May 1995 [Page 81] Internet Draft MIME Part One November 1994 "(" (US-ASCII decimal value 40) ")" (US-ASCII decimal value 41) "+" (US-ASCII decimal value 43) "," (US-ASCII decimal value 44) "-" (US-ASCII decimal value 45) "." (US-ASCII decimal value 46) "/" (US-ASCII decimal value 47) ":" (US-ASCII decimal value 58) "=" (US-ASCII decimal value 61) "?" (US-ASCII decimal value 63) A maximally portable mail representation, such as the base64 encoding, will confine itself toRFC 822 forrelatively short lines of text in which theremaining definitions. Whereveronly meaningful characters are taken from this set of 73 characters. (7) Some mail transport agents will corrupt data that includes certain literal strings. In particular, atermperiod (".") alone on a line isundefined, it refersknown to be corrupted by some (incorrect) SMTP implementations, and a line that starts with theRFC 822 definition. application-subtype := ("octet-stream" *stream-param) / "postscript" / extension-token application-type := "application" "/" application-subtype attribute := token ; case-insensitive atype := "ftp" / "anon-ftp" / "tftp" / "local-file" / "afs" / "mail-server" / extension-token ; Case-insensitive audio-type := "audio" "/" ("basic" / extension-token) body-part := <"message"five characters "From " (the fifth character is a SPACE) are commonly corrupted asdefinedwell. A careful composition agent can prevent these corruptions by encoding the data (e.g., inRFC 822, with all header fields optional, and withthespecified delimiter not occurring anywherequoted- printable encoding, "=46rom " in place of "From " at themessage body, eitherstart of a line, and "=2E" in place of "." alone on aline by itself or asline. Please note that the above list is NOT asubstring anywhere.> NOTE: In certain transport enclaves,list of recommended practices for MTAs. RFC822 restrictions such as821 MTAs are prohibited from altering theone that limits bodiescharacter of white space or wrapping long lines. These BAD and invalid practices are known toprintable ASCII characters may notoccur on established networks, and implementations should be robust inforce. (That is,dealing with thetransport domains may resemble standardbad effects they can cause. Expires May 1995 [Page 82] Internetmail transport as specified in RFC821Draft MIME Part One November 1994 Appendix C -- A Complex Multipart Example What follows is the outline of a complex multipart message. This message has five parts to be displayed serially: two introductory plain text parts, an embedded multipart message, a text/enriched part, andassumed by RFC822, but without certain restrictions.)a closing encapsulated text message in a non-ASCII character set. Therelaxation of these restrictions shouldembedded multipart message has two parts to beconstrued as locally extending the definition of bodies, fordisplayed in parallel, a picture and an audio fragment. MIME-Version: 1.0 From: Nathaniel Borenstein <nsb@bellcore.com> To: Ned Freed <ned@innosoft.com> Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) Subject: A multipart exampleto include octets outsideContent-Type: multipart/mixed; boundary=unique-boundary-1 This is the preamble area ofthe ASCII range, as long as these extensionsa multipart message. Mail readers that understand multipart format should ignore this preamble. If you aresupported byreading this text, you might want to consider changing to a mail reader that understands how to properly display multipart messages. --unique-boundary-1 ... Some text appears here ... [Note that thetransportblank between the boundary andadequately documented intheContent-Transfer-Encoding header field. However,start of the text inno event are headers (either message headers or body-this partheaders) allowed to contain anything other than Borenstein & Freed [Page 77] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 ASCII characters. boundary := 0*69<bchars> bcharsnospace bchars := bcharsnospace / " " bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / "_" / "," / "-" / "." / "/" / ":" / "=" / "?" charset := "us-ascii" / "iso-8859-1" / "iso-8859-2" / "iso- 8859-3" / "iso-8859-4" / "iso-8859-5" / "iso-8859-6" / "iso- 8859-7" / "iso-8859-8" / "iso-8859-9" / extension-token ; case insensitive close-delimiter := "--" boundary "--" CRLF ; Again, no space by "--", content := "Content-Type" ":" type "/" subtype *(";" parameter) ; case-insensitive matching of type and subtype delimiter := "--" boundary CRLF ; taken from Content-Type field. ; There must bemeans nospace ; between "--"header fields were given andboundary. description := "Content-Description" ":" *text discard-text := *(*text CRLF) encapsulation := delimiter body-part CRLF encoding := "Content-Transfer-Encoding" ":" mechanism epilogue := discard-text ; to be ignored upon receipt. extension-token := x-token / iana-token external-param := (";" "access-type" "=" atype) / (";" "expiration" "=" date-time) Borenstein & Freed [Page 78]this is text in the US-ASCII character set. It could have been done with explicit typing as in the next part.] --unique-boundary-1 Content-type: text/plain; charset=US-ASCII This could have been part of the previous part, but illustrates explicit versus implicit typing of body parts. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 83] Internet Draft MIME Part One November 1994; Note that date-time is quoted / (";" "size" "=" 1*DIGIT) / (";" "permission" "=" ("read" / "read- write")) ; Permission--unique-boundary-1 Content-Type: multipart/parallel; boundary=unique-boundary-2 --unique-boundary-2 Content-Type: audio/basic Content-Transfer-Encoding: base64 ... base64-encoded 8000 Hz single-channel mu-law-format audio data goes here ... --unique-boundary-2 Content-Type: image/gif Content-Transfer-Encoding: base64 ... base64-encoded image data goes here ... --unique-boundary-2-- --unique-boundary-1 Content-type: text/enriched This iscase-insensitive / (";" "name" "=" value) / (";" "site" "=" value) / (";" "dir" "=" value) / (";" "mode" "=" value) / (";" "server" "=" value) / (";" "subject" "=" value) ; access-type required; others required based on access-type iana-token := <a publicly-defined extension token, registered with IANA, as specified<bold><italic>enriched.</italic></bold> <smaller>as defined in RFC 1563</smaller> Isn't it <bigger><bigger>cool?</bigger></bigger> --unique-boundary-1 Content-Type: message/rfc822 From: (mailbox in US-ASCII) To: (address in US-ASCII) Subject: (subject in US-ASCII) Content-Type: Text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: Quoted-printable ... Additional text in ISO-8859-1 goes here ... --unique-boundary-1-- Expires May 1995 [Page 84] Internet Draft MIME Part One November 1994 Appendix D -- Collected Grammar This appendixE> id := "Content-ID" ":" msg-id image-type := "image" "/" ("gif" / "jpeg" / extension-token) mechanism := "7bit" ; case-insensitive / "quoted-printable" / "base64" / "8bit" / "binary" / x-token message-subtype := "rfc822" / "partial" 2#3partial-param / "external-body" 1*external-param / extension-token message-typecontains the complete BNF grammar for all the syntax specified by this document. By itself, however, this grammar is incomplete. It refers to several entities that are defined by RFC 822. Rather than reproduce those definitions here, and risk unintentional differences between the two, this document simply refers the reader to RFC 822 for the remaining definitions. Wherever a term is undefined, it refers to the RFC 822 definition. attribute :="message" "/" message-subtype multipart-bodytoken boundary :=preamble 1*encapsulation close-delimiter epilogue multipart-subtype0*69<bchars> bcharsnospace bchars :="mixed" / "parallel" / "digest" / "alternative"bcharsnospace /extension-token multipart-type := "multipart" "/" multipart-subtype ";" "boundary" "=" boundary Borenstein & Freed [Page 79] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 octet" " bcharsnospace :="=" 2(DIGIT / "A" / "B"DIGIT /"C"ALPHA /"D""'" /"E""(" /"F") ; octet must be used for characters > 127, =, SPACE, or TAB, ; and is recommended for any characters not listed in ; Appendix B as "mail-safe". padding := "0"")" /"1""+" /"2""_" /"3""," /"4""-" /"5""." /"6""/" /"7" parameter := attribute "=" value partial-param := (";" "id" "=" value)":" /(";" "number""="1*DIGIT)/(";" "total" "=" 1*DIGIT) ; id & number required; total required for last part preamble := discard-text ; to be ignored upon receipt. ptext"?" body-part :=octet / <any ASCII character except "=", SPACE, or TAB> ; characters not listed<"message" as"mail-safe"defined inAppendix B ; are alsoRFC 822, with all header fields optional, notrecommended. quoted-printable := ([*(ptext / SPACE / TAB) ptext] ["="] CRLF) ; Maximum line lengthstarting with the specified dash-boundary, and with the delimiter not occurring anywhere in the message body. Note that the semantics of76 characters excluding CRLF stream-param := (";" "type" "=" value) / (";" "padding" "=" padding) subtype := token ; case-insensitive text-subtype := "plain" / extension-token text-type := "text" "/" text-subtype [";" "charset" "=" charset] token := 1*<any (ASCII) CHAR except SPACE, CTLs, or tspecials> tspecialsa part differ from the semantics of a message, as described in the text.> close-delimiter :="(" / ")" / "<" / ">" / "@" / ","CRLF dash-boundary "--" composite-type := "message" /";""multipart" / extension-token content := "Content-Type" ":"/ "\" / <"> /type "/"/ "[" / "]" / "?" / "=" Borenstein & Freed [Page 80]subtype *(";" parameter) ; Matching of type and subtype is ; ALWAYS case-insensitive dash-boundary := "--" boundary ; boundary taken from Content-Type ; field. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 85] Internet Draft MIME Part One November 1994 delimiter := CRLF dash-boundary description := "Content-Description" ":" *text discard-text := *(*text CRLF) ;MustTo bein quoted-string, ; to use within parameter values typeignored upon receipt. discrete-type :="application" / "audio" ; case- insensitive"text" / "image" /"message" / "multipart" / "text""audio" / "video" / "application" / extension-token; All values case-insensitive valueencapsulation :=token / quoted-string versiondelimiter [*LWSP-char] CRLF body-part encoding :="MIME-Version""Content-Transfer-Encoding" ":"1*DIGIT "." 1*DIGIT video-typemechanism epilogue :="video" "/" ("mpeg"discard-text extension-token := iana-token / ietf-token /extension-token)x-token iana-token :=<The two characters "X-" or "x-" followed, with no intervening white space, by any token> Borenstein & Freed [Page 81] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Appendix E -- IANA Registration Procedures MIME has been carefully designed to have extensible mechanisms, and it is expected that the set of content- type/subtype pairs and their associated parameters will grow significantly with time. Several other MIME fields, notably character set names, access-type parameters for the message/external-body type, and possibly even Content- Transfer-Encoding values, are likely to have new values defined over time. In order to ensure that the set of such values is developed in an orderly, well-specified, and public manner, MIME defines a registration process which uses the Internet Assigned Numbers Authority (IANA) as a central registry for such values. In general, parameters<a publicly-defined extension token, registered with IANA, as specified in RFC REG [REF-REG]> ietf-token := <a publicly-defined extension token, initially registered with IANA and subsequently standardized by thecontent-type header field areIETF> id := "Content-ID" ":" msg-id mechanism := "7bit" / "8bit" / "binary" / "quoted-printable" / "base64" / ietf-token / x-token multipart-body := preamble dash-boundary [*LWSP-char] CRLF body-part *encapsulation close-delimiter [*LWSP-char] CRLF epilogue octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") ; Octet must be usedto convey supplemental informationforvarious content types,characters > 127, =, ; SPACE, or TAB, andtheir useisdefined when the content-type and subtype are defined. New parameters should not be defined as a way to introduce new functionality. In order to simplify and standardize the registration process, this appendix gives templatesrecommended forthe registration of new values with IANA. Each of these is given in the form of an email message template, to be filledany ; characters not listed inby the registering party. E.1 Registration of New Content-type/subtype Values Note that MIME is generally expected to be extended by subtypes. If a new fundamental top-level type is needed, its specification must be publishedAppendix B asan RFC or submitted in a form suitable to become an RFC, and be subject to the; "mail-safe". Expires May 1995 [Page 86] Internetstandards process. To: IANA@isi.edu Subject: Registration of new MIME content-type/subtypeDraft MIMEtype name: (If the above isPart One November 1994 parameter := attribute "=" value preamble := discard-text ptext := octet / safe-char quoted-printable := ([*(ptext / SPACE / TAB) ptext] ["="] CRLF) ; Maximum line length of 76 characters ; excluding CRLF safe-char := <any US-ASCII character except "=", SPACE, or TAB> ; Characters not listed as "mail-safe" in ; Appendix B are also notan existing top-level MIME type, please explain why an existing type cannot be used.) MIMErecommended. subtypename: Borenstein & Freed [Page 82] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Required parameters: Optional parameters: Encoding considerations: Security considerations: Published specification: (The published specification must be an Internet RFC:= extension-token token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, orRFC-to-be if a new top-level type is being defined, and musttspecials> tspecials := "(" / ")" / "<" / ">" / "@" / "," / ";" / ":" / "\" / <"> "/" / "[" / "]" / "?" / "=" ; Must bea publicly available specificationinany case.) Person & email addressquoted-string, ; tocontact for further information: E.2 Registration of New Access-type Values for Message/external-body To: IANA@isi.edu Subject: Registration of new MIME Access-type for Message/external-body content-type MIME access-type name: Required parameters: Optional parameters: Published specification: (The published specification must be an Internet RFCuse within parameter values type := discrete-type / composite-type value := token / quoted-string version := "MIME-Version" ":" 1*DIGIT "." 1*DIGIT x-token := <The two characters "X-" orRFC-to-be.) Person & email address to contact for further information: Borenstein & Freed [Page 83]"x-" followed, with no intervening white space, by any token> Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 87] Internet Draft MIME Part One November 1994 AppendixFE -- Summary of the Seven Content-typesContent-type:Content type: text Subtypes defined by this document: plain ImportantParameters:parameters: charset Encoding notes: quoted-printable generally preferred if an encoding is needed and the character set is mostlyana US- ASCII superset. Security considerations: Rich text formats such as TeX and Troff often contain mechanisms for executing arbitrary commands or file system operations, and should not be used automatically unless these security problems have been addressed. Even plain text may contain control characters that can be used to exploit the capabilities of "intelligent" terminals and cause security violations. User interfaces designed to run on such terminals should be aware of and try to prevent such problems.________________________________________________________________ Content-type: multipartContent type: image Subtypes defined by this document:mixed, alternative, digest, parallel.jpeg, gif ImportantParameters: boundaryparameters: none Encoding notes:No content-transfer-encoding is permitted. ________________________________________________________________ Content-type: messagebase64 generally preferred Content type: audio Subtypes defined by this document:rfc822, partial, external-bodybasic ImportantParameters: id, number, total, access-type, expiration, size, permission, name, site, directory, mode, server, subjectparameters: none Encoding notes:No content-transfer-encoding is permitted. Specifically, only "7bit" is permitted for Borenstein & Freed [Page 84]base64 generally preferred Content type: video Subtypes defined by this document: mpeg Important parameters: none Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 88] Internet Draft MIME Part One November 1994"message/partial" or "message/external-body", and only "7bit", "8bit", or "binary" are permitted for other subtypes of "message". ________________________________________________________________ Content-type:Encoding notes: base64 generally preferred Content type: application Subtypes defined by this document: octet-stream, postscript ImportantParameters:parameters: type, padding DeprecatedParameters:parameters: name and conversions were defined in RFC1341.1341, and have since been deleted. Encoding notes: base64 preferred for unreadable subtypes. Security considerations: This type is intended for the transmission of data to be interpreted by locally-installed programs.If used, for example,Severe security problems could result if this type is used to transmitexecutablebinary programs or programs in general-purpose interpreted languages, such as LISP programs or shell scripts,severe security problems could result.without taking special precautions. Authors of mail-reading agents are cautioned against giving their systems the power to execute mail-based application data without carefully considering the security implications. While it is certainly possible to define safe application formats and even safe interpreters for unsafe formats, each interpreter should be evaluated separately for possible security problems.________________________________________________________________ Content-type: imageContent type: multipart Subtypes defined by this document:jpeg, gifmixed, alternative, digest, parallel. ImportantParameters: noneparameters: boundary Encoding notes:base64 generally preferred ________________________________________________________________ Content-type: audioNo content-transfer-encoding other than "7bit", "8bit", or "binary" are permitted. Content type: message Subtypes defined by this document:basic Borenstein & Freed [Page 85]rfc822, partial, external-body Important parameters: id, number, total, access-type, expiration, size, permission, name, site, directory, mode, server, subject Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 89] Internet Draft MIME Part One November 1994Important Parameters: none Encoding notes: base64 generally preferred ________________________________________________________________ Content-type: video Subtypes defined by this document: mpeg Important Parameters: noneEncoding notes:base64 generally preferred Borenstein & Freed [Page 86]Only "7bit" is permitted for "message/partial" or "message/external-body", and only "7bit", "8bit", or "binary" are permitted for other subtypes of "message". Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 90] Internet Draft MIME Part One November 1994 AppendixGF -- Canonical Encoding Model There was some confusion, in earlier drafts of this memo, regarding the model for when email data was to be converted to canonical form and encoded, and in particular how this process would affect the treatment of CRLFs, given that the representation of newlines varies greatly from system to system. For this reason, a canonical model for encoding is presented below. The process of composing a MIME entity can be modeled as being done in a number of steps. Note that these steps are roughly similar to those steps used inRFC 1421PEM [RFC1421] and are performed for each'innermost level'"innermost level" body:Step 1.(1) Creation of local form. The body to be transmitted is created in the system's native format. The native character set is used, and where appropriate local end of line conventions are used as well. The body may be a UNIX-style text file, or a Sun raster image, or a VMS indexed file, or audio data in asystem- dependentsystem-dependent format stored only in memory, or anything else that corresponds to the local model for the representation of some form of information. Fundamentally, the data is created in the "native" form that corresponds to the type specified by thetype/subtype information. Step 2.content type. (2) Conversion to canonical form. The entire body, including "out-of-band" information such as record lengths and possibly file attribute information, is converted to a universal canonical form. The specific content type of the body as well as its associated attributes dictate the nature of the canonical form that is used. Conversion to the proper canonical form may involve character set conversion, transformation of audio data, compression, or various other operations specific to the various content types. If character set conversion is involved, however, care must be taken to understand the semantics of the content-type, which may have strong implications for Expires May 1995 [Page 91] Internet Draft MIME Part One November 1994 any character set conversion, e.g. with regard to syntactically meaningful characters in a text subtype other than "plain".Borenstein & Freed [Page 87] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994For example, in the case of text/plain data, the text must be converted to a supported character set and lines must be delimited with CRLF delimiters in accordance withRFC822.RFC 822. Note that the restriction on line lengths implied byRFC822RFC 822 is eliminated if the next step employs eitherquoted- printablequoted-printable or base64 encoding.Step 3.(3) Apply transfer encoding. A Content-Transfer-Encoding appropriate for this body is applied. Note that there is no fixed relationship between the content type and the transfer encoding. In particular, it may be appropriate to base the choice of base64 or quoted-printable on character frequency counts which are specific to a given instance of a body.Borenstein & Freed [Page 88] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 Step 4.(4) Insertion into entity. The encoded object is inserted into a MIME entity with appropriate headers. The entity is then inserted into the body of a higher-level entity (message or multipart) if needed. It is vital to note that these steps are only a model; they are specifically NOT a blueprint for how an actual system would be built. In particular, the model fails to account for two common designs:1.(1) In many cases the conversion to a canonical form prior to encoding will be subsumed into the encoder itself, which understands local formats directly. For example, the local newline convention for text bodies might be carried through to the encoder itself along with knowledge of what that format is.2.(2) The output of the encoders may have to pass through one or more additional steps prior to being transmitted as a message. As such, the output of the encoder may not be conformant with the formats specified byRFC822.RFC 822. Expires May 1995 [Page 92] Internet Draft MIME Part One November 1994 In particular, once again it may be appropriate for the converter's output to be expressed using local newline conventions rather than using the standardRFC822RFC 822 CRLF delimiters. Other implementation variations are conceivable as well. The vital aspect of this discussion is that, in spite of any optimizations, collapsings of required steps, or insertion of additional processing, the resulting messages must be consistent with those produced by the model described here. For example, a message with the following header fields: Content-type: text/foo; charset=bar Content-Transfer-Encoding: base64 must be first represented in the text/foo form, then (if necessary) represented in the "bar" character set, and finally transformed via the base64 algorithm into amail- safemail-safe form.Borenstein & Freed [Page 89]Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 93] Internet Draft MIME Part One November 1994 AppendixHG -- Changes from RFC 1521 This document is avery minorrevision of RFC 1521. For the convenience of those familiar with RFC 1521, the changes from that document are summarized in this appendix. For further history, note that Appendix H in RFC 1521 specified how that document differed from its predecessor, RFC 1341.1.(1) This document has been completely reformatted. This was done to improve the quality of the plain text version of this document, which is required to be the reference copy. (2) BNF describing the overall structure of MIME message and part headers has been added. This is a documentation change only -- the underlying syntax has not changed in any way. (3) The specific BNF for the seven content types in MIME has been removed. This BNF was incorrect, incomplete, amd inconsistent with the type-indendependent BNF. And since the type-independent BNF already fully specifies the syntax of the various MIME headers, the type- specific BNF was, in the final analysis, completely unnecessary and caused more problems than it solved. (4) The more specific "US-ASCII" character set name has replaced the use of the term ASCII in many parts of this specification. (5) The informal concept of a primary subtype has been removed. (6) The term "object" was being used inconsistently. This term has been replaced with the more precise terms "body", "body part", and "entity" where appropriate. (7) The BNF for the multipart content-type has been rearranged to make it clear that the CRLF preceeding the boundary marker is actually part of the marker itself rather than the preceeding body part. Expires May 1995 [Page 94] Internet Draft MIME Part One November 1994 (8) In the rules on reassembling "message/partial" MIMEentities in section 7.3.2,entities, "Subject" is added to the list of headers to take from the inner message, and the example is modified to clarify this point.2.(9) In the discussion of the application/postscripttype in section 7.4.2,type, an additional paragraph has been added warningagainst theabout possible interoperability problems caused by embedding of binary data inside a PostScript MIME entity.3.(10) Added a clarifying note to the basic syntax rulesin section 4for Content-Type to make it clear that thefollowing two forms: Content-type: text/plain; charset=us-ascii Content-type: text/plain; charset="us-ascii" are completely equivalent. 4. In section 7.2.3, afollowing two forms: Content-type: text/plain; charset=us-ascii (comment) Content-type: text/plain; charset="us-ascii" are completely equivalent. (11) The following sentence has been removed from the discussion of the MIME-Version header: "However, conformant software is encouraged to check the version number and at least warn the user if an unrecognized MIME-version is encountered." (12) A typo was fixed that said "application/external-body" instead of"message/external- body". 5. In section 5,"message/external-body". (13) The definition of a character set has been reorganized to make thefollowing paragraphrequirements clearer. (14) The definitions of "7bit" and "8bit" have been tightened so that use of bare CR, LF, and NUL characters are no longer allowed. (15) The definition of canonical text in MIME has been tightened so that line breaks must be represented by a CRLF sequence. CR and LF characters are not allowed outside of this usage. The definition of quoted- printable encoding has been altered accordingly. (16) Prose was added to clarify the use of the"7bit" transfer-encoding in"7bit", "8- bit", and "binary" transfer-encodings on multipart or message entities encapsulating "8bit" or "binary"data: It should also be noted that, by definition, if a "multipart" or "message" entity has a transfer- encoding value such as "7bit", but one of the enclosed parts has a less restrictive value such as "8bit", then either the outer "7bit" labelling is in error, because 8 bit data are included, or the inner "8bit" labelling placed an unnecessarily high demand on the transport system because the actual included data were actually 7bit-safe. 6.data. Expires May 1995 [Page 95] Internet Draft MIME Part One November 1994 (17) In Appendix A, "multipart/digest" support was added to the list of requirements for minimal MIME conformance.Borenstein & Freed [Page 90] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994Also, the requirement for "message/rfc822" support were strengthened to clarify the importance of recognizing recursive structure.7. In section 7.3.1,(18) The various restrictions on subtypes of "message" are now specified entirely on a subtype by subtype basis. (19) The definition of "message/rfc822" was changed to indicate that at least one of the "From", "Subject", or "Date" headers must be present. (20) The required handling of unrecognized subtypes as "application/octet-stream" has been made more explicit in both the type definitions sections and the conformance guidelines. (21) Examples using text/richtext were changed to text/enriched. (22) The BNF definition of"message/rfc822" wassubtype has been changed toindicatemake it clear thatat least one of the "From", "Subject",either an IANA registered subtype or"Date" headersa nonstandard "X-" subtype must bepresent. Borenstein & Freed [Page 91]used in a Content-Type header field. (23) The use of escape and shift mechanisms in the US-ASCII and ISO-8859-X character sets this specification defines has been clarified: Such mechanisms should never be used in conjunction with these character sets and their effect if they are used is undefined. (24) The definition of the AFS access-type for message/external-body has been removed. (25) Entities that are simply registered for use and those that are standardized by the IETF are now distinguished in the MIME BNF. (26) The handling of the combination of multipart/alternative and message/external-body is now specifically addressed. Expires11/20/94 draft-ietf-822-mime-00.txtMay 1995 [Page 96] Internet Draft MIME Part One November 1994 Appendix H -- References[US-ASCII] Coded Character Set--7-Bit American Standard Code for Information Interchange, ANSI X3.4-1986.[ATK] Borenstein, Nathaniel S., Multimedia Applications Development with the Andrew Toolkit, Prentice-Hall, 1990. [GIF] Graphics Interchange Format (Version 89a), Compuserve, Inc., Columbus, Ohio, 1990. [ISO-2022] InternationalStandard--Information Processing--Standard -- Information Processing -- ISO 7-bit and 8-bitcoded character sets--Code extension techniques,Coded Character Sets -- Code Extension Techniques, ISO 2022:1986. [ISO-8859] International Standard -- Information Processing -- 8-bit Single-Byte Coded Graphic Character Sets -- Part 1: Latin Alphabet No. 1, ISO 8859-1:1987. Part 2: Latin alphabet No. 2, ISO 8859-2, 1987. Part 3: Latin alphabet No. 3, ISO 8859-3, 1988. Part 4: Latin alphabet No. 4, ISO 8859-4, 1988. Part 5: Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6: Latin/Arabic alphabet, ISO 8859-6, 1987. Part 7: Latin/Greek alphabet, ISO 8859-7, 1987. Part 8: Latin/Hebrew alphabet, ISO 8859-8, 1988. Part 9: Latin alphabet No. 5, ISO 8859-9, 1990. [ISO-646] InternationalStandard--Information Processing--Standard -- Information Processing -- ISO 7-bitcoded character set for information interchange,Coded Character Set For Information Interchange, ISO 646:1983. [MPEG] Video Coding Draft Standard ISO 11172 CD, ISO IEC/TJC1/SC2/WG11 (Motion Picture Experts Group), May, 1991. [PCM] CCITT, Fascicle III.4 - Recommendation G.711, "Pulse Code Modulation (PCM) of Voice Frequencies", Geneva, 1972. Expires May 1995 [Page 97] Internet Draft MIME Part One November 1994 [POSTSCRIPT] Adobe Systems, Inc., PostScript Language Reference Manual, Addison-Wesley, 1985. [POSTSCRIPT2] Adobe Systems, Inc., PostScript Language Reference Manual, Addison-Wesley, Second Edition, 1990.[X400] Schicker, Pietro, "Message Handling Systems, X.400", Message Handling Systems and Distributed Applications, E. Stefferud, O-j. Jacobsen, and P. Schicker, eds., North- Holland, 1989, pp. 3-41. Borenstein & Freed [Page 92] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994[RFC-783] Sollins,K.R.K.R., "TFTP Protocol (revision 2)", RFC-783, MIT, June 1981. [RFC-821] Postel,J.B.J.B., "Simple Mail Transfer Protocol", STD 10, RFC 821, USC/Information Sciences Institute, August 1982. [RFC-822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, UDEL, August 1982. [RFC-934] Rose, M., and E. Stefferud, "Proposed Standard for Message Encapsulation", RFC 934, Delaware and NMA, January 1985. [RFC-959] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9, RFC 959, USC/Information Sciences Institute, October 1985. [RFC-1049] Sirbu, M., "Content-Type Header Field for Internet Messages", STD 11, RFC 1049, CMU, March 1988.[RFC-1421] Linn, J., "Privacy Enhancement for Internet Electronic Mail: Part I - Message Encryption and Authentication Procedures", RFC 1421, IAB IRTF PSRG, IETF PEM WG, February 1993.[RFC-1154] Robinson, D. and R. Ullmann, "Encoding Header Field for Internet Messages", RFC 1154, Prime Computer, Inc., April 1990. [RFC-1341] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1341, Bellcore, Innosoft, June 1992. Expires May 1995 [Page 98] Internet Draft MIME Part One November 1994 [RFC-1342] Moore, K., "Representation of Non-Ascii Text in Internet Message Headers", RFC 1342, University of Tennessee, June 1992.[RFC-1343] Borenstein, N., "A User Agent Configuration Mechanism for Multimedia Mail Format Information", RFC 1343, Bellcore, June 1992.[RFC-1344] Borenstein, N., "Implications of MIME for Internet Mail Gateways", RFC 1344, Bellcore, June 1992.Borenstein & Freed [Page 93] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994[RFC-1345] Simonsen, K., "Character Mnemonics & Character Sets", RFC 1345, Rationel Almen Planlaegning, June 1992.[RFC-1426] Klensin,[RFC-1421] Linn, J.,(WG Chair), Freed, N., (Editor), Rose, M., Stefferud, E., and D. Crocker, "SMTP Service Extension"Privacy Enhancement for8bit-MIME transport",Internet Electronic Mail: Part I -- Message Encryption and Authentication Procedures", RFC1426, United Nations Universit, Innosoft, Dover Beach Consulting, Inc., Network Management Associates, Inc., The Branch Office,1421, IAB IRTF PSRG, IETF PEM WG, February 1993.[RFC-1522] Moore, K., "Representation of Non-Ascii Text in[RFC-1422] Kent, S., "Privacy Enhancement for InternetMessage Headers"Electronic Mail: Part II -- Certificate-Based Key Management", RFC1522, University of Tennessee, September1422, IAB IRTF PSRG, IETF PEM WG, February 1993.[RFC-1340] Reynolds, J.,[RFC-1423] Balenson, D., "Privacy Enhancement for Internet Electronic Mail: Part III -- Algorithms, Modes, andJ. Postel, "Assigned Numbers", STD 2, RFC 1340, USC/Information Sciences Institute, July 1992.Identifiers", IAB IRTF PSRG, IETF PEM WG, February 1993. [RFC-1424] Kaliski, B., "Privacy Enhancement for Internet Electronic Mail: Part IV -- Key Certification and Related Services", IAB IRTF PSRG, IETF PEM WG, February 1993. [RFC-1521] Borenstein, N., and N. Freed, "MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies", RFC 1521, Bellcore, Innosoft, September, 1993.[RFC-1563] Borenstein, N., "The text/enriched MIME Content- type",[RFC-1522] Moore, K., "Representation of Non-ASCII Text in Internet Message Headers", RFC 1522, University of Tennessee, September 1993. Expires May 1995 [Page 99] Internet Draft MIME Part One November 1994 [RFC-1524] Borenstein, N., "A User Agent Configuration Mechanism for Multimedia Mail Format Information", RFC 1524, Bellcore, September 1993. [RFC-1563] Borenstein, N., "The text/enriched MIME Content-type", RFC 1563, Bellcore, January, 1994. [RFC-1652] Klensin, J., (WG Chair), Freed, N., (Editor), Rose, M., Stefferud, E., and Crocker, D., "SMTP Service Extension for 8bit-MIME transport", RFC 1652, United Nations Universit, Innosoft, Dover Beach Consulting, Inc., Network Management Associates, Inc., The Branch Office, February 1993. [RFC-1700] Reynolds, J., and J. Postel, "Assigned Numbers", STD 2, RFC1563, Bellcore, January,1700, USC/Information Sciences Institute, October 1994.Borenstein & Freed [Page 94] Expires 11/20/94 draft-ietf-822-mime-00.txt May 1994 THIS PAGE INTENTIONALLY LEFT BLANK. Borenstein & Freed [Page i] Table[RFC-MIME-HEADERS] Moore, K., "Representation ofContents 1 Introduction....................................... 4 2 Notations, Conventions, and Generic BNF Grammar.... 4 3 The MIME-Version Header Field...................... 6 4 The Content-Type Header Field...................... 8 5 The Content-Transfer-Encoding Header Field......... 14 5.1 Quoted-Printable Content-Transfer-Encoding......... 20 5.2 Base64 Content-Transfer-Encoding................... 24 6 Additional Content- Header Fields.................. 27 6.1 Optional Content-ID Header Field................... 27 6.2 Optional Content-Description Header Field.......... 27 7 The Predefined Content-Type Values................. 28 7.1 TheNon-Ascii TextContent-Type.............................. 28 7.1.1 The charset parameter.............................. 28 7.1.2 The Text/plain subtype............................. 32 7.2 The Multipart Content-Type......................... 33 7.2.1 Multipart: The common syntax...................... 34 7.2.2 The Multipart/mixed (primary) subtype.............. 40 7.2.3 The Multipart/alternative subtype.................. 40 7.2.4 The Multipart/digest subtype....................... 43 7.2.5 The Multipart/parallel subtype..................... 43 7.3 Thein Internet MessageContent-Type........................... 44 7.3.1 The Message/rfc822 (primary) subtype............... 45 7.3.2 The Message/Partial subtype........................ 45 7.3.3 The Message/External-Body subtype.................. 49 7.4 The Application Content-Type....................... 58 7.4.1 The Application/Octet-Stream (primary) subtype..... 58 7.4.2 The Application/PostScript subtype................. 59 7.4.3 Other Application subtypes......................... 62 7.5 The Image Content-Type............................. 63 7.6 The Audio Content-Type............................. 63 7.7 The Video Content-Type............................. 64 7.8 Experimental Content-Type Values................... 64 Summary............................................ 65 Security Considerations............................ 65 Authors' Addresses................................. 66 Acknowledgements................................... 67 Appendix A -- Minimal MIME-Conformance............. 69 Appendix B -- General Guidelines For Sending Email Data72 Appendix C -- A Complex Multipart Example.......... 75 Appendix D -- Collected Grammar.................... 77 Appendix E -- IANA Registration Procedures......... 82 E.1 RegistrationHeaders", RFC MIME-HEADERS, University ofNew Content-type/subtype Values..82 Borenstein & Freed [Page ii] E.2Tennessee, ?. [RFC-REG] Postel, J., "Media Type Registrationof New Access-type Values for Message/external-body83 Appendix F -- Summary of the Seven Content-types... 84 Appendix G -- Canonical Encoding Model............. 87 Appendix H -- Changes fromProcedure", RFC1521................ 90 References......................................... 92 Borenstein & FreedREG, ?. [US-ASCII] Coded Character Set -- 7-Bit American Standard Code for Information Interchange, ANSI X3.4-1986. [X400] Schicker, Pietro, "Message Handling Systems, X.400", Message Handling Systems and Distributed Applications, E. Stefferud, O-j. Jacobsen, and P. Schicker, eds., North- Holland, 1989, pp. 3-41. Expires May 1995 [Pageiii]100] ----