idnits 2.17.1 draft-ietf-822ext-mime-imt-00.txt: ** The Abstract section seems to be numbered Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-24) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 325: '...y MIME text type MUST represent a line...' RFC 2119 keyword, line 327: '...in text MUST represent a line break. ...' RFC 2119 keyword, line 401: '...racter encodings MUST use an appropria...' RFC 2119 keyword, line 860: '...undary delimiter MUST NOT appear insid...' RFC 2119 keyword, line 942: '...undary delimiter MUST occur at the beg...' (7 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 485 has weird spacing: '...of text is "p...' == Line 955 has weird spacing: '...F (line break...' == Line 1698 has weird spacing: '...ed, the defau...' -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (April 11, 1995) is 10606 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Missing reference section? 'RFC-1341' on line 223 looks like a reference -- Missing reference section? 'RFC-1563' on line 321 looks like a reference -- Missing reference section? 'ISO-646' on line 382 looks like a reference -- Missing reference section? 'US-ASCII' on line 432 looks like a reference -- Missing reference section? 'ISO-8859' on line 435 looks like a reference -- Missing reference section? 'PCM' on line 532 looks like a reference -- Missing reference section? 'MPEG' on line 550 looks like a reference -- Missing reference section? 'POSTSCRIPT' on line 642 looks like a reference -- Missing reference section? 'POSTSCRIPT2' on line 643 looks like a reference -- Missing reference section? 'MIME-IMB' on line 877 looks like a reference -- Missing reference section? 'RFC-959' on line 1695 looks like a reference -- Missing reference section? 'RFC-783' on line 1690 looks like a reference Summary: 9 errors (**), 0 flaws (~~), 4 warnings (==), 14 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 Network Working Group Nathaniel Borenstein 2 Internet Draft Ned Freed 3 5 Multipurpose Internet Mail Extensions 6 (MIME) Part Two: 8 Media Types 10 April 11, 1995 12 Status of this Memo 14 This document is an Internet-Draft. Internet-Drafts are 15 working documents of the Internet Engineering Task Force 16 (IETF), its areas, and its working groups. Note that other 17 groups may also distribute working documents as Internet- 18 Drafts. 20 Internet-Drafts are draft documents valid for a maximum of six 21 months. Internet-Drafts may be updated, replaced, or obsoleted 22 by other documents at any time. It is not appropriate to use 23 Internet-Drafts as reference material or to cite them other 24 than as a "working draft" or "work in progress". 26 To learn the current status of any Internet-Draft, please 27 check the 1id-abstracts.txt listing contained in the 28 Internet-Drafts Shadow Directories on ds.internic.net (US East 29 Coast), nic.nordu.net (Europe), ftp.isi.edu (US West Coast), 30 or munnari.oz.au (Pacific Rim). 32 1. Abstract 34 STD 11, RFC 822 defines a message representation protocol 35 specifying considerable detail about US-ASCII message headers, 36 but which leaves the message content, or message body, as flat 37 US-ASCII text. This set of documents, collectively called the 38 Multipurpose Internet Mail Extensions, or MIME, redefines the 39 format of messages to allow for 40 (1) textual message bodies in character sets other than 41 US-ASCII, 43 (2) non-textual message bodies, 45 (3) multi-part message bodies, and 47 (4) textual header information in character sets other than 48 US-ASCII. 50 These documents are based on earlier work documented in RFC 51 934, STD 11, and RFC 1049, but extends and revises them. 52 Because RFC 822 said so little about message bodies, these 53 documents are largely orthogonal to (rather than a revision 54 of) RFC 822. 56 In particular, these documents are designed to provide 57 facilities to include multiple parts in a single message, to 58 represent body and header text in character sets other than 59 US-ASCII, to represent formatted multi-font text messages, to 60 represent non-textual material such as images and audio 61 fragments, and generally to facilitate later extensions 62 defining new types of Internet mail for use by cooperating 63 mail agents. 65 The initial document in this set, RFC MIME-IMB, specifies the 66 various headers used to describe the structure of MIME 67 messages. This second document defines the general structure 68 of the MIME media typing system and defines an initial set of 69 media types. The third document, RFC MIME-HEADERS, describes 70 extensions to RFC 822 to allow non-US-ASCII text data in 71 Internet mail header fields. The fourth document, RFC MIME- 72 REG, specifies various IANA registration procedures for MIME- 73 related entities. The fifth and final document, RFC MIME- 74 CONF, describes MIME conformance criteria as well as providing 75 some illustrative examples of MIME message formats, 76 acknowledgements, and the bibliography. 78 These documents are revisions of RFCs 1521 and 1522, which 79 themselves were revisions of RFCs 1341 and 1342. An appendix 80 in RFC MIME-CONF describes differences and changes from 81 previous versions. 83 2. Table of Contents 85 1 Abstract .............................................. 1 86 2 Table of Contents ..................................... 3 87 3 Introduction .......................................... 4 88 4 Definition of a Top-Level Media Type .................. 5 89 5 Overview Of The Initial Top-Level Media Types ......... 5 90 6 Discrete Media Type Values ............................ 7 91 6.1 Text Media Type ..................................... 7 92 6.1.1 Representation of Line Breaks ..................... 8 93 6.1.2 Charset Parameter ................................. 8 94 6.1.3 Plain Subtype ..................................... 12 95 6.1.4 Unrecognized Subtypes ............................. 12 96 6.2 Image Media Type .................................... 12 97 6.3 Audio Media Type .................................... 12 98 6.4 Video Media Type .................................... 13 99 6.5 Application Media Type .............................. 14 100 6.5.1 Octet-Stream Subtype .............................. 14 101 6.5.2 PostScript Subtype ................................ 15 102 6.5.3 Other Application Subtypes ........................ 19 103 7 Composite Media Type Values ........................... 19 104 7.1 Multipart Media Type ................................ 19 105 7.1.1 Common Syntax ..................................... 21 106 7.1.2 Handling Nested Messages and Multiparts ........... 27 107 7.1.3 Mixed Subtype ..................................... 27 108 7.1.4 Alternative Subtype ............................... 27 109 7.1.5 Digest Subtype .................................... 29 110 7.1.6 Parallel Subtype .................................. 30 111 7.1.7 Other Multipart Subtypes .......................... 31 112 7.2 Message Media Type .................................. 31 113 7.2.1 RFC822 Subtype .................................... 32 114 7.2.2 Partial Subtype ................................... 32 115 7.2.2.1 Message Fragmentation and Reassembly ............ 33 116 7.2.2.2 Fragmentation and Reassembly Example ............ 34 117 7.2.3 External-Body Subtype ............................. 36 118 7.2.3.1 General External-Body Parameters ................ 37 119 7.2.3.2 The 'ftp' and 'tftp' Access-Types ............... 39 120 7.2.3.3 The 'anon-ftp' Access-Type ...................... 39 121 7.2.3.4 The 'local-file' Access-Type .................... 40 122 7.2.3.5 The 'mail-server' Access-Type ................... 40 123 7.2.3.6 External-Body Security Issues ................... 41 124 7.2.3.7 Examples and Further Explanations ............... 42 125 7.2.4 Other Message Subtypes ............................ 45 126 8 Experimental Media Type Values ........................ 45 127 9 Summary ............................................... 46 128 10 Security Considerations .............................. 46 129 11 Authors' Addresses ................................... 46 130 A Collected Grammar ..................................... 48 131 3. Introduction 133 The first document in this set, RFC MIME-IMB, defines a number 134 of header fields, including Content-Type. The Content-Type 135 field is used to specify the nature of the data in the body of 136 an entity, by giving media type and subtype identifiers, and 137 by providing auxiliary information that may be required for 138 certain media types. After the type and subtype names, the 139 remainder of the header field is simply a set of parameters, 140 specified in an attribute/value notation. The ordering of 141 parameters is not significant. 143 In general, the top-level media type is used to declare the 144 general type of data, while the subtype specifies a specific 145 format for that type of data. Thus, a media type of 146 "image/xyz" is enough to tell a user agent that the data is an 147 image, even if the user agent has no knowledge of the specific 148 image format "xyz". Such information can be used, for 149 example, to decide whether or not to show a user the raw data 150 from an unrecognized subtype -- such an action might be 151 reasonable for unrecognized subtypes of text, but not for 152 unrecognized subtypes of image or audio. For this reason, 153 registered subtypes of text, image, audio, and video should 154 not contain embedded information that is really of a different 155 type. Such compound formats should be represented using the 156 "multipart" or "application" types. 158 Parameters are modifiers of the media subtype, and as such do 159 not fundamentally affect the nature of the content. The set 160 of meaningful parameters depends on the media type and 161 subtype. Most parameters are associated with a single 162 specific subtype. However, a given top-level media type may 163 define parameters which are applicable to any subtype of that 164 type. Parameters may be required by their defining media type 165 or subtype or they may be optional. MIME implementations must 166 also ignore any parameters whose names they do not recognize. 168 MIME's Content-Type header field and media type mechanism has 169 been carefully designed to be extensible, and it is expected 170 that the set of media type/subtype pairs and their associated 171 parameters will grow significantly over time. Several other 172 MIME entities, most notably the list of the name of character 173 sets registered for MIME usage, are likely to have new values 174 defined over time. In order to ensure that the set of such 175 values is developed in an orderly, well-specified, and public 176 manner, MIME sets up a registration process which uses the 177 Internet Assigned Numbers Authority (IANA) as a central 178 registry for MIME's extension areas. The registration process 179 is described in a companion document, RFC MIME-REG. 181 The initial seven standard top-level media type are defined 182 and described in the remainder of this document. 184 4. Definition of a Top-Level Media Type 186 The definition of a top-level media type consists of: 188 (1) a name and a description of the type, including 189 criteria for whether a particular type would qualify 190 under that type, 192 (2) the names and definitions of parameters, if any, which 193 are defined for all subtypes of that type (including 194 whether such parameters are required or optional), 196 (3) how a user agent and/or gateway should handle unknown 197 subtypes of this type, 199 (4) general considerations on gatewaying objects of this 200 top-level type, if any, and 202 (5) any restrictions on content-transfer-encodings for 203 objects of this top-level type. 205 5. Overview Of The Initial Top-Level Media Types 207 The five discrete top-level media types are: 209 (1) text -- textual information. The subtype "plain" in 210 particular indicates plain (unformatted) text. No 211 special software is required to get the full meaning of 212 the text, aside from support for the indicated 213 character set. Other subtypes are to be used for 214 enriched text in forms where application software may 215 enhance the appearance of the text, but such software 216 must not be required in order to get the general idea 217 of the content. Possible subtypes thus include any 218 word processor format that can be read without 219 resorting to software that understands the format. In 220 particular, formats that employ embeddded binary 221 formatting information are not considered directly 222 readable. A very simple and portable subtype, 223 richtext, was defined in RFC 1341 [RFC-1341], with a 224 further revision in RFC 1563 [RFC-1563] under the name 225 "enriched". 227 (2) image -- image data. Image requires a display device 228 (such as a graphical display, a graphics printer, or a 229 FAX machine) to view the information. An initial 230 subtype is defined for the widely-used image format 231 JPEG. 233 (3) audio -- audio data. Audio requires an audio output 234 device (such as a speaker or a telephone) to "display" 235 the contents. An initial subtype "basic" is defined in 236 this document. 238 (4) video -- video data. Video requires the capability to 239 display moving images, typically including specialized 240 hardware and software. An initial subtype "mpeg" is 241 defined in this document. 243 (5) application -- some other kind of data, typically 244 either uninterpreted binary data or information to be 245 processed by an application. The subtype "octet- 246 stream" is to be used in the case of uninterpreted 247 binary data, in which case the simplest recommended 248 action is to offer to write the information into a file 249 for the user. The "PostScript" subtype is also defined 250 for the transport of PostScript material. Other 251 expected uses for "application" include spreadsheets, 252 data for mail-based scheduling systems, and languages 253 for "active" (computational) messaging, and word 254 processing formats that are not directly readable. 255 Note that security considerations may exist for some 256 types of application data, most notably 257 application/PostScript and any form of active 258 messaging. These issues are discussed later in this 259 document. 261 The two composite top-level media types are: 263 (1) multipart -- data consisting of multiple parts of 264 independent data types. Four subtypes are initially 265 defined, including the basic "mixed" subtype specifying 266 a generic mixed set of parts, "alternative" for 267 representing the same data in multiple formats, 268 "parallel" for parts intended to be viewed 269 simultaneously, and "digest" for multipart entities in 270 which each part has a default type of "message/rfc822". 272 (2) message -- an encapsulated message. A body of media 273 type "message" is itself all or part of some kind of 274 message object. Such objects may in turn contain other 275 messages and body parts of their own. The "rfc822" 276 subtype is used when the encapsulated content is itself 277 an RFC 822 message. The "partial" subtype is defined 278 for partial RFC 822 messages, to permit the fragmented 279 transmission of bodies that are thought to be too large 280 to be passed through transport facilities in one piece. 281 Another subtype, "external-body", is defined for 282 specifying large bodies by reference to an external 283 data source. 285 It should be noted that the list of media type values given 286 here may be augmented in time, via the mechanisms described 287 above, and that the set of subtypes is expected to grow 288 substantially. 290 6. Discrete Media Type Values 292 Five of the seven initial media type values refer to discrete 293 bodies. The content of such entities is handled by non-MIME 294 mechanisms; they are opaque to MIME processors. 296 6.1. Text Media Type 298 The text media type is intended for sending material which is 299 principally textual in form. A "charset" parameter may be 300 used to indicate the character set of the body text for some 301 text subtypes, notably including the subtype "text/plain", 302 which indicates plain (unformatted) text. The default media 303 type for Internet mail if none is specified is "text/plain; 304 charset=us-ascii". 306 Beyond plain text, there are many formats for representing 307 what might be known as "extended text" -- text with embedded 308 formatting and presentation information. An interesting 309 characteristic of many such representations is that they are 310 to some extent readable even without the software that 311 interprets them. It is useful, then, to distinguish them, at 312 the highest level, from such unreadable data as images, audio, 313 or text represented in an unreadable form. In the absence of 314 appropriate interpretation software, it is reasonable to show 315 subtypes of text to the user, while it is not reasonable to do 316 so with most nontextual data. 318 Such formatted textual data should be represented using 319 subtypes of text. Plausible subtypes of text are typically 320 given by the common name of the representation format, e.g., 321 "text/enriched" [RFC-1563]. 323 6.1.1. Representation of Line Breaks 325 The canonical form of any MIME text type MUST represent a line 326 break as a CRLF sequence. Similarly, any occurrence of CRLF 327 in text MUST represent a line break. Use of CR and LF outside 328 of line break sequences is also forbidden. 330 This rule applies regardless of format or character set or 331 sets involved. 333 6.1.2. Charset Parameter 335 A critical parameter that may be specified in the Content-Type 336 field for text/plain data is the character set. This is 337 specified with a "charset" parameter, as in: 339 Content-type: text/plain; charset=iso-8859-1 341 Unlike some other parameter values, the values of the charset 342 parameter are NOT case sensitive. The default character set, 343 which must be assumed in the absence of a charset parameter, 344 is US-ASCII. 346 The specification for any future subtypes of "text" must 347 specify whether or not they will also utilize a "charset" 348 parameter, and may possibly restrict its values as well. When 349 used with a particular body, the semantics of the "charset" 350 parameter should be identical to those specified here for 351 "text/plain", i.e., the body consists entirely of characters 352 in the given charset. In particular, definers of future text 353 subtypes should pay close attention to the implications of 354 multioctet character sets for their subtype definitions. 356 This RFC specifies the definition of the charset parameter for 357 the purposes of MIME to be the name of a character set, as 358 "character set" as defined in Section 4 of this document. The 359 rules regarding line breaks detailed in the previous section 360 must also be observed -- a character set whose definition does 361 not conform to these rules cannot be used in a MIME text type. 363 An initial list of predefined character set names can be found 364 at the end of this section. Additional character sets may be 365 registered with IANA as described in RFC MIME-REG. 367 Note that if the specified character set includes 8-bit data, 368 a Content-Transfer-Encoding header field and a corresponding 369 encoding on the data are required in order to transmit the 370 body via some mail transfer protocols, such as SMTP. 372 The default character set, US-ASCII, has been the subject of 373 some confusion and ambiguity in the past. Not only were there 374 some ambiguities in the definition, there have been wide 375 variations in practice. In order to eliminate such ambiguity 376 and variations in the future, it is strongly recommended that 377 new user agents explicitly specify a character set as a media 378 type parameter in the Content-Type header field. "US-ASCII" 379 does not indicate an arbitrary 7-bit character code, but 380 specifies that the body uses character coding that uses the 381 exact correspondence of octets to characters specified in US- 382 ASCII. National use variations of ISO 646 [ISO-646] are NOT 383 US-ASCII and their use in Internet mail is explicitly 384 discouraged. The omission of the ISO 646 character set is 385 deliberate in this regard. The character set name of "US- 386 ASCII" explicitly refers to ANSI X3.4-1986 [US-ASCII] only. 387 The character set name "ASCII" is reserved and must not be 388 used for any purpose. 390 NOTE: RFC 821 explicitly specifies "ASCII", and references an 391 earlier version of the American Standard. Insofar as one of 392 the purposes of specifying a media type and character set is 393 to permit the receiver to unambiguously determine how the 394 sender intended the coded message to be interpreted, assuming 395 anything other than "strict ASCII" as the default would risk 396 unintentional and incompatible changes to the semantics of 397 messages now being transmitted. This also implies that 398 messages containing characters coded according to national 399 variations on ISO 646, or using code-switching procedures 400 (e.g., those of ISO 2022), as well as 8-bit or multiple octet 401 character encodings MUST use an appropriate character set 402 specification to be consistent with this specification. 404 The complete US-ASCII character set is listed in ANSI X3.4- 405 1986. Note that the control characters including DEL (0-31, 406 127) have no defined meaning apart from the combination CRLF 407 (US-ASCII values 13 and 10) indicating a new line. Two of the 408 characters have de facto meanings in wide use: FF (12) often 409 means "start subsequent text on the beginning of a new page"; 410 and TAB or HT (9) often (though not always) means "move the 411 cursor to the next available column after the current position 412 where the column number is a multiple of 8 (counting the first 413 column as column 0)." Apart from this, any use of the control 414 characters or DEL in a body must be part of a private 415 agreement between the sender and recipient. Such private 416 agreements are discouraged and should be replaced by the other 417 capabilities of this document. 419 NOTE: Beyond US-ASCII, an enormous proliferation of character 420 sets is possible. It is the opinion of the IETF working group 421 that a large number of character sets is NOT a good thing. We 422 would prefer to specify a SINGLE character set that can be 423 used universally for representing all of the world's languages 424 in Internet mail. Unfortunately, existing practice in several 425 communities seems to point to the continued use of multiple 426 character sets in the near future. For this reason, we define 427 names for a small number of character sets for which a strong 428 constituent base exists. 430 The defined charset values are: 432 (1) US-ASCII -- as defined in ANSI X3.4-1986 [US-ASCII]. 434 (2) ISO-8859-X -- where "X" is to be replaced, as 435 necessary, for the parts of ISO-8859 [ISO-8859]. Note 436 that the ISO 646 character sets have deliberately been 437 omitted in favor of their 8859 replacements, which are 438 the designated character sets for Internet mail. As of 439 the publication of this document, the legitimate values 440 for "X" are the digits 1 through 9. 442 All of these character sets are used as pure 7- or 8-bit sets 443 without any shift or escape functions. The meaning of shift 444 and escape sequences in these character sets is not defined. 446 The character sets specified above are the ones that were 447 relatively uncontroversial during the drafting of MIME. This 448 document does not endorse the use of any particular character 449 set other than US-ASCII, and recognizes that the future 450 evolution of world character sets remains unclear. It is 451 expected that in the future, additional character sets will be 452 registered for use in MIME. 454 Note that the character set used, if anything other than US- 455 ASCII, must always be explicitly specified in the Content-Type 456 field. 458 No other character set name may be used in Internet mail 459 without the publication of a formal specification and its 460 registration with IANA, or by private agreement, in which case 461 the character set name must begin with "X-". 463 Implementors are discouraged from defining new character sets 464 unless absolutely necessary. 466 The "charset" parameter has been defined primarily for the 467 purpose of textual data, and is described in this section for 468 that reason. However, it is conceivable that non-textual data 469 might also wish to specify a charset value for some purpose, 470 in which case the same syntax and values should be used. 472 In general, composition software should always use the "lowest 473 common denominator" character set possible. For example, if a 474 body contains only US-ASCII characters, it should be marked as 475 being in the US-ASCII character set, not ISO-8859-1, which, 476 like all the ISO-8859 family of character sets, is a superset 477 of US-ASCII. More generally, if a widely-used character set 478 is a subset of another character set, and a body contains only 479 characters in the widely-used subset, it should be labelled as 480 being in that subset. This will increase the chances that the 481 recipient will be able to view the resulting object correctly. 483 6.1.3. Plain Subtype 485 The simplest and most important subtype of text is "plain". 486 This indicates plain (unformatted) text. The default media 487 type of "text/plain; charset=us-ascii" for Internet mail 488 describes existing Internet practice. That is, it is the type 489 of body defined by RFC 822. 491 No other text subtype is defined by this document. 493 6.1.4. Unrecognized Subtypes 495 Unrecognized subtypes of text should be treated as subtype 496 "plain" as long as the MIME implementation knows how to handle 497 the charset. Unrecognized subtypes which also specify an 498 unrecognized charset should be treated as "application/octet- 499 stream". 501 6.2. Image Media Type 503 A media type of "image" indicates that the body contains an 504 image. The subtype names the specific image format. These 505 names are not case sensitive. An initial subtype is "jpeg" for 506 the JPEG format using JFIF encoding. 508 The list of image subtypes given here is neither exclusive nor 509 exhaustive, and is expected to grow as more types are 510 registered with IANA, as described in RFC MIME-REG. 512 Unrecognized subtypes of image should at a miniumum be treated 513 as "application/octet-stream". Implementations may optionally 514 elect to pass subtypes of image that they do not specifically 515 recognize to a robust general-purpose image viewing 516 application, if such an application is available. 518 6.3. Audio Media Type 520 A media type of "audio" indicates that the body contains audio 521 data. Although there is not yet a consensus on an "ideal" 522 audio format for use with computers, there is a pressing need 523 for a format capable of providing interoperable behavior. 525 The initial subtype of "basic" is specified to meet this 526 requirement by providing an absolutely minimal lowest common 527 denominator audio format. It is expected that richer formats 528 for higher quality and/or lower bandwidth audio will be 529 defined by a later document. 531 The content of the "audio/basic" subtype is single channel 532 audio encoded using 8-bit ISDN mu-law [PCM] at a sample rate 533 of 8000 Hz. 535 Unrecognized subtypes of audio should at a miniumum be treated 536 as "application/octet-stream". Implementations may optionally 537 elect to pass subtypes of audio that they do not specifically 538 recognize to a robust general-purpose audio playing 539 application, if such an application is available. 541 6.4. Video Media Type 543 A media type of "video" indicates that the body contains a 544 time-varying-picture image, possibly with color and 545 coordinated sound. The term "video" is used extremely 546 generically, rather than with reference to any particular 547 technology or format, and is not meant to preclude subtypes 548 such as animated drawings encoded compactly. The subtype 549 "mpeg" refers to video coded according to the MPEG standard 550 [MPEG]. 552 Note that although in general this document strongly 553 discourages the mixing of multiple media in a single body, it 554 is recognized that many so-called "video" formats include a 555 representation for synchronized audio, and this is explicitly 556 permitted for subtypes of "video". 558 Unrecognized subtypes of video should at a minumum be treated 559 as "application/octet-stream". Implementations may optionally 560 elect to pass subtypes of video that they do not specifically 561 recognize to a robust general-purpose video display 562 application, if such an application is available. 564 6.5. Application Media Type 566 The "application" media type is to be used for discrete data 567 which do not fit in any of the other categories, and 568 particularly for data to be processed by some type of 569 application program. This is information which must be 570 processed by an application before it is viewable or usable by 571 a user. Expected uses for the application media type include 572 file transfer, spreadsheets, data for mail-based scheduling 573 systems, and languages for "active" (computational) messages. 574 (The latter, in particular, can pose security problems which 575 must be understood by implementors, and are considered in 576 detail in the discussion of the application/PostScript media 577 type.) 579 For example, a meeting scheduler might define a standard 580 representation for information about proposed meeting dates. 581 An intelligent user agent would use this information to 582 conduct a dialog with the user, and might then send additional 583 material based on that dialog. More generally, there have 584 been several "active" messaging languages developed in which 585 programs in a suitably specialized language are transported to 586 a remote location and automatically run in the recipient's 587 environment. 589 Such applications may be defined as subtypes of the 590 "application" media type. This document defines two subtypes: 591 octet-stream, and PostScript. 593 The subtype of application will often be the name of the 594 application for which the data are intended. This does not 595 mean, however, that any application program name may be used 596 freely as a subtype of application. Usage of any subtype 597 (other than subtypes beginning with "x-") must be registered 598 with IANA, as described in RFC MIME-REG. 600 6.5.1. Octet-Stream Subtype 602 The "octet-stream" subtype is used to indicate that a body 603 contains arbitrary binary data. The set of currently defined 604 parameters is: 606 (1) TYPE -- the general type or category of binary data. 607 This is intended as information for the human recipient 608 rather than for any automatic processing. 610 (2) PADDING -- the number of bits of padding that were 611 appended to the bit-stream comprising the actual 612 contents to produce the enclosed 8-bit byte-oriented 613 data. This is useful for enclosing a bit-stream in a 614 body when the total number of bits is not a multiple of 615 8. 617 Both of these parameters are optional. 619 An additional parameter, "CONVERSIONS", was defined in RFC 620 1341 but has since been removed. RFC 1341 also defined the 621 use of a "NAME" parameter which gave a suggested file name to 622 be used if the data were to be written to a file. This has 623 been deprecated in anticipation of a separate Content- 624 Disposition header field, to be defined in a subsequent RFC. 626 The recommended action for an implementation that receives an 627 application/octet-stream object is to simply offer to put the 628 data in a file, with any Content-Transfer-Encoding undone, or 629 perhaps to use it as input to a user-specified process. 631 To reduce the danger of transmitting rogue programs, it is 632 strongly recommended that implementations NOT implement a 633 path-search mechanism whereby an arbitrary program named in 634 the Content-Type parameter (e.g., an "interpreter=" parameter) 635 is found and executed using the message body as input. 637 6.5.2. PostScript Subtype 639 A media type of "application/postscript" indicates a 640 PostScript program. Currently two variants of the PostScript 641 language are allowed; the original level 1 variant is 642 described in [POSTSCRIPT] and the more recent level 2 variant 643 is described in [POSTSCRIPT2]. 645 PostScript is a registered trademark of Adobe Systems, Inc. 646 Use of the MIME media type "application/postscript" implies 647 recognition of that trademark and all the rights it entails. 649 The PostScript language definition provides facilities for 650 internal labelling of the specific language features a given 651 program uses. This labelling, called the PostScript document 652 structuring conventions, or DSC, is very general and provides 653 substantially more information than just the language level. 654 The use of document structuring conventions, while not 655 required, is strongly recommended as an aid to 656 interoperability. Documents which lack proper structuring 657 conventions cannot be tested to see whether or not they will 658 work in a given environment. As such, some systems may assume 659 the worst and refuse to process unstructured documents. 661 The execution of general-purpose PostScript interpreters 662 entails serious security risks, and implementors are 663 discouraged from simply sending PostScript bodies to "off- 664 the-shelf" interpreters. While it is usually safe to send 665 PostScript to a printer, where the potential for harm is 666 greatly constrained by typical printer environments, 667 implementors should consider all of the following before they 668 add interactive display of PostScript bodies to their MIME 669 readers. 671 The remainder of this section outlines some, though probably 672 not all, of the possible problems with the transport of 673 PostScript objects. 675 (1) Dangerous operations in the PostScript language 676 include, but may not be limited to, the PostScript 677 operators "deletefile", "renamefile", "filenameforall", 678 and "file". "File" is only dangerous when applied to 679 something other than standard input or output. 680 Implementations may also define additional nonstandard 681 file operators; these may also pose a threat to 682 security. "Filenameforall", the wildcard file search 683 operator, may appear at first glance to be harmless. 684 Note, however, that this operator has the potential to 685 reveal information about what files the recipient has 686 access to, and this information may itself be 687 sensitive. Message senders should avoid the use of 688 potentially dangerous file operators, since these 689 operators are quite likely to be unavailable in secure 690 PostScript implementations. Message receiving and 691 displaying software should either completely disable 692 all potentially dangerous file operators or take 693 special care not to delegate any special authority to 694 their operation. These operators should be viewed as 695 being done by an outside agency when interpreting 696 PostScript documents. Such disabling and/or checking 697 should be done completely outside of the reach of the 698 PostScript language itself; care should be taken to 699 insure that no method exists for re-enabling full- 700 function versions of these operators. 702 (2) The PostScript language provides facilities for exiting 703 the normal interpreter, or server, loop. Changes made 704 in this "outer" environment are customarily retained 705 across documents, and may in some cases be retained 706 semipermanently in nonvolatile memory. The operators 707 associated with exiting the interpreter loop have the 708 potential to interfere with subsequent document 709 processing. As such, their unrestrained use 710 constitutes a threat of service denial. PostScript 711 operators that exit the interpreter loop include, but 712 may not be limited to, the exitserver and startjob 713 operators. Message sending software should not 714 generate PostScript that depends on exiting the 715 interpreter loop to operate, since the ability to exit 716 will probably be unavailable in secure PostScript 717 implementations. Message receiving and displaying 718 software should completely disable the ability to make 719 retained changes to the PostScript environment by 720 eliminating or disabling the "startjob" and 721 "exitserver" operations. If these operations cannot be 722 eliminated or completely disabled the password 723 associated with them should at least be set to a hard- 724 to-guess value. 726 (3) PostScript provides operators for setting system-wide 727 and device-specific parameters. These parameter 728 settings may be retained across jobs and may 729 potentially pose a threat to the correct operation of 730 the interpreter. The PostScript operators that set 731 system and device parameters include, but may not be 732 limited to, the "setsystemparams" and "setdevparams" 733 operators. Message sending software should not 734 generate PostScript that depends on the setting of 735 system or device parameters to operate correctly. The 736 ability to set these parameters will probably be 737 unavailable in secure PostScript implementations. 738 Message receiving and displaying software should 739 disable the ability to change system and device 740 parameters. If these operators cannot be completely 741 disabled the password associated with them should at 742 least be set to a hard-to-guess value. 744 (4) Some PostScript implementations provide nonstandard 745 facilities for the direct loading and execution of 746 machine code. Such facilities are quite obviously open 747 to substantial abuse. Message sending software should 748 not make use of such features. Besides being totally 749 hardware-specific, they are also likely to be 750 unavailable in secure implementations of PostScript. 751 Message receiving and displaying software should not 752 allow such operators to be used if they exist. 754 (5) PostScript is an extensible language, and many, if not 755 most, implementations of it provide a number of their 756 own extensions. This document does not deal with such 757 extensions explicitly since they constitute an unknown 758 factor. Message sending software should not make use 759 of nonstandard extensions; they are likely to be 760 missing from some implementations. Message receiving 761 and displaying software should make sure that any 762 nonstandard PostScript operators are secure and don't 763 present any kind of threat. 765 (6) It is possible to write PostScript that consumes huge 766 amounts of various system resources. It is also 767 possible to write PostScript programs that loop 768 indefinitely. Both types of programs have the 769 potential to cause damage if sent to unsuspecting 770 recipients. Message-sending software should avoid the 771 construction and dissemination of such programs, which 772 is antisocial. Message receiving and displaying 773 software should provide appropriate mechanisms to abort 774 processing of a document after a reasonable amount of 775 time has elapsed. In addition, PostScript interpreters 776 should be limited to the consumption of only a 777 reasonable amount of any given system resource. 779 (7) It is possible to include raw binary information inside 780 PostScript in various forms. This is not recommended 781 for use in Internet mail, both because it is not 782 supported by all PostScript interpreters and because it 783 significantly complicates the use of a MIME Content- 784 Transfer-Encoding. (Without such binary, PostScript 785 may typically be viewed as line-oriented data. The 786 treatment of CRLF sequences becomes extremely 787 problematic if binary and line-oriented data are mixed 788 in a single Postscript data stream.) 790 (8) Finally, bugs may exist in some PostScript interpreters 791 which could possibly be exploited to gain unauthorized 792 access to a recipient's system. Apart from noting this 793 possibility, there is no specific action to take to 794 prevent this, apart from the timely correction of such 795 bugs if any are found. 797 6.5.3. Other Application Subtypes 799 It is expected that many other subtypes of application will be 800 defined in the future. MIME implementations must at a minimum 801 treat any unrecognized subtypes as being equivalent to 802 "application/octet-stream". 804 7. Composite Media Type Values 806 The remaining two of the seven initial Content-Type values 807 refer to composite entities. Composite entities are handled 808 using MIME mechanisms -- a MIME processor typically handles 809 the body directly. 811 7.1. Multipart Media Type 813 In the case of multiple part entities, in which one or more 814 different sets of data are combined in a single body, a 815 "multipart" media type field must appear in the entity's 816 header. The body must then contain one or more "body parts," 817 each preceded by a boundary delimiter line, and the last one 818 followed by a closing boundary delimiter line. After its 819 boundary delimiter line, each body part then consists of a 820 header area, a blank line, and a body area. Thus a body part 821 is similar to an RFC 822 message in syntax, but different in 822 meaning. 824 A body part is NOT to be interpreted as actually being an RFC 825 822 message. To begin with, NO header fields are actually 826 required in body parts. A body part that starts with a blank 827 line, therefore, is allowed and is a body part for which all 828 default values are to be assumed. In such a case, the absence 829 of a Content-Type header usually indicates that the 830 corresponding body has a content-type of "text/plain; 831 charset=US-ASCII". 833 The only header fields that have defined meaning for body 834 parts are those the names of which begin with "Content-". All 835 other header fields are generally to be ignored in body parts. 836 Although they should generally be retained if at all possible, 837 they may be discarded by gateways if necessary. Such other 838 fields are permitted to appear in body parts but must not be 839 depended on. "X-" fields may be created for experimental or 840 private purposes, with the recognition that the information 841 they contain may be lost at some gateways. 843 NOTE: The distinction between an RFC 822 message and a body 844 part is subtle, but important. A gateway between Internet and 845 X.400 mail, for example, must be able to tell the difference 846 between a body part that contains an image and a body part 847 that contains an encapsulated message, the body of which is a 848 JPEG image. In order to represent the latter, the body part 849 must have "Content-Type: message/rfc822", and its body (after 850 the blank line) must be the encapsulated message, with its own 851 "Content-Type: image/jpeg" header field. The use of similar 852 syntax facilitates the conversion of messages to body parts, 853 and vice versa, but the distinction between the two must be 854 understood by implementors. (For the special case in which 855 all parts actually are messages, a "digest" subtype is also 856 defined.) 858 As stated previously, each body part is preceded by a boundary 859 delimiter line that contains the boundary delimiter. The 860 boundary delimiter MUST NOT appear inside any of the 861 encapsulated parts, on a line by itself or as the prefix of 862 any line. This implies that it is crucial that the composing 863 agent be able to choose and specify a unique boundary 864 parameter value that does not contain the boundary parameter 865 value of an enclosing multipart as a prefix. 867 All present and future subtypes of the "multipart" type must 868 use an identical syntax. Subtypes may differ in their 869 semantics, and may impose additional restrictions on syntax, 870 but must conform to the required syntax for the multipart 871 type. This requirement ensures that all conformant user 872 agents will at least be able to recognize and separate the 873 parts of any multipart entity, even those of an unrecognized 874 subtype. 876 As stated in the definition of the Content-Transfer-Encoding 877 field [MIME-IMB], no encoding other than "7bit", "8bit", or 878 "binary" is permitted for entities of type "multipart". The 879 multipart boundary delimiters and header fields are always 880 represented as 7-bit US-ASCII in any case (though the header 881 fields may encode non-US-ASCII header text as per RFC MIME- 882 HEADERS) and data within the body parts can be encoded on a 883 part-by-part basis, with Content-Transfer-Encoding fields for 884 each appropriate body part. 886 7.1.1. Common Syntax 888 This section defines a common syntax for subtypes of 889 multipart. All subtypes of multipart must use this syntax. A 890 simple example of a multipart message also appears in this 891 section. An example of a more complex multipart message is 892 given in RFC MIME-CONF. 894 The Content-Type field for multipart entities requires one 895 parameter, "boundary". The boundary delimiter line is then 896 defined as a line consisting entirely of two hyphen characters 897 ("-", decimal value 45) followed by the boundary parameter 898 value from the Content-Type header field, optional linear 899 whitespace, and a terminating CRLF. 901 NOTE: The hyphens are for rough compatibility with the 902 earlier RFC 934 method of message encapsulation, and for ease 903 of searching for the boundaries in some implementations. 904 However, it should be noted that multipart messages are NOT 905 completely compatible with RFC 934 encapsulations; in 906 particular, they do not obey RFC 934 quoting conventions for 907 embedded lines that begin with hyphens. This mechanism was 908 chosen over the RFC 934 mechanism because the latter causes 909 lines to grow with each level of quoting. The combination of 910 this growth with the fact that SMTP implementations sometimes 911 wrap long lines made the RFC 934 mechanism unsuitable for use 912 in the event that deeply-nested multipart structuring is ever 913 desired. 915 WARNING TO IMPLEMENTORS: The grammar for parameters on the 916 Content-type field is such that it is often necessary to 917 enclose the boundary parameter values in quotes on the 918 Content-type line. This is not always necessary, but never 919 hurts. Implementors should be sure to study the grammar 920 carefully in order to avoid producing invalid Content-type 921 fields. Thus, a typical multipart Content-Type header field 922 might look like this: 924 Content-Type: multipart/mixed; boundary=gc0p4Jq0M2Yt08j34c0p 926 But the following is not valid: 928 Content-Type: multipart/mixed; boundary=gc0pJq0M:08jU534c0p 930 (because of the colon) and must instead be represented as 932 Content-Type: multipart/mixed; boundary="gc0pJq0M:08jU534c0p" 934 This Content-Type value indicates that the content consists of 935 one or more parts, each with a structure that is syntactically 936 identical to an RFC 822 message, except that the header area 937 is allowed to be completely empty, and that the parts are each 938 preceded by the line 940 --gc0pJq0M:08jU534c0p 942 The boundary delimiter MUST occur at the beginning of a line, 943 i.e., following a CRLF, and the initial CRLF is considered to 944 be attached to the boundary delimiter line rather than part of 945 the preceding part. The boundary may be followed by zero or 946 more characters of linear whitespace. It is then terminated by 947 either another CRLF and the header fields for the next part, 948 or by two CRLFs, in which case there are no header fields for 949 the next part. If no Content-Type field is present it is 950 assumed to be of message/rfc822 in a multipart/digest and 951 text/plain otherwise. 953 NOTE: The CRLF preceding the boundary delimiter line is 954 conceptually attached to the boundary so that it is possible 955 to have a part that does not end with a CRLF (line break). 956 Body parts that must be considered to end with line breaks, 957 therefore, must have two CRLFs preceding the boundary 958 delimiter line, the first of which is part of the preceding 959 body part, and the second of which is part of the 960 encapsulation boundary. 962 Boundary delimiters must not appear within the encapsulated 963 material, and must be no longer than 70 characters, not 964 counting the two leading hyphens. 966 The boundary delimiter line following the last body part is a 967 distinguished delimiter that indicates that no further body 968 parts will follow. Such a delimiter line is identical to the 969 previous delimiter lines, with the addition of two more 970 hyphens after the boundary parameter value. 972 --gc0pJq0M:08jU534c0p-- 974 NOTE TO IMPLEMENTORS: Boundary string comparisons must 975 compare the boundary value with the beginning of each 976 candidate line. An exact match of the entire candidate line 977 is not required; it is sufficient that the boundary appear in 978 its entirety following the CRLF. 980 There appears to be room for additional information prior to 981 the first boundary delimiter line and following the final 982 boundary delimiter line. These areas should generally be left 983 blank, and implementations must ignore anything that appears 984 before the first boundary delimiter line or after the last 985 one. 987 NOTE: These "preamble" and "epilogue" areas are generally not 988 used because of the lack of proper typing of these parts and 989 the lack of clear semantics for handling these areas at 990 gateways, particularly X.400 gateways. However, rather than 991 leaving the preamble area blank, many MIME implementations 992 have found this to be a convenient place to insert an 993 explanatory note for recipients who read the message with 994 pre-MIME software, since such notes will be ignored by MIME- 995 compliant software. 997 NOTE: Because boundary delimiters must not appear in the body 998 parts being encapsulated, a user agent must exercise care to 999 choose a unique boundary parameter value. The boundary 1000 parameter value in the example above could have been the 1001 result of an algorithm designed to produce boundary delimiters 1002 with a very low probability of already existing in the data to 1003 be encapsulated without having to prescan the data. Alternate 1004 algorithms might result in more "readable" boundary delimiters 1005 for a recipient with an old user agent, but would require more 1006 attention to the possibility that the boundary delimiter might 1007 appear at the beginning of some line in the encapsulated part. 1008 The simplest boundary delimiter line possible is something 1009 like "---", with a closing boundary delimiter line of "-----". 1011 As a very simple example, the following multipart message has 1012 two parts, both of them plain text, one of them explicitly 1013 typed and one of them implicitly typed: 1015 From: Nathaniel Borenstein 1016 To: Ned Freed 1017 Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) 1018 Subject: Sample message 1019 MIME-Version: 1.0 1020 Content-type: multipart/mixed; boundary="simple boundary" 1022 This is the preamble. It is to be ignored, though it 1023 is a handy place for composition agents to include an 1024 explanatory note to non-MIME conformant readers. 1026 --simple boundary 1028 This is implicitly typed plain US-ASCII text. 1029 It does NOT end with a linebreak. 1030 --simple boundary 1031 Content-type: text/plain; charset=us-ascii 1033 This is explicitly typed plain US-ASCII text. 1034 It DOES end with a linebreak. 1036 --simple boundary-- 1038 This is the epilogue. It is also to be ignored. 1040 The use of a media type of multipart in a body part within 1041 another multipart entity is explicitly allowed. In such 1042 cases, for obvious reasons, care must be taken to ensure that 1043 each nested multipart entity uses a different boundary 1044 delimiter. See RFC MIME-CONF for an example of nested 1045 multipart entities. 1047 The use of the multipart media type with only a single body 1048 part may be useful in certain contexts, and is explicitly 1049 permitted. 1051 The only mandatory global parameter for the multipart media 1052 type is the boundary parameter, which consists of 1 to 70 1053 characters from a set of characters known to be very robust 1054 through mail gateways, and NOT ending with white space. (If a 1055 boundary delimiter line appears to end with white space, the 1056 white space must be presumed to have been added by a gateway, 1057 and must be deleted.) It is formally specified by the 1058 following BNF: 1060 boundary := 0*69 bcharsnospace 1062 bchars := bcharsnospace / " " 1064 bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / 1065 "+" / "_" / "," / "-" / "." / 1066 "/" / ":" / "=" / "?" 1068 Overall, the body of a multipart entity may be specified as 1069 follows: 1071 dash-boundary := "--" boundary 1072 ; boundary taken from the value of 1073 ; boundary parameter of the 1074 ; Content-Type field. 1076 multipart-body := [preamble CRLF] 1077 dash-boundary transport-padding CRLF 1078 body-part *encapsulation 1079 close-delimiter transport-padding 1080 [CRLF epilogue] 1082 transport-padding := *LWSP-char 1083 ; Composers MUST NOT generate 1084 ; non-zero length transport 1085 ; padding, but receivers MUST 1086 ; be able to handle padding 1087 ; added by message transports. 1089 encapsulation := delimiter transport-padding 1090 CRLF body-part 1092 delimiter := CRLF dash-boundary 1094 close-delimiter := delimiter "--" 1095 preamble := discard-text 1097 epilogue := discard-text 1099 discard-text := *(*text CRLF) *text 1100 ; To be ignored upon receipt. 1102 body-part := <"message" as defined in RFC 822, with all 1103 header fields optional, not starting with the 1104 specified dash-boundary, and with the 1105 delimiter not occurring anywhere in the 1106 message body. Note that the semantics of a 1107 part differ from the semantics of a message, 1108 as described in the text.> 1110 IMPORTANT NOTE: The free insertion of linear-white-space and 1111 RFC 822 comments between the elements shown in this BNF is NOT 1112 allowed since this BNF does not specify a structured header 1113 field. 1115 NOTE: In certain transport enclaves, RFC 822 restrictions 1116 such as the one that limits bodies to printable US-ASCII 1117 characters may not be in force. (That is, the transport 1118 domains may resemble standard Internet mail transport as 1119 specified in RFC 821 and assumed by RFC 822, but without 1120 certain restrictions.) The relaxation of these restrictions 1121 should be construed as locally extending the definition of 1122 bodies, for example to include octets outside of the US-ASCII 1123 range, as long as these extensions are supported by the 1124 transport and adequately documented in the Content-Transfer- 1125 Encoding header field. However, in no event are headers 1126 (either message headers or body-part headers) allowed to 1127 contain anything other than US-ASCII characters. 1129 NOTE: Conspicuously missing from the multipart type is a 1130 notion of structured, related body parts. In general, it 1131 seems premature to try to standardize interpart structure yet. 1132 It is recommended that those wishing to provide a more 1133 structured or integrated multipart messaging facility should 1134 define a subtype of multipart that is syntactically identical, 1135 but that always expects the inclusion of a distinguished part 1136 that can be used to specify the structure and integration of 1137 the other parts, probably referring to them by their Content- 1138 ID field. If this approach is used, other implementations 1139 will not recognize the new subtype, but will treat it as the 1140 primary subtype (multipart/mixed) and will thus be able to 1141 show the user the parts that are recognized. 1143 7.1.2. Handling Nested Messages and Multiparts 1145 The "message/rfc822" subtype defined in a subsequent section 1146 of this document has no terminating condition other than 1147 running out of data. Similarly, an improperly truncated 1148 multipart object may not have any terminating boundary marker, 1149 and can turn up operationally due to mail system malfunctions. 1151 It is essential that such objects be handled correctly when 1152 they are themselves imbedded inside of another multipart 1153 structure. MIME implementations are therefore required to 1154 recognize outer level boundary markers at ANY level of inner 1155 nesting. It is not sufficient to only check for the next 1156 expected marker or other terminating condition. 1158 7.1.3. Mixed Subtype 1160 The "mixed" subtype of multipart is intended for use when the 1161 body parts are independent and need to be bundled in a 1162 particular order. Any multipart subtypes that an 1163 implementation does not recognize must be treated as being of 1164 subtype "mixed". 1166 7.1.4. Alternative Subtype 1168 The multipart/alternative type is syntactically identical to 1169 multipart/mixed, but the semantics are different. In 1170 particular, each of the parts is an "alternative" version of 1171 the same information. 1173 Systems should recognize that the content of the various parts 1174 are interchangeable. Systems should choose the "best" type 1175 based on the local environment and references, in some cases 1176 even through user interaction. As with multipart/mixed, the 1177 order of body parts is significant. In this case, the 1178 alternatives appear in an order of increasing faithfulness to 1179 the original content. In general, the best choice is the LAST 1180 part of a type supported by the recipient system's local 1181 environment. 1183 Multipart/alternative may be used, for example, to send a 1184 message in a fancy text format in such a way that it can 1185 easily be displayed anywhere: 1187 From: Nathaniel Borenstein 1188 To: Ned Freed 1189 Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) 1190 Subject: Formatted text mail 1191 MIME-Version: 1.0 1192 Content-Type: multipart/alternative; boundary=boundary42 1194 --boundary42 1195 Content-Type: text/plain; charset=us-ascii 1197 ... plain text version of message goes here ... 1199 --boundary42 1200 Content-Type: text/enriched 1202 ... RFC 1563 text/enriched version of same message 1203 goes here ... 1205 --boundary42 1206 Content-Type: application/x-whatever 1208 ... fanciest version of same message goes here ... 1210 --boundary42-- 1212 In this example, users whose mail systems understood the 1213 "application/x-whatever" format would see only the fancy 1214 version, while other users would see only the enriched or 1215 plain text version, depending on the capabilities of their 1216 system. 1218 In general, user agents that compose multipart/alternative 1219 entities must place the body parts in increasing order of 1220 preference, that is, with the preferred format last. For 1221 fancy text, the sending user agent should put the plainest 1222 format first and the richest format last. Receiving user 1223 agents should pick and display the last format they are 1224 capable of displaying. In the case where one of the 1225 alternatives is itself of type "multipart" and contains 1226 unrecognized sub-parts, the user agent may choose either to 1227 show that alternative, an earlier alternative, or both. 1229 NOTE: From an implementor's perspective, it might seem more 1230 sensible to reverse this ordering, and have the plainest 1231 alternative last. However, placing the plainest alternative 1232 first is the friendliest possible option when 1233 multipart/alternative entities are viewed using a non-MIME- 1234 conformant viewer. While this approach does impose some 1235 burden on conformant MIME viewers, interoperability with older 1236 mail readers was deemed to be more important in this case. 1238 It may be the case that some user agents, if they can 1239 recognize more than one of the formats, will prefer to offer 1240 the user the choice of which format to view. This makes 1241 sense, for example, if a message includes both a nicely- 1242 formatted image version and an easily-edited text version. 1243 What is most critical, however, is that the user not 1244 automatically be shown multiple versions of the same data. 1245 Either the user should be shown the last recognized version or 1246 should be given the choice. 1248 NOTE ON THE SEMANTICS OF CONTENT-ID IN MULTIPART/ALTERNATIVE: 1249 Each part of a multipart/alternative entity represents the 1250 same data, but the mappings between the two are not 1251 necessarily without information loss. For example, 1252 information is lost when translating ODA to PostScript or 1253 plain text. It is recommended that each part should have a 1254 different Content-ID value in the case where the information 1255 content of the two parts is not identical. And when the 1256 information content is identical -- for example, where several 1257 parts of type "message/external-body" specify alternate ways 1258 to access the identical data -- the same Content-ID field 1259 value should be used, to optimize any caching mechanisms that 1260 might be present on the recipient's end. However, the 1261 Content-ID values used by the parts should NOT be the same 1262 Content-ID value that describes the multipart/alternative as a 1263 whole, if there is any such Content-ID field. That is, one 1264 Content-ID value will refer to the multipart/alternative 1265 entity, while one or more other Content-ID values will refer 1266 to the parts inside it. 1268 7.1.5. Digest Subtype 1270 This document defines a "digest" subtype of the multipart 1271 Content-Type. This type is syntactically identical to 1272 multipart/mixed, but the semantics are different. In 1273 particular, in a digest, the default Content-Type value for a 1274 body part is changed from "text/plain" to "message/rfc822". 1275 This is done to allow a more readable digest format that is 1276 largely compatible (except for the quoting convention) with 1277 RFC 934. 1279 A digest in this format might, then, look something like this: 1281 From: Moderator-Address 1282 To: Recipient-List 1283 Date: Mon, 22 Mar 1994 13:34:51 +0000 1284 Subject: Internet Digest, volume 42 1285 MIME-Version: 1.0 1286 Content-Type: multipart/digest; 1287 boundary="---- next message ----" 1289 ------ next message ---- 1291 From: someone-else 1292 Date: Fri, 26 Mar 1993 11:13:32 +0200 1293 Subject: my opinion 1295 ...body goes here ... 1297 ------ next message ---- 1299 From: someone-else-again 1300 Date: Fri, 26 Mar 1993 10:07:13 -0500 1301 Subject: my different opinion 1303 ... another body goes here ... 1305 ------ next message ------ 1307 7.1.6. Parallel Subtype 1309 This document defines a "parallel" subtype of the multipart 1310 Content-Type. This type is syntactically identical to 1311 multipart/mixed, but the semantics are different. In 1312 particular, in a parallel entity, the order of body parts is 1313 not significant. 1315 A common presentation of this type is to display all of the 1316 parts simultaneously on hardware and software that are capable 1317 of doing so. However, composing agents should be aware that 1318 many mail readers will lack this capability and will show the 1319 parts serially in any event. 1321 7.1.7. Other Multipart Subtypes 1323 Other multipart subtypes are expected in the future. MIME 1324 implementations must in general treat unrecognized subtypes of 1325 multipart as being equivalent to "multipart/mixed". 1327 7.2. Message Media Type 1329 It is frequently desirable, in sending mail, to encapsulate 1330 another mail message. A special media type, "message", is 1331 defined to facilitate this. In particular, the "rfc822" 1332 subtype of "message" is used to encapsulate RFC 822 messages. 1334 NOTE: It has been suggested that subtypes of message might be 1335 defined for forwarded or rejected messages. However, 1336 forwarded and rejected messages can be handled as multipart 1337 messages in which the first part contains any control or 1338 descriptive information, and a second part, of type 1339 message/rfc822, is the forwarded or rejected message. 1340 Composing rejection and forwarding messages in this manner 1341 will preserve the type information on the original message and 1342 allow it to be correctly presented to the recipient, and hence 1343 is strongly encouraged. 1345 Subtypes of message often impose restrictions on what 1346 encodings are allowed. These restrictions are described in 1347 conjunction with each specific subtype. 1349 Mail gateways, relays, and other mail handling agents are 1350 commonly known to alter the top-level header of an RFC 822 1351 message. In particular, they frequently add, remove, or 1352 reorder header fields. Such alterations are explicitly 1353 forbidden for the encapsulated headers embedded in the bodies 1354 of messages of type "message." 1355 7.2.1. RFC822 Subtype 1357 A media type of "message/rfc822" indicates that the body 1358 contains an encapsulated message, with the syntax of an RFC 1359 822 message. However, unlike top-level RFC 822 messages, the 1360 restriction that each message/rfc822 body must include a 1361 "From", "Date", and at least one destination header is removed 1362 and replaced with the requirement that at least one of "From", 1363 "Subject", or "Date" must be present. 1365 No encoding other than "7bit", "8bit", or "binary" is 1366 permitted for parts of type "message/rfc822". The message 1367 header fields are always US-ASCII in any case, and data within 1368 the body can still be encoded, in which case the Content- 1369 Transfer-Encoding header field in the encapsulated message 1370 will reflect this. Non-US-ASCII text in the headers of an 1371 encapsulated message can be specified using the mechanisms 1372 described in RFC MIME-HEADERS. 1374 It should be noted that, despite the use of the numbers "822", 1375 a message/rfc822 entity can include enhanced information as 1376 defined in this document. In other words, a message/rfc822 1377 message may be a MIME message. 1379 7.2.2. Partial Subtype 1381 The "partial" subtype is defined to allow large entities to be 1382 delivered as several separate pieces of mail and automatically 1383 reassembled by a receiving user agent. (The concept is 1384 similar to IP fragmentation and reassembly in the basic 1385 Internet Protocols.) This mechanism can be used when 1386 intermediate transport agents limit the size of individual 1387 messages that can be sent. The media type "message/partial" 1388 thus indicates that the body contains a fragment of a larger 1389 message. 1391 Three parameters must be specified in the Content-Type field 1392 of type message/partial: The first, "id", is a unique 1393 identifier, as close to a world-unique identifier as possible, 1394 to be used to match the parts together. (In general, the 1395 identifier is essentially a message-id; if placed in double 1396 quotes, it can be ANY message-id, in accordance with the BNF 1397 for "parameter" given earlier in this specification.) The 1398 second, "number", an integer, is the part number, which 1399 indicates where this part fits into the sequence of fragments. 1400 The third, "total", another integer, is the total number of 1401 parts. This third subfield is required on the final part, and 1402 is optional (though encouraged) on the earlier parts. Note 1403 also that these parameters may be given in any order. 1405 Thus, part 2 of a 3-part message may have either of the 1406 following header fields: 1408 Content-Type: Message/Partial; number=2; total=3; 1409 id="oc=jpbe0M2Yt4s@thumper.bellcore.com" 1411 Content-Type: Message/Partial; 1412 id="oc=jpbe0M2Yt4s@thumper.bellcore.com"; 1413 number=2 1415 But part 3 MUST specify the total number of parts: 1417 Content-Type: Message/Partial; number=3; total=3; 1418 id="oc=jpbe0M2Yt4s@thumper.bellcore.com" 1420 Note that part numbering begins with 1, not 0. 1422 When the parts of a message broken up in this manner are put 1423 together, the result is a complete MIME entity, which may have 1424 its own Content-Type header field, and thus may contain any 1425 other data type. 1427 7.2.2.1. Message Fragmentation and Reassembly 1429 The semantics of a reassembled partial message must be those 1430 of the "inner" message, rather than of a message containing 1431 the inner message. This makes it possible, for example, to 1432 send a large audio message as several partial messages, and 1433 still have it appear to the recipient as a simple audio 1434 message rather than as an encapsulated message containing an 1435 audio message. That is, the encapsulation of the message is 1436 considered to be "transparent". 1438 When generating and reassembling the parts of a 1439 message/partial message, the headers of the encapsulated 1440 message must be merged with the headers of the enclosing 1441 entities. In this process the following rules must be 1442 observed: 1444 (1) All of the header fields from the initial enclosing 1445 entity (part one), except those that start with 1446 "Content-" and the specific header fields "Subject", 1447 "Message-ID", "Encrypted", and "MIME-Version", must be 1448 copied, in order, to the new message. 1450 (2) The header fields in the enclosed message which start 1451 with "Content-", plus the "Subject", "Message-ID", 1452 "Encrypted", and "MIME-Version" fields, must be 1453 appended, in order, to the header fields of the new 1454 message. Any header fields in the enclosed message 1455 which do not start with "Content-" (except for the 1456 "Subject", "Message-ID", "Encrypted", and "MIME- 1457 Version" fields) will be ignored and dropped. 1459 (3) All of the header fields from the second and any 1460 subsequent messages are discarded by the reassembly 1461 process. 1463 7.2.2.2. Fragmentation and Reassembly Example 1465 If an audio message is broken into two parts, the first part 1466 might look something like this: 1468 X-Weird-Header-1: Foo 1469 From: Bill@host.com 1470 To: joe@otherhost.com 1471 Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) 1472 Subject: Audio mail (part 1 of 2) 1473 Message-ID: 1474 MIME-Version: 1.0 1475 Content-type: message/partial; id="ABC@host.com"; 1476 number=1; total=2 1478 X-Weird-Header-1: Bar 1479 X-Weird-Header-2: Hello 1480 Message-ID: 1481 Subject: Audio mail 1482 MIME-Version: 1.0 1483 Content-type: audio/basic 1484 Content-transfer-encoding: base64 1486 ... first half of encoded audio data goes here ... 1488 and the second half might look something like this: 1490 From: Bill@host.com 1491 To: joe@otherhost.com 1492 Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) 1493 Subject: Audio mail (part 2 of 2) 1494 MIME-Version: 1.0 1495 Message-ID: 1496 Content-type: message/partial; 1497 id="ABC@host.com"; number=2; total=2 1499 ... second half of encoded audio data goes here ... 1501 Then, when the fragmented message is reassembled, the 1502 resulting message to be displayed to the user should look 1503 something like this: 1505 X-Weird-Header-1: Foo 1506 From: Bill@host.com 1507 To: joe@otherhost.com 1508 Date: Fri, 26 Mar 1993 12:59:38 -0500 (EST) 1509 Subject: Audio mail 1510 Message-ID: 1511 MIME-Version: 1.0 1512 Content-type: audio/basic 1513 Content-transfer-encoding: base64 1515 ... first half of encoded audio data goes here ... 1516 ... second half of encoded audio data goes here ... 1518 Because data of type "message" may never be encoded in base64 1519 or quoted-printable, a problem might arise if message/partial 1520 entities are constructed in an environment that supports 1521 binary or 8-bit transport. The problem is that the binary 1522 data would be split into multiple message/partial messages, 1523 each of them requiring binary transport. If such messages 1524 were encountered at a gateway into a 7-bit transport 1525 environment, there would be no way to properly encode them for 1526 the 7-bit world, aside from waiting for all of the fragments, 1527 reassembling the inner message, and then encoding the 1528 reassembled data in base64 or quoted-printable. Since it is 1529 possible that different fragments might go through different 1530 gateways, even this is not an acceptable solution. For this 1531 reason, it is specified that MIME entities of type 1532 message/partial must always have a content-transfer-encoding 1533 of 7-bit (the default). In particular, even in environments 1534 that support binary or 8-bit transport, the use of a content- 1535 transfer-encoding of "8bit" or "binary" is explicitly 1536 prohibited for entities of type message/partial. 1538 Because some message transfer agents may choose to 1539 automatically fragment large messages, and because such agents 1540 may use very different fragmentation thresholds, it is 1541 possible that the pieces of a partial message, upon 1542 reassembly, may prove themselves to comprise a partial 1543 message. This is explicitly permitted. 1545 The inclusion of a "References" field in the headers of the 1546 second and subsequent pieces of a fragmented message that 1547 references the Message-Id on the previous piece may be of 1548 benefit to mail readers that understand and track references. 1549 However, the generation of such "References" fields is 1550 entirely optional. 1552 Finally, it should be noted that the "Encrypted" header field 1553 has been made obsolete by Privacy Enhanced Messaging (PEM) 1554 [RFC1421, RFC1422, RFC1423, and RFC1424], but the rules above 1555 are nevertheless believed to describe the correct way to treat 1556 it if it is encountered in the context of conversion to and 1557 from message/partial fragments. 1559 7.2.3. External-Body Subtype 1561 The external-body subtype indicates that the actual body data 1562 are not included, but merely referenced. In this case, the 1563 parameters describe a mechanism for accessing the external 1564 data. 1566 When an entity is of type "message/external-body", it consists 1567 of a header, two consecutive CRLFs, and the message header for 1568 the encapsulated message. If another pair of consecutive 1569 CRLFs appears, this of course ends the message header for the 1570 encapsulated message. However, since the encapsulated 1571 message's body is itself external, it does NOT appear in the 1572 area that follows. For example, consider the following 1573 message: 1575 Content-type: message/external-body; 1576 access-type=local-file; 1577 name="/u/nsb/Me.jpeg" 1579 Content-type: image/jpeg 1580 Content-ID: 1581 Content-Transfer-Encoding: binary 1583 THIS IS NOT REALLY THE BODY! 1585 The area at the end, which might be called the "phantom body", 1586 is ignored for most external-body messages. However, it may 1587 be used to contain auxiliary information for some such 1588 messages, as indeed it is when the access-type is "mail- 1589 server". The only access-type defined in this document that 1590 uses the phantom body is "mail-server", but other access-types 1591 may be defined in the future in other documents that use this 1592 area. 1594 The encapsulated headers in ALL message/external-body entities 1595 MUST include a Content-ID header field to give a unique 1596 identifier by which to reference the data. This identifier 1597 may be used for caching mechanisms, and for recognizing the 1598 receipt of the data when the access-type is "mail-server". 1600 Note that, as specified here, the tokens that describe 1601 external-body data, such as file names and mail server 1602 commands, are required to be in the US-ASCII character set. 1603 If this proves problematic in practice, a new mechanism may be 1604 required as a future extension to MIME, either as newly 1605 defined access-types for message/external-body or by some 1606 other mechanism. 1608 As with message/partial, MIME entities of type 1609 message/external-body MUST have a content-transfer-encoding of 1610 7-bit (the default). In particular, even in environments that 1611 support binary or 8-bit transport, the use of a content- 1612 transfer-encoding of "8bit" or "binary" is explicitly 1613 prohibited for entities of type message/external-body. 1615 7.2.3.1. General External-Body Parameters 1617 The parameters that may be used with any message/external-body 1618 are: 1620 (1) ACCESS-TYPE -- A word indicating the supported access 1621 mechanism by which the file or data may be obtained. 1622 This word is not case sensitive. Values include, but 1623 are not limited to, "FTP", "ANON-FTP", "TFTP", "LOCAL- 1624 FILE", and "MAIL-SERVER". Future values, except for 1625 experimental values beginning with "X-", must be 1626 registered with IANA, as described in RFC MIME-REG. 1627 This parameter is unconditionally mandatory and MUST be 1628 present on EVERY message/external-body. 1630 (2) EXPIRATION -- The date (in the RFC 822 "date-time" 1631 syntax, as extended by RFC 1123 to permit 4 digits in 1632 the year field) after which the existence of the 1633 external data is not guaranteed. This parameter may be 1634 used with ANY access-type and is ALWAYS optional. 1636 (3) SIZE -- The size (in octets) of the data. The intent 1637 of this parameter is to help the recipient decide 1638 whether or not to expend the necessary resources to 1639 retrieve the external data. Note that this describes 1640 the size of the data in its canonical form, that is, 1641 before any Content-Transfer-Encoding has been applied 1642 or after the data have been decoded. This parameter 1643 may be used with ANY access-type and is ALWAYS 1644 optional. 1646 (4) PERMISSION -- A case-insensitive field that indicates 1647 whether or not it is expected that clients might also 1648 attempt to overwrite the data. By default, or if 1649 permission is "read", the assumption is that they are 1650 not, and that if the data is retrieved once, it is 1651 never needed again. If PERMISSION is "read-write", 1652 this assumption is invalid, and any local copy must be 1653 considered no more than a cache. "Read" and "Read- 1654 write" are the only defined values of permission. This 1655 parameter may be used with ANY access-type and is 1656 ALWAYS optional. 1658 The precise semantics of the access-types defined here are 1659 described in the sections that follow. 1661 7.2.3.2. The 'ftp' and 'tftp' Access-Types 1663 An access-type of FTP or TFTP indicates that the message body 1664 is accessible as a file using the FTP [RFC-959] or TFTP [RFC- 1665 783] protocols, respectively. For these access-types, the 1666 following additional parameters are mandatory: 1668 (1) NAME -- The name of the file that contains the actual 1669 body data. 1671 (2) SITE -- A machine from which the file may be obtained, 1672 using the given protocol. This must be a fully 1673 qualified domain name, not a nickname. 1675 (3) Before any data are retrieved, using FTP, the user will 1676 generally need to be asked to provide a login id and a 1677 password for the machine named by the site parameter. 1678 For security reasons, such an id and password are not 1679 specified as content-type parameters, but must be 1680 obtained from the user. 1682 In addition, the following parameters are optional: 1684 (1) DIRECTORY -- A directory from which the data named by 1685 NAME should be retrieved. 1687 (2) MODE -- A case-insensitive string indicating the mode 1688 to be used when retrieving the information. The valid 1689 values for access-type "TFTP" are "NETASCII", "OCTET", 1690 and "MAIL", as specified by the TFTP protocol [RFC- 1691 783]. The valid values for access-type "FTP" are 1692 "ASCII", "EBCDIC", "IMAGE", and "LOCALn" where "n" is a 1693 decimal integer, typically 8. These correspond to the 1694 representation types "A" "E" "I" and "L n" as specified 1695 by the FTP protocol [RFC-959]. Note that "BINARY" and 1696 "TENEX" are not valid values for MODE and that "OCTET" 1697 or "IMAGE" or "LOCAL8" should be used instead. IF MODE 1698 is not specified, the default value is "NETASCII" for 1699 TFTP and "ASCII" otherwise. 1701 7.2.3.3. The 'anon-ftp' Access-Type 1703 The "anon-ftp" access-type is identical to the "ftp" access 1704 type, except that the user need not be asked to provide a name 1705 and password for the specified site. Instead, the ftp 1706 protocol will be used with login "anonymous" and a password 1707 that corresponds to the user's mail address. 1709 7.2.3.4. The 'local-file' Access-Type 1711 An access-type of "local-file" indicates that the actual body 1712 is accessible as a file on the local machine. Two additional 1713 parameters are defined for this access type: 1715 (1) NAME -- The name of the file that contains the actual 1716 body data. This parameter is mandatory for the 1717 "local-file" access-type. 1719 (2) SITE -- A domain specifier for a machine or set of 1720 machines that are known to have access to the data 1721 file. This optional parameter is used to describe the 1722 locality of reference for the data, that is, the site 1723 or sites at which the file is expected to be visible. 1724 Asterisks may be used for wildcard matching to a part 1725 of a domain name, such as "*.bellcore.com", to indicate 1726 a set of machines on which the data should be directly 1727 visible, while a single asterisk may be used to 1728 indicate a file that is expected to be universally 1729 available, e.g., via a global file system. 1731 7.2.3.5. The 'mail-server' Access-Type 1733 The "mail-server" access-type indicates that the actual body 1734 is available from a mail server. Two additional parameters 1735 are defined for this access-type: 1737 (1) SERVER -- The email address of the mail server from 1738 which the actual body data can be obtained. This 1739 parameter is mandatory for the "mail-server" access- 1740 type. 1742 (2) SUBJECT -- The subject that is to be used in the mail 1743 that is sent to obtain the data. Note that keying mail 1744 servers on Subject lines is NOT recommended, but such 1745 mail servers are known to exist. This is an optional 1746 parameter. 1748 Because mail servers accept a variety of syntaxes, some of 1749 which is multiline, the full command to be sent to a mail 1750 server is not included as a parameter in the content-type 1751 header field. Instead, it is provided as the "phantom body" 1752 when the media type is message/external-body and the access- 1753 type is mail-server. 1755 Note that MIME does not define a mail server syntax. Rather, 1756 it allows the inclusion of arbitrary mail server commands in 1757 the phantom body. Implementations must include the phantom 1758 body in the body of the message it sends to the mail server 1759 address to retrieve the relevant data. 1761 Unlike other access-types, mail-server access is asynchronous 1762 and will happen at an unpredictable time in the future. For 1763 this reason, it is important that there be a mechanism by 1764 which the returned data can be matched up with the original 1765 message/external-body entity. MIME mail servers must use the 1766 same Content-ID field on the returned message that was used in 1767 the original message/external-body entity, to facilitate such 1768 matching. 1770 7.2.3.6. External-Body Security Issues 1772 Message/external-body entities give rise to two important 1773 security issues: 1775 (1) Accessing data via a message/external-body reference 1776 effectively results in the message recipient performing 1777 an operation that was specified by the message 1778 originator. It is therefore possible for the message 1779 originator to trick a recipient into doing something 1780 they would not have done otherwise. For example, an 1781 originator could specify a action that attempts 1782 retrieval of material that the recipient is not 1783 authorized to obtain, causing the recipient to 1784 unwittingly violate some security policy. For this 1785 reason, user agents capable of resolving external 1786 references must always take steps to describe the 1787 action they are to take to the recipient and ask for 1788 explicit permisssion prior to performing it. 1790 The 'mail-server' access-type is particularly 1791 vulnerable, in that it causes the recipient to send a 1792 new message whose contents are specified by the 1793 original message's originator. Given the potential for 1794 abuse, any such request messages that are constructed 1795 should contain a clear indication that they were 1796 generated automatically (e.g. in a Comments: header 1797 field) in an attempt to resolve a MIME 1798 message/external-body reference. 1800 (2) MIME will sometimes be used in environments that 1801 provide some guarantee of message integrity and 1802 authenticity. If present, such guarantees may apply 1803 only to the actual direct content of messages -- they 1804 may or may not apply to data accessed through MIME's 1805 message/external-body mechanism. In particular, it may 1806 be possible to subvert certain access mechanisms even 1807 when the messaging system itself is secure. 1809 It should be noted that this problem exists either with 1810 or without the availabilty of MIME mechanisms. A 1811 casual reference to an FTP site containing a document 1812 in the text of a secure message brings up similar 1813 issues -- the only difference is that MIME provides for 1814 automatic retrieval of such material, and users may 1815 place unwarranted trust is such automatic retrieval 1816 mechanisms. 1818 7.2.3.7. Examples and Further Explanations 1820 When the external-body mechanism is used in conjunction with 1821 the multipart/alternative media type it extends the 1822 functionality of multipart/alternative to include the case 1823 where the same object is provided in the same format but via 1824 different accces mechanisms. When this is done the originator 1825 of the message must order the part first in terms of preferred 1826 formats and then by preferred access mechanisms. The 1827 recipient's viewer should then evaluate the list both in terms 1828 of format and access mechanisms. 1830 With the emerging possibility of very wide-area file systems, 1831 it becomes very hard to know in advance the set of machines 1832 where a file will and will not be accessible directly from the 1833 file system. Therefore it may make sense to provide both a 1834 file name, to be tried directly, and the name of one or more 1835 sites from which the file is known to be accessible. An 1836 implementation can try to retrieve remote files using FTP or 1837 any other protocol, using anonymous file retrieval or 1838 prompting the user for the necessary name and password. If an 1839 external body is accessible via multiple mechanisms, the 1840 sender may include multiple parts of type message/external- 1841 body within an entity of type multipart/alternative. 1843 However, the external-body mechanism is not intended to be 1844 limited to file retrieval, as shown by the mail-server 1845 access-type. Beyond this, one can imagine, for example, using 1846 a video server for external references to video clips. 1848 The embedded message header fields which appear in the body of 1849 the message/external-body data must be used to declare the 1850 media type of the external body if it is anything other than 1851 plain US-ASCII text, since the external body does not have a 1852 header section to declare its type. Similarly, any Content- 1853 transfer-encoding other than "7bit" must also be declared 1854 here. Thus a complete message/external-body message, 1855 referring to a document in PostScript format, might look like 1856 this: 1858 From: Whomever 1859 To: Someone 1860 Date: Whenever 1861 Subject: whatever 1862 MIME-Version: 1.0 1863 Message-ID: 1864 Content-Type: multipart/alternative; boundary=42 1865 Content-ID: 1867 --42 1868 Content-Type: message/external-body; name="BodyFormats.ps"; 1869 site="thumper.bellcore.com"; mode="image"; 1870 access-type=ANON-FTP; directory="pub"; 1871 expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" 1873 Content-type: application/postscript 1874 Content-ID: 1876 --42 1877 Content-Type: message/external-body; access-type=local-file; 1878 name="/u/nsb/writing/rfcs/RFC-MIME.ps"; 1879 site="thumper.bellcore.com"; 1880 expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" 1882 Content-type: application/postscript 1883 Content-ID: 1885 --42 1886 Content-Type: message/external-body; 1887 access-type=mail-server 1888 server="listserv@bogus.bitnet"; 1889 expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" 1891 Content-type: application/postscript 1892 Content-ID: 1894 get RFC-MIME.DOC 1896 --42-- 1898 Note that in the above examples, the default Content- 1899 transfer-encoding of "7bit" is assumed for the external 1900 postscript data. 1902 Like the message/partial type, the message/external-body media 1903 type is intended to be transparent, that is, to convey the 1904 data type in the external body rather than to convey a message 1905 with a body of that type. Thus the headers on the outer and 1906 inner parts must be merged using the same rules as for 1907 message/partial. In particular, this means that the Content- 1908 type header is overridden, but the From and Subject headers 1909 are preserved. 1911 Note that since the external bodies are not transported along 1912 with the external body reference, they need not conform to 1913 transport limitations that apply to the reference itself. In 1914 particular, Internet mail transports may impose 7-bit and line 1915 length limits, but these do not automatically apply to binary 1916 external body references. Thus a Content-Transfer-Encoding is 1917 not generally necessary, though it is permitted. 1919 Note that the body of a message of type "message/external- 1920 body" is governed by the basic syntax for an RFC 822 message. 1921 In particular, anything before the first consecutive pair of 1922 CRLFs is header information, while anything after it is body 1923 information, which is ignored for most access-types. 1925 7.2.4. Other Message Subtypes 1927 MIME implementations must in general treat unrecognized 1928 subtypes of message as being equivalent to 1929 "application/octet-stream". 1931 8. Experimental Media Type Values 1933 A media type value beginning with the characters "X-" is a 1934 private value, to be used by consenting systems by mutual 1935 agreement. Any format without a rigorous and public 1936 definition must be named with an "X-" prefix, and publicly 1937 specified values shall never begin with "X-". (Older versions 1938 of the widely used Andrew system use the "X-BE2" name, so new 1939 systems should probably choose a different name.) 1941 In general, the use of "X-" top-level types is strongly 1942 discouraged. Implementors should invent subtypes of the 1943 existing types whenever possible. In many cases, a subtype of 1944 application will be more appropriate than a new top-level 1945 type. 1947 9. Summary 1949 The five discrete media types provide provide a standardized 1950 mechanism for tagging messages or body parts as audio, image, 1951 or several other kinds of data. The composite "multipart" and 1952 "message" media types allow mixing and hierarchical 1953 structuring of objects of different types in a single message. 1954 A distinguished parameter syntax allows further specification 1955 of data format details, particularly the specification of 1956 alternate character sets. Additional optional header fields 1957 provide mechanisms for certain extensions deemed desirable by 1958 many implementors. Finally, a number of useful media types are 1959 defined for general use by consenting user agents, notably 1960 message/partial, and message/external-body. 1962 10. Security Considerations 1964 Security issues are discussed in the context of the 1965 application/postscript type, the message/external-body type, 1966 and in RFC MIME-REG. Implementors should pay special 1967 attention to the security implications of any media types that 1968 can cause the remote execution of any actions in the 1969 recipient's environment. In such cases, the discussion of the 1970 application/postscript type may serve as a model for 1971 considering other media types with remote execution 1972 capabilities. 1974 11. Authors' Addresses 1976 For more information, the authors of this document are best 1977 contacted via Internet mail: 1979 Nathaniel S. Borenstein 1980 First Virtual Holdings 1981 25 Washington Avenue 1982 Morristown, NJ 07960 1983 USA 1985 Email: nsb@nsb.fv.com 1986 Phone: +1 201 540 8967 1987 Fax: +1 201 993 3032 1989 Ned Freed 1990 Innosoft International, Inc. 1991 1050 East Garvey Avenue South 1992 West Covina, CA 91790 1993 USA 1995 Email: ned@innosoft.com 1996 Phone: +1 818 919 3600 1997 Fax: +1 818 919 3614 1999 MIME is a result of the work of the Internet Engineering Task 2000 Force Working Group on Email Extensions. The chairman of that 2001 group, Greg Vaudreuil, may be reached at: 2003 Gregory M. Vaudreuil 2004 Tigon Corporation 2005 17060 Dallas Parkway 2006 Dallas Texas, 75248 2008 Email: greg.vaudreuil@ons.octel.com 2009 Phone: +1 214 733 2722 2010 Appendix A -- Collected Grammar 2012 This appendix contains the complete BNF grammar for all the 2013 syntax specified by this document. 2015 By itself, however, this grammar is incomplete. It refers to 2016 several entities that are defined by RFC 822. Rather than 2017 reproduce those definitions here, and risk unintentional 2018 differences between the two, this document simply refers the 2019 reader to RFC 822 for the remaining definitions. Wherever a 2020 term is undefined, it refers to the RFC 822 definition. 2022 boundary := 0*69 bcharsnospace 2024 bchars := bcharsnospace / " " 2026 bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / 2027 "+" / "_" / "," / "-" / "." / 2028 "/" / ":" / "=" / "?" 2030 body-part := <"message" as defined in RFC 822, with all 2031 header fields optional, not starting with the 2032 specified dash-boundary, and with the 2033 delimiter not occurring anywhere in the 2034 message body. Note that the semantics of a 2035 part differ from the semantics of a message, 2036 as described in the text.> 2038 close-delimiter := delimiter "--" 2040 dash-boundary := "--" boundary 2041 ; boundary taken from the value of 2042 ; boundary parameter of the 2043 ; Content-Type field. 2045 delimiter := CRLF dash-boundary 2047 discard-text := *(*text CRLF) 2048 ; To be ignored upon receipt. 2050 encapsulation := delimiter transport-padding 2051 CRLF body-part 2053 epilogue := discard-text 2055 multipart-body := [preamble CRLF] 2056 dash-boundary transport-padding CRLF 2057 body-part *encapsulation 2058 close-delimiter transport-padding 2059 [CRLF epilogue] 2061 preamble := discard-text 2063 transport-padding := *LWSP-char 2064 ; Composers MUST NOT generate 2065 ; non-zero length transport 2066 ; padding, but receivers MUST 2067 ; be able to handle padding 2068 ; added by message transports.