| 1 |
<pre> Network Working Group N. Borenstein, Bellcore |
| 2 |
Request for Comments: 1341 N. Freed, Innosoft |
| 3 |
June 1992 |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
<span class="h1">MIME (Multipurpose Internet Mail Extensions):</span> |
| 8 |
|
| 9 |
|
| 10 |
Mechanisms for Specifying and Describing |
| 11 |
the Format of Internet Message Bodies |
| 12 |
|
| 13 |
|
| 14 |
Status of this Memo |
| 15 |
|
| 16 |
This RFC specifies an IAB standards track protocol for the |
| 17 |
Internet community, and requests discussion and suggestions |
| 18 |
for improvements. Please refer to the current edition of |
| 19 |
the "IAB Official Protocol Standards" for the |
| 20 |
standardization state and status of this protocol. |
| 21 |
Distribution of this memo is unlimited. |
| 22 |
|
| 23 |
Abstract |
| 24 |
|
| 25 |
<a href="./rfc822">RFC 822</a> defines a message representation protocol which |
| 26 |
specifies considerable detail about message headers, but |
| 27 |
which leaves the message content, or message body, as flat |
| 28 |
ASCII text. This document redefines the format of message |
| 29 |
bodies to allow multi-part textual and non-textual message |
| 30 |
bodies to be represented and exchanged without loss of |
| 31 |
information. This is based on earlier work documented in |
| 32 |
RFC 934 and RFC 1049, but extends and revises that work. |
| 33 |
Because <a href="./rfc822">RFC 822</a> said so little about message bodies, this |
| 34 |
document is largely orthogonal to (rather than a revision |
| 35 |
of) <a href="./rfc822">RFC 822</a>. |
| 36 |
|
| 37 |
In particular, this document is designed to provide |
| 38 |
facilities to include multiple objects in a single message, |
| 39 |
to represent body text in character sets other than US- |
| 40 |
ASCII, to represent formatted multi-font text messages, to |
| 41 |
represent non-textual material such as images and audio |
| 42 |
fragments, and generally to facilitate later extensions |
| 43 |
defining new types of Internet mail for use by cooperating |
| 44 |
mail agents. |
| 45 |
|
| 46 |
This document does NOT extend Internet mail header fields to |
| 47 |
permit anything other than US-ASCII text data. It is |
| 48 |
recognized that such extensions are necessary, and they are |
| 49 |
the subject of a companion document [RFC -1342]. |
| 50 |
|
| 51 |
A table of contents appears at the end of this document. |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
<span class="grey"> Borenstein & Freed [Page i]</span></pre> |
| 59 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-1" ></span> |
| 60 |
<span class="grey"> 1 Introduction</span> |
| 61 |
|
| 62 |
Since its publication in 1982, <a href="./rfc822">RFC 822</a> [<a href="./rfc822" title="UDEL">RFC-822</a>] has defined |
| 63 |
the standard format of textual mail messages on the |
| 64 |
Internet. Its success has been such that the <a href="./rfc822">RFC 822</a> format |
| 65 |
has been adopted, wholly or partially, well beyond the |
| 66 |
confines of the Internet and the Internet SMTP transport |
| 67 |
defined by <a href="./rfc821">RFC 821</a> [<a href="./rfc821" title="USC/Information Sciences Institute">RFC-821</a>]. As the format has seen wider |
| 68 |
use, a number of limitations have proven increasingly |
| 69 |
restrictive for the user community. |
| 70 |
|
| 71 |
<a href="./rfc822">RFC 822</a> was intended to specify a format for text messages. |
| 72 |
As such, non-text messages, such as multimedia messages that |
| 73 |
might include audio or images, are simply not mentioned. |
| 74 |
Even in the case of text, however, <a href="./rfc822">RFC 822</a> is inadequate for |
| 75 |
the needs of mail users whose languages require the use of |
| 76 |
character sets richer than US ASCII [<a href="#ref-US-ASCII">US-ASCII</a>]. Since <a href="./rfc822">RFC</a> |
| 77 |
<a href="./rfc822">822</a> does not specify mechanisms for mail containing audio, |
| 78 |
video, Asian language text, or even text in most European |
| 79 |
languages, additional specifications are needed |
| 80 |
|
| 81 |
One of the notable limitations of RFC 821/822 based mail |
| 82 |
systems is the fact that they limit the contents of |
| 83 |
electronic mail messages to relatively short lines of |
| 84 |
seven-bit ASCII. This forces users to convert any non- |
| 85 |
textual data that they may wish to send into seven-bit bytes |
| 86 |
representable as printable ASCII characters before invoking |
| 87 |
a local mail UA (User Agent, a program with which human |
| 88 |
users send and receive mail). Examples of such encodings |
| 89 |
currently used in the Internet include pure hexadecimal, |
| 90 |
uuencode, the 3-in-4 base 64 scheme specified in <a href="./rfc1113">RFC 1113</a>, |
| 91 |
the Andrew Toolkit Representation [<a href="#ref-ATK" title="Nathaniel S.">ATK</a>], and many others. |
| 92 |
|
| 93 |
The limitations of <a href="./rfc822">RFC 822</a> mail become even more apparent as |
| 94 |
gateways are designed to allow for the exchange of mail |
| 95 |
messages between <a href="./rfc822">RFC 822</a> hosts and X.400 hosts. X.400 [<a href="#ref-X400" title=""Message Handling Systems, X.400"">X400</a>] |
| 96 |
specifies mechanisms for the inclusion of non-textual body |
| 97 |
parts within electronic mail messages. The current |
| 98 |
standards for the mapping of X.400 messages to <a href="./rfc822">RFC 822</a> |
| 99 |
messages specify that either X.400 non-textual body parts |
| 100 |
should be converted to (not encoded in) an ASCII format, or |
| 101 |
that they should be discarded, notifying the RFC 822 user |
| 102 |
that discarding has occurred. This is clearly undesirable, |
| 103 |
as information that a user may wish to receive is lost. |
| 104 |
Even though a user's UA may not have the capability of |
| 105 |
dealing with the non-textual body part, the user might have |
| 106 |
some mechanism external to the UA that can extract useful |
| 107 |
information from the body part. Moreover, it does not allow |
| 108 |
for the fact that the message may eventually be gatewayed |
| 109 |
back into an X.400 message handling system (i.e., the X.400 |
| 110 |
message is "tunneled" through Internet mail), where the |
| 111 |
non-textual information would definitely become useful |
| 112 |
again. |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
<span class="grey"> Borenstein & Freed [Page 1]</span></pre> |
| 118 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span> |
| 119 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 120 |
|
| 121 |
|
| 122 |
This document describes several mechanisms that combine to |
| 123 |
solve most of these problems without introducing any serious |
| 124 |
incompatibilities with the existing world of RFC 822 mail. |
| 125 |
In particular, it describes: |
| 126 |
|
| 127 |
1. A MIME-Version header field, which uses a version number |
| 128 |
to declare a message to be conformant with this |
| 129 |
specification and allows mail processing agents to |
| 130 |
distinguish between such messages and those generated |
| 131 |
by older or non-conformant software, which is presumed |
| 132 |
to lack such a field. |
| 133 |
|
| 134 |
2. A Content-Type header field, generalized from RFC 1049 |
| 135 |
[<a href="./rfc1049" title="CMU">RFC-1049</a>], which can be used to specify the type and |
| 136 |
subtype of data in the body of a message and to fully |
| 137 |
specify the native representation (encoding) of such |
| 138 |
data. |
| 139 |
|
| 140 |
2.a. A "text" Content-Type value, which can be used to |
| 141 |
represent textual information in a number of |
| 142 |
character sets and formatted text description |
| 143 |
languages in a standardized manner. |
| 144 |
|
| 145 |
2.b. A "multipart" Content-Type value, which can be |
| 146 |
used to combine several body parts, possibly of |
| 147 |
differing types of data, into a single message. |
| 148 |
|
| 149 |
2.c. An "application" Content-Type value, which can be |
| 150 |
used to transmit application data or binary data, |
| 151 |
and hence, among other uses, to implement an |
| 152 |
electronic mail file transfer service. |
| 153 |
|
| 154 |
2.d. A "message" Content-Type value, for encapsulating |
| 155 |
a mail message. |
| 156 |
|
| 157 |
2.e An "image" Content-Type value, for transmitting |
| 158 |
still image (picture) data. |
| 159 |
|
| 160 |
2.f. An "audio" Content-Type value, for transmitting |
| 161 |
audio or voice data. |
| 162 |
|
| 163 |
2.g. A "video" Content-Type value, for transmitting |
| 164 |
video or moving image data, possibly with audio as |
| 165 |
part of the composite video data format. |
| 166 |
|
| 167 |
3. A Content-Transfer-Encoding header field, which can be |
| 168 |
used to specify an auxiliary encoding that was applied |
| 169 |
to the data in order to allow it to pass through mail |
| 170 |
transport mechanisms which may have data or character |
| 171 |
set limitations. |
| 172 |
|
| 173 |
4. Two optional header fields that can be used to further |
| 174 |
describe the data in a message body, the Content-ID and |
| 175 |
Content-Description header fields. |
| 176 |
|
| 177 |
|
| 178 |
|
| 179 |
<span class="grey"> Borenstein & Freed [Page 2]</span></pre> |
| 180 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span> |
| 181 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 182 |
|
| 183 |
|
| 184 |
MIME has been carefully designed as an extensible mechanism, |
| 185 |
and it is expected that the set of content-type/subtype |
| 186 |
pairs and their associated parameters will grow |
| 187 |
significantly with time. Several other MIME fields, notably |
| 188 |
including character set names, are likely to have new values |
| 189 |
defined over time. In order to ensure that the set of such |
| 190 |
values is developed in an orderly, well-specified, and |
| 191 |
public manner, MIME defines a registration process which |
| 192 |
uses the Internet Assigned Numbers Authority (IANA) as a |
| 193 |
central registry for such values. Appendix F provides |
| 194 |
details about how IANA registration is accomplished. |
| 195 |
|
| 196 |
Finally, to specify and promote interoperability, <a href="#appendix-A">Appendix A</a> |
| 197 |
of this document provides a basic applicability statement |
| 198 |
for a subset of the above mechanisms that defines a minimal |
| 199 |
level of "conformance" with this document. |
| 200 |
|
| 201 |
HISTORICAL NOTE: Several of the mechanisms described in |
| 202 |
this document may seem somewhat strange or even baroque at |
| 203 |
first reading. It is important to note that compatibility |
| 204 |
with existing standards AND robustness across existing |
| 205 |
practice were two of the highest priorities of the working |
| 206 |
group that developed this document. In particular, |
| 207 |
compatibility was always favored over elegance. |
| 208 |
|
| 209 |
2 Notations, Conventions, and Generic BNF Grammar |
| 210 |
|
| 211 |
This document is being published in two versions, one as |
| 212 |
plain ASCII text and one as PostScript. The latter is |
| 213 |
recommended, though the textual contents are identical. An |
| 214 |
Andrew-format copy of this document is also available from |
| 215 |
the first author (Borenstein). |
| 216 |
|
| 217 |
Although the mechanisms specified in this document are all |
| 218 |
described in prose, most are also described formally in the |
| 219 |
modified BNF notation of <a href="./rfc822">RFC 822</a>. Implementors will need to |
| 220 |
be familiar with this notation in order to understand this |
| 221 |
specification, and are referred to <a href="./rfc822">RFC 822</a> for a complete |
| 222 |
explanation of the modified BNF notation. |
| 223 |
|
| 224 |
Some of the modified BNF in this document makes reference to |
| 225 |
syntactic entities that are defined in <a href="./rfc822">RFC 822</a> and not in |
| 226 |
this document. A complete formal grammar, then, is obtained |
| 227 |
by combining the collected grammar appendix of this document |
| 228 |
with that of <a href="./rfc822">RFC 822</a>. |
| 229 |
|
| 230 |
The term CRLF, in this document, refers to the sequence of |
| 231 |
the two ASCII characters CR (13) and LF (10) which, taken |
| 232 |
together, in this order, denote a line break in RFC 822 |
| 233 |
mail. |
| 234 |
|
| 235 |
The term "character set", wherever it is used in this |
| 236 |
document, refers to a coded character set, in the sense of |
| 237 |
ISO character set standardization work, and must not be |
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
<span class="grey"> Borenstein & Freed [Page 3]</span></pre> |
| 242 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span> |
| 243 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 244 |
|
| 245 |
|
| 246 |
misinterpreted as meaning "a set of characters." |
| 247 |
|
| 248 |
The term "message", when not further qualified, means either |
| 249 |
the (complete or "top-level") message being transferred on a |
| 250 |
network, or a message encapsulated in a body of type |
| 251 |
"message". |
| 252 |
|
| 253 |
The term "body part", in this document, means one of the |
| 254 |
parts of the body of a multipart entity. A body part has a |
| 255 |
header and a body, so it makes sense to speak about the body |
| 256 |
of a body part. |
| 257 |
|
| 258 |
The term "entity", in this document, means either a message |
| 259 |
or a body part. All kinds of entities share the property |
| 260 |
that they have a header and a body. |
| 261 |
|
| 262 |
The term "body", when not further qualified, means the body |
| 263 |
of an entity, that is the body of either a message or of a |
| 264 |
body part. |
| 265 |
|
| 266 |
Note : the previous four definitions are clearly circular. |
| 267 |
This is unavoidable, since the overal structure of a MIME |
| 268 |
message is indeed recursive. |
| 269 |
|
| 270 |
In this document, all numeric and octet values are given in |
| 271 |
decimal notation. |
| 272 |
|
| 273 |
It must be noted that Content-Type values, subtypes, and |
| 274 |
parameter names as defined in this document are case- |
| 275 |
insensitive. However, parameter values are case-sensitive |
| 276 |
unless otherwise specified for the specific parameter. |
| 277 |
|
| 278 |
FORMATTING NOTE: This document has been carefully formatted |
| 279 |
for ease of reading. The PostScript version of this |
| 280 |
document, in particular, places notes like this one, which |
| 281 |
may be skipped by the reader, in a smaller, italicized, |
| 282 |
font, and indents it as well. In the text version, only the |
| 283 |
indentation is preserved, so if you are reading the text |
| 284 |
version of this you might consider using the PostScript |
| 285 |
version instead. However, all such notes will be indented |
| 286 |
and preceded by "NOTE:" or some similar introduction, even |
| 287 |
in the text version. |
| 288 |
|
| 289 |
The primary purpose of these non-essential notes is to |
| 290 |
convey information about the rationale of this document, or |
| 291 |
to place this document in the proper historical or |
| 292 |
evolutionary context. Such information may be skipped by |
| 293 |
those who are focused entirely on building a compliant |
| 294 |
implementation, but may be of use to those who wish to |
| 295 |
understand why this document is written as it is. |
| 296 |
|
| 297 |
For ease of recognition, all BNF definitions have been |
| 298 |
placed in a fixed-width font in the PostScript version of |
| 299 |
this document. |
| 300 |
|
| 301 |
|
| 302 |
|
| 303 |
<span class="grey"> Borenstein & Freed [Page 4]</span></pre> |
| 304 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span> |
| 305 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 306 |
|
| 307 |
|
| 308 |
3 The MIME-Version Header Field |
| 309 |
|
| 310 |
Since <a href="./rfc822">RFC 822</a> was published in 1982, there has really been |
| 311 |
only one format standard for Internet messages, and there |
| 312 |
has been little perceived need to declare the format |
| 313 |
standard in use. This document is an independent document |
| 314 |
that complements <a href="./rfc822">RFC 822</a>. Although the extensions in this |
| 315 |
document have been defined in such a way as to be compatible |
| 316 |
with <a href="./rfc822">RFC 822</a>, there are still circumstances in which it |
| 317 |
might be desirable for a mail-processing agent to know |
| 318 |
whether a message was composed with the new standard in |
| 319 |
mind. |
| 320 |
|
| 321 |
Therefore, this document defines a new header field, "MIME- |
| 322 |
Version", which is to be used to declare the version of the |
| 323 |
Internet message body format standard in use. |
| 324 |
|
| 325 |
Messages composed in accordance with this document MUST |
| 326 |
include such a header field, with the following verbatim |
| 327 |
text: |
| 328 |
|
| 329 |
MIME-Version: 1.0 |
| 330 |
|
| 331 |
The presence of this header field is an assertion that the |
| 332 |
message has been composed in compliance with this document. |
| 333 |
|
| 334 |
Since it is possible that a future document might extend the |
| 335 |
message format standard again, a formal BNF is given for the |
| 336 |
content of the MIME-Version field: |
| 337 |
|
| 338 |
MIME-Version := text |
| 339 |
|
| 340 |
Thus, future format specifiers, which might replace or |
| 341 |
extend "1.0", are (minimally) constrained by the definition |
| 342 |
of "text", which appears in <a href="./rfc822">RFC 822</a>. |
| 343 |
|
| 344 |
Note that the MIME-Version header field is required at the |
| 345 |
top level of a message. It is not required for each body |
| 346 |
part of a multipart entity. It is required for the embedded |
| 347 |
headers of a body of type "message" if and only if the |
| 348 |
embedded message is itself claimed to be MIME-compliant. |
| 349 |
|
| 350 |
|
| 351 |
|
| 352 |
|
| 353 |
|
| 354 |
|
| 355 |
|
| 356 |
|
| 357 |
|
| 358 |
|
| 359 |
|
| 360 |
|
| 361 |
|
| 362 |
|
| 363 |
|
| 364 |
|
| 365 |
<span class="grey"> Borenstein & Freed [Page 5]</span></pre> |
| 366 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span> |
| 367 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 368 |
|
| 369 |
|
| 370 |
4 The Content-Type Header Field |
| 371 |
|
| 372 |
The purpose of the Content-Type field is to describe the |
| 373 |
data contained in the body fully enough that the receiving |
| 374 |
user agent can pick an appropriate agent or mechanism to |
| 375 |
present the data to the user, or otherwise deal with the |
| 376 |
data in an appropriate manner. |
| 377 |
|
| 378 |
HISTORICAL NOTE: The Content-Type header field was first |
| 379 |
defined in <a href="./rfc1049">RFC 1049</a>. <a href="./rfc1049">RFC 1049</a> Content-types used a simpler |
| 380 |
and less powerful syntax, but one that is largely compatible |
| 381 |
with the mechanism given here. |
| 382 |
|
| 383 |
The Content-Type header field is used to specify the nature |
| 384 |
of the data in the body of an entity, by giving type and |
| 385 |
subtype identifiers, and by providing auxiliary information |
| 386 |
that may be required for certain types. After the type and |
| 387 |
subtype names, the remainder of the header field is simply a |
| 388 |
set of parameters, specified in an attribute/value notation. |
| 389 |
The set of meaningful parameters differs for the different |
| 390 |
types. The ordering of parameters is not significant. |
| 391 |
Among the defined parameters is a "charset" parameter by |
| 392 |
which the character set used in the body may be declared. |
| 393 |
Comments are allowed in accordance with RFC 822 rules for |
| 394 |
structured header fields. |
| 395 |
|
| 396 |
In general, the top-level Content-Type is used to declare |
| 397 |
the general type of data, while the subtype specifies a |
| 398 |
specific format for that type of data. Thus, a Content-Type |
| 399 |
of "image/xyz" is enough to tell a user agent that the data |
| 400 |
is an image, even if the user agent has no knowledge of the |
| 401 |
specific image format "xyz". Such information can be used, |
| 402 |
for example, to decide whether or not to show a user the raw |
| 403 |
data from an unrecognized subtype -- such an action might be |
| 404 |
reasonable for unrecognized subtypes of text, but not for |
| 405 |
unrecognized subtypes of image or audio. For this reason, |
| 406 |
registered subtypes of audio, image, text, and video, should |
| 407 |
not contain embedded information that is really of a |
| 408 |
different type. Such compound types should be represented |
| 409 |
using the "multipart" or "application" types. |
| 410 |
|
| 411 |
Parameters are modifiers of the content-subtype, and do not |
| 412 |
fundamentally affect the requirements of the host system. |
| 413 |
Although most parameters make sense only with certain |
| 414 |
content-types, others are "global" in the sense that they |
| 415 |
might apply to any subtype. For example, the "boundary" |
| 416 |
parameter makes sense only for the "multipart" content-type, |
| 417 |
but the "charset" parameter might make sense with several |
| 418 |
content-types. |
| 419 |
|
| 420 |
An initial set of seven Content-Types is defined by this |
| 421 |
document. This set of top-level names is intended to be |
| 422 |
substantially complete. It is expected that additions to |
| 423 |
the larger set of supported types can generally be |
| 424 |
|
| 425 |
|
| 426 |
|
| 427 |
<span class="grey"> Borenstein & Freed [Page 6]</span></pre> |
| 428 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span> |
| 429 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 430 |
|
| 431 |
|
| 432 |
accomplished by the creation of new subtypes of these |
| 433 |
initial types. In the future, more top-level types may be |
| 434 |
defined only by an extension to this standard. If another |
| 435 |
primary type is to be used for any reason, it must be given |
| 436 |
a name starting with "X-" to indicate its non-standard |
| 437 |
status and to avoid a potential conflict with a future |
| 438 |
official name. |
| 439 |
|
| 440 |
In the Extended BNF notation of RFC 822, a Content-Type |
| 441 |
header field value is defined as follows: |
| 442 |
|
| 443 |
Content-Type := type "/" subtype *[";" parameter] |
| 444 |
|
| 445 |
type := "application" / "audio" |
| 446 |
/ "image" / "message" |
| 447 |
/ "multipart" / "text" |
| 448 |
/ "video" / x-token |
| 449 |
|
| 450 |
x-token := <The two characters "X-" followed, with no |
| 451 |
intervening white space, by any token> |
| 452 |
|
| 453 |
subtype := token |
| 454 |
|
| 455 |
parameter := attribute "=" value |
| 456 |
|
| 457 |
attribute := token |
| 458 |
|
| 459 |
value := token / quoted-string |
| 460 |
|
| 461 |
token := 1*<any CHAR except SPACE, CTLs, or tspecials> |
| 462 |
|
| 463 |
tspecials := "(" / ")" / "<" / ">" / "@" ; Must be in |
| 464 |
/ "," / ";" / ":" / "\" / <"> ; quoted-string, |
| 465 |
/ "/" / "[" / "]" / "?" / "." ; to use within |
| 466 |
/ "=" ; parameter values |
| 467 |
|
| 468 |
Note that the definition of "tspecials" is the same as the |
| 469 |
RFC 822 definition of "specials" with the addition of the |
| 470 |
three characters "/", "?", and "=". |
| 471 |
|
| 472 |
Note also that a subtype specification is MANDATORY. There |
| 473 |
are no default subtypes. |
| 474 |
|
| 475 |
The type, subtype, and parameter names are not case |
| 476 |
sensitive. For example, TEXT, Text, and TeXt are all |
| 477 |
equivalent. Parameter values are normally case sensitive, |
| 478 |
but certain parameters are interpreted to be case- |
| 479 |
insensitive, depending on the intended use. (For example, |
| 480 |
multipart boundaries are case-sensitive, but the "access- |
| 481 |
type" for message/External-body is not case-sensitive.) |
| 482 |
|
| 483 |
Beyond this syntax, the only constraint on the definition of |
| 484 |
subtype names is the desire that their uses must not |
| 485 |
conflict. That is, it would be undesirable to have two |
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
<span class="grey"> Borenstein & Freed [Page 7]</span></pre> |
| 490 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span> |
| 491 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 492 |
|
| 493 |
|
| 494 |
different communities using "Content-Type: |
| 495 |
application/foobar" to mean two different things. The |
| 496 |
process of defining new content-subtypes, then, is not |
| 497 |
intended to be a mechanism for imposing restrictions, but |
| 498 |
simply a mechanism for publicizing the usages. There are, |
| 499 |
therefore, two acceptable mechanisms for defining new |
| 500 |
Content-Type subtypes: |
| 501 |
|
| 502 |
1. Private values (starting with "X-") may be |
| 503 |
defined bilaterally between two cooperating |
| 504 |
agents without outside registration or |
| 505 |
standardization. |
| 506 |
|
| 507 |
2. New standard values must be documented, |
| 508 |
registered with, and approved by IANA, as |
| 509 |
described in <a href="#appendix-F">Appendix F</a>. Where intended for |
| 510 |
public use, the formats they refer to must |
| 511 |
also be defined by a published specification, |
| 512 |
and possibly offered for standardization. |
| 513 |
|
| 514 |
The seven standard initial predefined Content-Types are |
| 515 |
detailed in the bulk of this document. They are: |
| 516 |
|
| 517 |
text -- textual information. The primary subtype, |
| 518 |
"plain", indicates plain (unformatted) text. No |
| 519 |
special software is required to get the full |
| 520 |
meaning of the text, aside from support for the |
| 521 |
indicated character set. Subtypes are to be used |
| 522 |
for enriched text in forms where application |
| 523 |
software may enhance the appearance of the text, |
| 524 |
but such software must not be required in order to |
| 525 |
get the general idea of the content. Possible |
| 526 |
subtypes thus include any readable word processor |
| 527 |
format. A very simple and portable subtype, |
| 528 |
richtext, is defined in this document. |
| 529 |
multipart -- data consisting of multiple parts of |
| 530 |
independent data types. Four initial subtypes |
| 531 |
are defined, including the primary "mixed" |
| 532 |
subtype, "alternative" for representing the same |
| 533 |
data in multiple formats, "parallel" for parts |
| 534 |
intended to be viewed simultaneously, and "digest" |
| 535 |
for multipart entities in which each part is of |
| 536 |
type "message". |
| 537 |
message -- an encapsulated message. A body of |
| 538 |
Content-Type "message" is itself a fully formatted |
| 539 |
<a href="./rfc822">RFC 822</a> conformant message which may contain its |
| 540 |
own different Content-Type header field. The |
| 541 |
primary subtype is "<a href="./rfc822">rfc822</a>". The "partial" |
| 542 |
subtype is defined for partial messages, to permit |
| 543 |
the fragmented transmission of bodies that are |
| 544 |
thought to be too large to be passed through mail |
| 545 |
transport facilities. Another subtype, |
| 546 |
"External-body", is defined for specifying large |
| 547 |
bodies by reference to an external data source. |
| 548 |
|
| 549 |
|
| 550 |
|
| 551 |
<span class="grey"> Borenstein & Freed [Page 8]</span></pre> |
| 552 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span> |
| 553 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 554 |
|
| 555 |
|
| 556 |
image -- image data. Image requires a display device |
| 557 |
(such as a graphical display, a printer, or a FAX |
| 558 |
machine) to view the information. Initial |
| 559 |
subtypes are defined for two widely-used image |
| 560 |
formats, jpeg and gif. |
| 561 |
audio -- audio data, with initial subtype "basic". |
| 562 |
Audio requires an audio output device (such as a |
| 563 |
speaker or a telephone) to "display" the contents. |
| 564 |
video -- video data. Video requires the capability to |
| 565 |
display moving images, typically including |
| 566 |
specialized hardware and software. The initial |
| 567 |
subtype is "mpeg". |
| 568 |
application -- some other kind of data, typically |
| 569 |
either uninterpreted binary data or information to |
| 570 |
be processed by a mail-based application. The |
| 571 |
primary subtype, "octet-stream", is to be used in |
| 572 |
the case of uninterpreted binary data, in which |
| 573 |
case the simplest recommended action is to offer |
| 574 |
to write the information into a file for the user. |
| 575 |
Two additional subtypes, "ODA" and "PostScript", |
| 576 |
are defined for transporting ODA and PostScript |
| 577 |
documents in bodies. Other expected uses for |
| 578 |
"application" include spreadsheets, data for |
| 579 |
mail-based scheduling systems, and languages for |
| 580 |
"active" (computational) email. (Note that active |
| 581 |
email entails several securityconsiderations, |
| 582 |
which are discussed later in this memo, |
| 583 |
particularly in the context of |
| 584 |
application/PostScript.) |
| 585 |
|
| 586 |
Default <a href="./rfc822">RFC 822</a> messages are typed by this protocol as plain |
| 587 |
text in the US-ASCII character set, which can be explicitly |
| 588 |
specified as "Content-type: text/plain; charset=us-ascii". |
| 589 |
If no Content-Type is specified, either by error or by an |
| 590 |
older user agent, this default is assumed. In the presence |
| 591 |
of a MIME-Version header field, a receiving User Agent can |
| 592 |
also assume that plain US-ASCII text was the sender's |
| 593 |
intent. In the absence of a MIME-Version specification, |
| 594 |
plain US-ASCII text must still be assumed, but the sender's |
| 595 |
intent might have been otherwise. |
| 596 |
|
| 597 |
RATIONALE: In the absence of any Content-Type header field |
| 598 |
or MIME-Version header field, it is impossible to be certain |
| 599 |
that a message is actually text in the US-ASCII character |
| 600 |
set, since it might well be a message that, using the |
| 601 |
conventions that predate this document, includes text in |
| 602 |
another character set or non-textual data in a manner that |
| 603 |
cannot be automatically recognized (e.g., a uuencoded |
| 604 |
compressed UNIX tar file). Although there is no fully |
| 605 |
acceptable alternative to treating such untyped messages as |
| 606 |
"text/plain; charset=us-ascii", implementors should remain |
| 607 |
aware that if a message lacks both the MIME-Version and the |
| 608 |
Content-Type header fields, it may in practice contain |
| 609 |
almost anything. |
| 610 |
|
| 611 |
|
| 612 |
|
| 613 |
<span class="grey"> Borenstein & Freed [Page 9]</span></pre> |
| 614 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span> |
| 615 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 616 |
|
| 617 |
|
| 618 |
It should be noted that the list of Content-Type values |
| 619 |
given here may be augmented in time, via the mechanisms |
| 620 |
described above, and that the set of subtypes is expected to |
| 621 |
grow substantially. |
| 622 |
|
| 623 |
When a mail reader encounters mail with an unknown Content- |
| 624 |
type value, it should generally treat it as equivalent to |
| 625 |
"application/octet-stream", as described later in this |
| 626 |
document. |
| 627 |
|
| 628 |
5 The Content-Transfer-Encoding Header Field |
| 629 |
|
| 630 |
Many Content-Types which could usefully be transported via |
| 631 |
email are represented, in their "natural" format, as 8-bit |
| 632 |
character or binary data. Such data cannot be transmitted |
| 633 |
over some transport protocols. For example, RFC 821 |
| 634 |
restricts mail messages to 7-bit US-ASCII data with 1000 |
| 635 |
character lines. |
| 636 |
|
| 637 |
It is necessary, therefore, to define a standard mechanism |
| 638 |
for re-encoding such data into a 7-bit short-line format. |
| 639 |
This document specifies that such encodings will be |
| 640 |
indicated by a new "Content-Transfer-Encoding" header field. |
| 641 |
The Content-Transfer-Encoding field is used to indicate the |
| 642 |
type of transformation that has been used in order to |
| 643 |
represent the body in an acceptable manner for transport. |
| 644 |
|
| 645 |
Unlike Content-Types, a proliferation of Content-Transfer- |
| 646 |
Encoding values is undesirable and unnecessary. However, |
| 647 |
establishing only a single Content-Transfer-Encoding |
| 648 |
mechanism does not seem possible. There is a tradeoff |
| 649 |
between the desire for a compact and efficient encoding of |
| 650 |
largely-binary data and the desire for a readable encoding |
| 651 |
of data that is mostly, but not entirely, 7-bit data. For |
| 652 |
this reason, at least two encoding mechanisms are necessary: |
| 653 |
a "readable" encoding and a "dense" encoding. |
| 654 |
|
| 655 |
The Content-Transfer-Encoding field is designed to specify |
| 656 |
an invertible mapping between the "native" representation of |
| 657 |
a type of data and a representation that can be readily |
| 658 |
exchanged using 7 bit mail transport protocols, such as |
| 659 |
those defined by <a href="./rfc821">RFC 821</a> (SMTP). This field has not been |
| 660 |
defined by any previous standard. The field's value is a |
| 661 |
single token specifying the type of encoding, as enumerated |
| 662 |
below. Formally: |
| 663 |
|
| 664 |
Content-Transfer-Encoding := "BASE64" / "QUOTED-PRINTABLE" / |
| 665 |
"8BIT" / "7BIT" / |
| 666 |
"BINARY" / x-token |
| 667 |
|
| 668 |
These values are not case sensitive. That is, Base64 and |
| 669 |
BASE64 and bAsE64 are all equivalent. An encoding type of |
| 670 |
7BIT requires that the body is already in a seven-bit mail- |
| 671 |
ready representation. This is the default value -- that is, |
| 672 |
|
| 673 |
|
| 674 |
|
| 675 |
<span class="grey"> Borenstein & Freed [Page 10]</span></pre> |
| 676 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span> |
| 677 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 678 |
|
| 679 |
|
| 680 |
"Content-Transfer-Encoding: 7BIT" is assumed if the |
| 681 |
Content-Transfer-Encoding header field is not present. |
| 682 |
|
| 683 |
The values "8bit", "7bit", and "binary" all imply that NO |
| 684 |
encoding has been performed. However, they are potentially |
| 685 |
useful as indications of the kind of data contained in the |
| 686 |
object, and therefore of the kind of encoding that might |
| 687 |
need to be performed for transmission in a given transport |
| 688 |
system. "7bit" means that the data is all represented as |
| 689 |
short lines of US-ASCII data. "8bit" means that the lines |
| 690 |
are short, but there may be non-ASCII characters (octets |
| 691 |
with the high-order bit set). "Binary" means that not only |
| 692 |
may non-ASCII characters be present, but also that the lines |
| 693 |
are not necessarily short enough for SMTP transport. |
| 694 |
|
| 695 |
The difference between "8bit" (or any other conceivable |
| 696 |
bit-width token) and the "binary" token is that "binary" |
| 697 |
does not require adherence to any limits on line length or |
| 698 |
to the SMTP CRLF semantics, while the bit-width tokens do |
| 699 |
require such adherence. If the body contains data in any |
| 700 |
bit-width other than 7-bit, the appropriate bit-width |
| 701 |
Content-Transfer-Encoding token must be used (e.g., "8bit" |
| 702 |
for unencoded 8 bit wide data). If the body contains binary |
| 703 |
data, the "binary" Content-Transfer-Encoding token must be |
| 704 |
used. |
| 705 |
|
| 706 |
NOTE: The distinction between the Content-Transfer-Encoding |
| 707 |
values of "binary," "8bit," etc. may seem unimportant, in |
| 708 |
that all of them really mean "none" -- that is, there has |
| 709 |
been no encoding of the data for transport. However, clear |
| 710 |
labeling will be of enormous value to gateways between |
| 711 |
future mail transport systems with differing capabilities in |
| 712 |
transporting data that do not meet the restrictions of <a href="./rfc821">RFC</a> |
| 713 |
<a href="./rfc821">821</a> transport. |
| 714 |
|
| 715 |
As of the publication of this document, there are no |
| 716 |
standardized Internet transports for which it is legitimate |
| 717 |
to include unencoded 8-bit or binary data in mail bodies. |
| 718 |
Thus there are no circumstances in which the "8bit" or |
| 719 |
"binary" Content-Transfer-Encoding is actually legal on the |
| 720 |
Internet. However, in the event that 8-bit or binary mail |
| 721 |
transport becomes a reality in Internet mail, or when this |
| 722 |
document is used in conjunction with any other 8-bit or |
| 723 |
binary-capable transport mechanism, 8-bit or binary bodies |
| 724 |
should be labeled as such using this mechanism. |
| 725 |
|
| 726 |
NOTE: The five values defined for the Content-Transfer- |
| 727 |
Encoding field imply nothing about the Content-Type other |
| 728 |
than the algorithm by which it was encoded or the transport |
| 729 |
system requirements if unencoded. |
| 730 |
|
| 731 |
Implementors may, if necessary, define new Content- |
| 732 |
Transfer-Encoding values, but must use an x-token, which is |
| 733 |
a name prefixed by "X-" to indicate its non-standard status, |
| 734 |
|
| 735 |
|
| 736 |
|
| 737 |
<span class="grey"> Borenstein & Freed [Page 11]</span></pre> |
| 738 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span> |
| 739 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 740 |
|
| 741 |
|
| 742 |
e.g., "Content-Transfer-Encoding: x-my-new-encoding". |
| 743 |
However, unlike Content-Types and subtypes, the creation of |
| 744 |
new Content-Transfer-Encoding values is explicitly and |
| 745 |
strongly discouraged, as it seems likely to hinder |
| 746 |
interoperability with little potential benefit. Their use |
| 747 |
is allowed only as the result of an agreement between |
| 748 |
cooperating user agents. |
| 749 |
|
| 750 |
If a Content-Transfer-Encoding header field appears as part |
| 751 |
of a message header, it applies to the entire body of that |
| 752 |
message. If a Content-Transfer-Encoding header field |
| 753 |
appears as part of a body part's headers, it applies only to |
| 754 |
the body of that body part. If an entity is of type |
| 755 |
"multipart" or "message", the Content-Transfer-Encoding is |
| 756 |
not permitted to have any value other than a bit width |
| 757 |
(e.g., "7bit", "8bit", etc.) or "binary". |
| 758 |
|
| 759 |
It should be noted that email is character-oriented, so that |
| 760 |
the mechanisms described here are mechanisms for encoding |
| 761 |
arbitrary byte streams, not bit streams. If a bit stream is |
| 762 |
to be encoded via one of these mechanisms, it must first be |
| 763 |
converted to an 8-bit byte stream using the network standard |
| 764 |
bit order ("big-endian"), in which the earlier bits in a |
| 765 |
stream become the higher-order bits in a byte. A bit stream |
| 766 |
not ending at an 8-bit boundary must be padded with zeroes. |
| 767 |
This document provides a mechanism for noting the addition |
| 768 |
of such padding in the case of the application Content-Type, |
| 769 |
which has a "padding" parameter. |
| 770 |
|
| 771 |
The encoding mechanisms defined here explicitly encode all |
| 772 |
data in ASCII. Thus, for example, suppose an entity has |
| 773 |
header fields such as: |
| 774 |
|
| 775 |
Content-Type: text/plain; charset=ISO-8859-1 |
| 776 |
Content-transfer-encoding: base64 |
| 777 |
|
| 778 |
This should be interpreted to mean that the body is a base64 |
| 779 |
ASCII encoding of data that was originally in ISO-8859-1, |
| 780 |
and will be in that character set again after decoding. |
| 781 |
|
| 782 |
The following sections will define the two standard encoding |
| 783 |
mechanisms. The definition of new content-transfer- |
| 784 |
encodings is explicitly discouraged and should only occur |
| 785 |
when absolutely necessary. All content-transfer-encoding |
| 786 |
namespace except that beginning with "X-" is explicitly |
| 787 |
reserved to the IANA for future use. Private agreements |
| 788 |
about content-transfer-encodings are also explicitly |
| 789 |
discouraged. |
| 790 |
|
| 791 |
Certain Content-Transfer-Encoding values may only be used on |
| 792 |
certain Content-Types. In particular, it is expressly |
| 793 |
forbidden to use any encodings other than "7bit", "8bit", or |
| 794 |
"binary" with any Content-Type that recursively includes |
| 795 |
other Content-Type fields, notably the "multipart" and |
| 796 |
|
| 797 |
|
| 798 |
|
| 799 |
<span class="grey"> Borenstein & Freed [Page 12]</span></pre> |
| 800 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span> |
| 801 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 802 |
|
| 803 |
|
| 804 |
"message" Content-Types. All encodings that are desired for |
| 805 |
bodies of type multipart or message must be done at the |
| 806 |
innermost level, by encoding the actual body that needs to |
| 807 |
be encoded. |
| 808 |
|
| 809 |
NOTE ON ENCODING RESTRICTIONS: Though the prohibition |
| 810 |
against using content-transfer-encodings on data of type |
| 811 |
multipart or message may seem overly restrictive, it is |
| 812 |
necessary to prevent nested encodings, in which data are |
| 813 |
passed through an encoding algorithm multiple times, and |
| 814 |
must be decoded multiple times in order to be properly |
| 815 |
viewed. Nested encodings add considerable complexity to |
| 816 |
user agents: aside from the obvious efficiency problems |
| 817 |
with such multiple encodings, they can obscure the basic |
| 818 |
structure of a message. In particular, they can imply that |
| 819 |
several decoding operations are necessary simply to find out |
| 820 |
what types of objects a message contains. Banning nested |
| 821 |
encodings may complicate the job of certain mail gateways, |
| 822 |
but this seems less of a problem than the effect of nested |
| 823 |
encodings on user agents. |
| 824 |
|
| 825 |
NOTE ON THE RELATIONSHIP BETWEEN CONTENT-TYPE AND CONTENT- |
| 826 |
TRANSFER-ENCODING: It may seem that the Content-Transfer- |
| 827 |
Encoding could be inferred from the characteristics of the |
| 828 |
Content-Type that is to be encoded, or, at the very least, |
| 829 |
that certain Content-Transfer-Encodings could be mandated |
| 830 |
for use with specific Content-Types. There are several |
| 831 |
reasons why this is not the case. First, given the varying |
| 832 |
types of transports used for mail, some encodings may be |
| 833 |
appropriate for some Content-Type/transport combinations and |
| 834 |
not for others. (For example, in an 8-bit transport, no |
| 835 |
encoding would be required for text in certain character |
| 836 |
sets, while such encodings are clearly required for 7-bit |
| 837 |
SMTP.) Second, certain Content-Types may require different |
| 838 |
types of transfer encoding under different circumstances. |
| 839 |
For example, many PostScript bodies might consist entirely |
| 840 |
of short lines of 7-bit data and hence require little or no |
| 841 |
encoding. Other PostScript bodies (especially those using |
| 842 |
Level 2 PostScript's binary encoding mechanism) may only be |
| 843 |
reasonably represented using a binary transport encoding. |
| 844 |
Finally, since Content-Type is intended to be an open-ended |
| 845 |
specification mechanism, strict specification of an |
| 846 |
association between Content-Types and encodings effectively |
| 847 |
couples the specification of an application protocol with a |
| 848 |
specific lower-level transport. This is not desirable since |
| 849 |
the developers of a Content-Type should not have to be aware |
| 850 |
of all the transports in use and what their limitations are. |
| 851 |
|
| 852 |
NOTE ON TRANSLATING ENCODINGS: The quoted-printable and |
| 853 |
base64 encodings are designed so that conversion between |
| 854 |
them is possible. The only issue that arises in such a |
| 855 |
conversion is the handling of line breaks. When converting |
| 856 |
from quoted-printable to base64 a line break must be |
| 857 |
converted into a CRLF sequence. Similarly, a CRLF sequence |
| 858 |
|
| 859 |
|
| 860 |
|
| 861 |
<span class="grey"> Borenstein & Freed [Page 13]</span></pre> |
| 862 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span> |
| 863 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 864 |
|
| 865 |
|
| 866 |
in base64 data should be converted to a quoted-printable |
| 867 |
line break, but ONLY when converting text data. |
| 868 |
|
| 869 |
NOTE ON CANONICAL ENCODING MODEL: There was some |
| 870 |
confusion, in earlier drafts of this memo, regarding the |
| 871 |
model for when email data was to be converted to canonical |
| 872 |
form and encoded, and in particular how this process would |
| 873 |
affect the treatment of CRLFs, given that the representation |
| 874 |
of newlines varies greatly from system to system. For this |
| 875 |
reason, a canonical model for encoding is presented as |
| 876 |
<a href="#appendix-H">Appendix H</a>. |
| 877 |
|
| 878 |
5.1 Quoted-Printable Content-Transfer-Encoding |
| 879 |
|
| 880 |
The Quoted-Printable encoding is intended to represent data |
| 881 |
that largely consists of octets that correspond to printable |
| 882 |
characters in the ASCII character set. It encodes the data |
| 883 |
in such a way that the resulting octets are unlikely to be |
| 884 |
modified by mail transport. If the data being encoded are |
| 885 |
mostly ASCII text, the encoded form of the data remains |
| 886 |
largely recognizable by humans. A body which is entirely |
| 887 |
ASCII may also be encoded in Quoted-Printable to ensure the |
| 888 |
integrity of the data should the message pass through a |
| 889 |
character-translating, and/or line-wrapping gateway. |
| 890 |
|
| 891 |
In this encoding, octets are to be represented as determined |
| 892 |
by the following rules: |
| 893 |
|
| 894 |
Rule #1: (General 8-bit representation) Any octet, |
| 895 |
except those indicating a line break according to the |
| 896 |
newline convention of the canonical form of the data |
| 897 |
being encoded, may be represented by an "=" followed by |
| 898 |
a two digit hexadecimal representation of the octet's |
| 899 |
value. The digits of the hexadecimal alphabet, for this |
| 900 |
purpose, are "0123456789ABCDEF". Uppercase letters must |
| 901 |
be |
| 902 |
used when sending hexadecimal data, though a robust |
| 903 |
implementation may choose to recognize lowercase |
| 904 |
letters on receipt. Thus, for example, the value 12 |
| 905 |
(ASCII form feed) can be represented by "=0C", and the |
| 906 |
value 61 (ASCII EQUAL SIGN) can be represented by |
| 907 |
"=3D". Except when the following rules allow an |
| 908 |
alternative encoding, this rule is mandatory. |
| 909 |
|
| 910 |
Rule #2: (Literal representation) Octets with decimal |
| 911 |
values of 33 through 60 inclusive, and 62 through 126, |
| 912 |
inclusive, MAY be represented as the ASCII characters |
| 913 |
which correspond to those octets (EXCLAMATION POINT |
| 914 |
through LESS THAN, and GREATER THAN through TILDE, |
| 915 |
respectively). |
| 916 |
|
| 917 |
Rule #3: (White Space): Octets with values of 9 and 32 |
| 918 |
MAY be represented as ASCII TAB (HT) and SPACE |
| 919 |
characters, respectively, but MUST NOT be so |
| 920 |
|
| 921 |
|
| 922 |
|
| 923 |
<span class="grey"> Borenstein & Freed [Page 14]</span></pre> |
| 924 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span> |
| 925 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 926 |
|
| 927 |
|
| 928 |
represented at the end of an encoded line. Any TAB (HT) |
| 929 |
or SPACE characters on an encoded line MUST thus be |
| 930 |
followed on that line by a printable character. In |
| 931 |
particular, an "=" at the end of an encoded line, |
| 932 |
indicating a soft line break (see rule #5) may follow |
| 933 |
one or more TAB (HT) or SPACE characters. It follows |
| 934 |
that an octet with value 9 or 32 appearing at the end |
| 935 |
of an encoded line must be represented according to |
| 936 |
Rule #1. This rule is necessary because some MTAs |
| 937 |
(Message Transport Agents, programs which transport |
| 938 |
messages from one user to another, or perform a part of |
| 939 |
such transfers) are known to pad lines of text with |
| 940 |
SPACEs, and others are known to remove "white space" |
| 941 |
characters from the end of a line. Therefore, when |
| 942 |
decoding a Quoted-Printable body, any trailing white |
| 943 |
space on a line must be deleted, as it will necessarily |
| 944 |
have been added by intermediate transport agents. |
| 945 |
|
| 946 |
Rule #4 (Line Breaks): A line break in a text body |
| 947 |
part, independent of what its representation is |
| 948 |
following the canonical representation of the data |
| 949 |
being encoded, must be represented by a (<a href="./rfc822">RFC 822</a>) line |
| 950 |
break, which is a CRLF sequence, in the Quoted- |
| 951 |
Printable encoding. If isolated CRs and LFs, or LF CR |
| 952 |
and CR LF sequences are allowed to appear in binary |
| 953 |
data according to the canonical form, they must be |
| 954 |
represented using the "=0D", "=0A", "=0A=0D" and |
| 955 |
"=0D=0A" notations respectively. |
| 956 |
|
| 957 |
Note that many implementation may elect to encode the |
| 958 |
local representation of various content types directly. |
| 959 |
In particular, this may apply to plain text material on |
| 960 |
systems that use newline conventions other than CRLF |
| 961 |
delimiters. Such an implementation is permissible, but |
| 962 |
the generation of line breaks must be generalized to |
| 963 |
account for the case where alternate representations of |
| 964 |
newline sequences are used. |
| 965 |
|
| 966 |
Rule #5 (Soft Line Breaks): The Quoted-Printable |
| 967 |
encoding REQUIRES that encoded lines be no more than 76 |
| 968 |
characters long. If longer lines are to be encoded with |
| 969 |
the Quoted-Printable encoding, 'soft' line breaks must |
| 970 |
be used. An equal sign as the last character on a |
| 971 |
encoded line indicates such a non-significant ('soft') |
| 972 |
line break in the encoded text. Thus if the "raw" form |
| 973 |
of the line is a single unencoded line that says: |
| 974 |
|
| 975 |
Now's the time for all folk to come to the aid of |
| 976 |
their country. |
| 977 |
|
| 978 |
This can be represented, in the Quoted-Printable |
| 979 |
encoding, as |
| 980 |
|
| 981 |
|
| 982 |
|
| 983 |
|
| 984 |
|
| 985 |
<span class="grey"> Borenstein & Freed [Page 15]</span></pre> |
| 986 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span> |
| 987 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 988 |
|
| 989 |
|
| 990 |
Now's the time = |
| 991 |
for all folk to come= |
| 992 |
to the aid of their country. |
| 993 |
|
| 994 |
This provides a mechanism with which long lines are |
| 995 |
encoded in such a way as to be restored by the user |
| 996 |
agent. The 76 character limit does not count the |
| 997 |
trailing CRLF, but counts all other characters, |
| 998 |
including any equal signs. |
| 999 |
|
| 1000 |
Since the hyphen character ("-") is represented as itself in |
| 1001 |
the Quoted-Printable encoding, care must be taken, when |
| 1002 |
encapsulating a quoted-printable encoded body in a multipart |
| 1003 |
entity, to ensure that the encapsulation boundary does not |
| 1004 |
appear anywhere in the encoded body. (A good strategy is to |
| 1005 |
choose a boundary that includes a character sequence such as |
| 1006 |
"=_" which can never appear in a quoted-printable body. See |
| 1007 |
the definition of multipart messages later in this |
| 1008 |
document.) |
| 1009 |
|
| 1010 |
NOTE: The quoted-printable encoding represents something of |
| 1011 |
a compromise between readability and reliability in |
| 1012 |
transport. Bodies encoded with the quoted-printable |
| 1013 |
encoding will work reliably over most mail gateways, but may |
| 1014 |
not work perfectly over a few gateways, notably those |
| 1015 |
involving translation into EBCDIC. (In theory, an EBCDIC |
| 1016 |
gateway could decode a quoted-printable body and re-encode |
| 1017 |
it using base64, but such gateways do not yet exist.) A |
| 1018 |
higher level of confidence is offered by the base64 |
| 1019 |
Content-Transfer-Encoding. A way to get reasonably reliable |
| 1020 |
transport through EBCDIC gateways is to also quote the ASCII |
| 1021 |
characters |
| 1022 |
|
| 1023 |
!"#$@[\]^`{|}~ |
| 1024 |
|
| 1025 |
according to rule #1. See <a href="#appendix-B">Appendix B</a> for more information. |
| 1026 |
|
| 1027 |
Because quoted-printable data is generally assumed to be |
| 1028 |
line-oriented, it is to be expected that the breaks between |
| 1029 |
the lines of quoted printable data may be altered in |
| 1030 |
transport, in the same manner that plain text mail has |
| 1031 |
always been altered in Internet mail when passing between |
| 1032 |
systems with differing newline conventions. If such |
| 1033 |
alterations are likely to constitute a corruption of the |
| 1034 |
data, it is probably more sensible to use the base64 |
| 1035 |
encoding rather than the quoted-printable encoding. |
| 1036 |
|
| 1037 |
|
| 1038 |
|
| 1039 |
|
| 1040 |
|
| 1041 |
|
| 1042 |
|
| 1043 |
|
| 1044 |
|
| 1045 |
|
| 1046 |
|
| 1047 |
<span class="grey"> Borenstein & Freed [Page 16]</span></pre> |
| 1048 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span> |
| 1049 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1050 |
|
| 1051 |
|
| 1052 |
5.2 Base64 Content-Transfer-Encoding |
| 1053 |
|
| 1054 |
The Base64 Content-Transfer-Encoding is designed to |
| 1055 |
represent arbitrary sequences of octets in a form that is |
| 1056 |
not humanly readable. The encoding and decoding algorithms |
| 1057 |
are simple, but the encoded data are consistently only about |
| 1058 |
33 percent larger than the unencoded data. This encoding is |
| 1059 |
based on the one used in Privacy Enhanced Mail applications, |
| 1060 |
as defined in <a href="./rfc1113">RFC 1113</a>. The base64 encoding is adapted |
| 1061 |
from RFC 1113, with one change: base64 eliminates the "*" |
| 1062 |
mechanism for embedded clear text. |
| 1063 |
|
| 1064 |
A 65-character subset of US-ASCII is used, enabling 6 bits |
| 1065 |
to be represented per printable character. (The extra 65th |
| 1066 |
character, "=", is used to signify a special processing |
| 1067 |
function.) |
| 1068 |
|
| 1069 |
NOTE: This subset has the important property that it is |
| 1070 |
represented identically in all versions of ISO 646, |
| 1071 |
including US ASCII, and all characters in the subset are |
| 1072 |
also represented identically in all versions of EBCDIC. |
| 1073 |
Other popular encodings, such as the encoding used by the |
| 1074 |
UUENCODE utility and the base85 encoding specified as part |
| 1075 |
of Level 2 PostScript, do not share these properties, and |
| 1076 |
thus do not fulfill the portability requirements a binary |
| 1077 |
transport encoding for mail must meet. |
| 1078 |
|
| 1079 |
The encoding process represents 24-bit groups of input bits |
| 1080 |
as output strings of 4 encoded characters. Proceeding from |
| 1081 |
left to right, a 24-bit input group is formed by |
| 1082 |
concatenating 3 8-bit input groups. These 24 bits are then |
| 1083 |
treated as 4 concatenated 6-bit groups, each of which is |
| 1084 |
translated into a single digit in the base64 alphabet. When |
| 1085 |
encoding a bit stream via the base64 encoding, the bit |
| 1086 |
stream must be presumed to be ordered with the most- |
| 1087 |
significant-bit first. That is, the first bit in the stream |
| 1088 |
will be the high-order bit in the first byte, and the eighth |
| 1089 |
bit will be the low-order bit in the first byte, and so on. |
| 1090 |
|
| 1091 |
Each 6-bit group is used as an index into an array of 64 |
| 1092 |
printable characters. The character referenced by the index |
| 1093 |
is placed in the output string. These characters, identified |
| 1094 |
in Table 1, below, are selected so as to be universally |
| 1095 |
representable, and the set excludes characters with |
| 1096 |
particular significance to SMTP (e.g., ".", "CR", "LF") and |
| 1097 |
to the encapsulation boundaries defined in this document |
| 1098 |
(e.g., "-"). |
| 1099 |
|
| 1100 |
|
| 1101 |
|
| 1102 |
|
| 1103 |
|
| 1104 |
|
| 1105 |
|
| 1106 |
|
| 1107 |
|
| 1108 |
|
| 1109 |
<span class="grey"> Borenstein & Freed [Page 17]</span></pre> |
| 1110 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span> |
| 1111 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1112 |
|
| 1113 |
|
| 1114 |
Table 1: The Base64 Alphabet |
| 1115 |
|
| 1116 |
Value Encoding Value Encoding Value Encoding Value |
| 1117 |
Encoding |
| 1118 |
0 A 17 R 34 i 51 z |
| 1119 |
1 B 18 S 35 j 52 0 |
| 1120 |
2 C 19 T 36 k 53 1 |
| 1121 |
3 D 20 U 37 l 54 2 |
| 1122 |
4 E 21 V 38 m 55 3 |
| 1123 |
5 F 22 W 39 n 56 4 |
| 1124 |
6 G 23 X 40 o 57 5 |
| 1125 |
7 H 24 Y 41 p 58 6 |
| 1126 |
8 I 25 Z 42 q 59 7 |
| 1127 |
9 J 26 a 43 r 60 8 |
| 1128 |
10 K 27 b 44 s 61 9 |
| 1129 |
11 L 28 c 45 t 62 + |
| 1130 |
12 M 29 d 46 u 63 / |
| 1131 |
13 N 30 e 47 v |
| 1132 |
14 O 31 f 48 w (pad) = |
| 1133 |
15 P 32 g 49 x |
| 1134 |
16 Q 33 h 50 y |
| 1135 |
|
| 1136 |
The output stream (encoded bytes) must be represented in |
| 1137 |
lines of no more than 76 characters each. All line breaks |
| 1138 |
or other characters not found in Table 1 must be ignored by |
| 1139 |
decoding software. In base64 data, characters other than |
| 1140 |
those in Table 1, line breaks, and other white space |
| 1141 |
probably indicate a transmission error, about which a |
| 1142 |
warning message or even a message rejection might be |
| 1143 |
appropriate under some circumstances. |
| 1144 |
|
| 1145 |
Special processing is performed if fewer than 24 bits are |
| 1146 |
available at the end of the data being encoded. A full |
| 1147 |
encoding quantum is always completed at the end of a body. |
| 1148 |
When fewer than 24 input bits are available in an input |
| 1149 |
group, zero bits are added (on the right) to form an |
| 1150 |
integral number of 6-bit groups. Output character positions |
| 1151 |
which are not required to represent actual input data are |
| 1152 |
set to the character "=". Since all base64 input is an |
| 1153 |
integral number of octets, only the following cases can |
| 1154 |
arise: (1) the final quantum of encoding input is an |
| 1155 |
integral multiple of 24 bits; here, the final unit of |
| 1156 |
encoded output will be an integral multiple of 4 characters |
| 1157 |
with no "=" padding, (2) the final quantum of encoding input |
| 1158 |
is exactly 8 bits; here, the final unit of encoded output |
| 1159 |
will be two characters followed by two "=" padding |
| 1160 |
characters, or (3) the final quantum of encoding input is |
| 1161 |
exactly 16 bits; here, the final unit of encoded output will |
| 1162 |
be three characters followed by one "=" padding character. |
| 1163 |
|
| 1164 |
Care must be taken to use the proper octets for line breaks |
| 1165 |
if base64 encoding is applied directly to text material that |
| 1166 |
has not been converted to canonical form. In particular, |
| 1167 |
text line breaks should be converted into CRLF sequences |
| 1168 |
|
| 1169 |
|
| 1170 |
|
| 1171 |
<span class="grey"> Borenstein & Freed [Page 18]</span></pre> |
| 1172 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span> |
| 1173 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1174 |
|
| 1175 |
|
| 1176 |
prior to base64 encoding. The important thing to note is |
| 1177 |
that this may be done directly by the encoder rather than in |
| 1178 |
a prior canonicalization step in some implementations. |
| 1179 |
|
| 1180 |
NOTE: There is no need to worry about quoting apparent |
| 1181 |
encapsulation boundaries within base64-encoded parts of |
| 1182 |
multipart entities because no hyphen characters are used in |
| 1183 |
the base64 encoding. |
| 1184 |
|
| 1185 |
6 Additional Optional Content- Header Fields |
| 1186 |
|
| 1187 |
6.1 Optional Content-ID Header Field |
| 1188 |
|
| 1189 |
In constructing a high-level user agent, it may be desirable |
| 1190 |
to allow one body to make reference to another. |
| 1191 |
Accordingly, bodies may be labeled using the "Content-ID" |
| 1192 |
header field, which is syntactically identical to the |
| 1193 |
"Message-ID" header field: |
| 1194 |
|
| 1195 |
Content-ID := msg-id |
| 1196 |
|
| 1197 |
Like the Message-ID values, Content-ID values must be |
| 1198 |
generated to be as unique as possible. |
| 1199 |
|
| 1200 |
6.2 Optional Content-Description Header Field |
| 1201 |
|
| 1202 |
The ability to associate some descriptive information with a |
| 1203 |
given body is often desirable. For example, it may be useful |
| 1204 |
to mark an "image" body as "a picture of the Space Shuttle |
| 1205 |
Endeavor." Such text may be placed in the Content- |
| 1206 |
Description header field. |
| 1207 |
|
| 1208 |
Content-Description := *text |
| 1209 |
|
| 1210 |
The description is presumed to be given in the US-ASCII |
| 1211 |
character set, although the mechanism specified in [RFC- |
| 1212 |
1342] may be used for non-US-ASCII Content-Description |
| 1213 |
values. |
| 1214 |
|
| 1215 |
|
| 1216 |
|
| 1217 |
|
| 1218 |
|
| 1219 |
|
| 1220 |
|
| 1221 |
|
| 1222 |
|
| 1223 |
|
| 1224 |
|
| 1225 |
|
| 1226 |
|
| 1227 |
|
| 1228 |
|
| 1229 |
|
| 1230 |
|
| 1231 |
|
| 1232 |
|
| 1233 |
<span class="grey"> Borenstein & Freed [Page 19]</span></pre> |
| 1234 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span> |
| 1235 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1236 |
|
| 1237 |
|
| 1238 |
7 The Predefined Content-Type Values |
| 1239 |
|
| 1240 |
This document defines seven initial Content-Type values and |
| 1241 |
an extension mechanism for private or experimental types. |
| 1242 |
Further standard types must be defined by new published |
| 1243 |
specifications. It is expected that most innovation in new |
| 1244 |
types of mail will take place as subtypes of the seven types |
| 1245 |
defined here. The most essential characteristics of the |
| 1246 |
seven content-types are summarized in <a href="#appendix-G">Appendix G</a>. |
| 1247 |
|
| 1248 |
7.1 The Text Content-Type |
| 1249 |
|
| 1250 |
The text Content-Type is intended for sending material which |
| 1251 |
is principally textual in form. It is the default Content- |
| 1252 |
Type. A "charset" parameter may be used to indicate the |
| 1253 |
character set of the body text. The primary subtype of text |
| 1254 |
is "plain". This indicates plain (unformatted) text. The |
| 1255 |
default Content-Type for Internet mail is "text/plain; |
| 1256 |
charset=us-ascii". |
| 1257 |
|
| 1258 |
Beyond plain text, there are many formats for representing |
| 1259 |
what might be known as "extended text" -- text with embedded |
| 1260 |
formatting and presentation information. An interesting |
| 1261 |
characteristic of many such representations is that they are |
| 1262 |
to some extent readable even without the software that |
| 1263 |
interprets them. It is useful, then, to distinguish them, |
| 1264 |
at the highest level, from such unreadable data as images, |
| 1265 |
audio, or text represented in an unreadable form. In the |
| 1266 |
absence of appropriate interpretation software, it is |
| 1267 |
reasonable to show subtypes of text to the user, while it is |
| 1268 |
not reasonable to do so with most nontextual data. |
| 1269 |
|
| 1270 |
Such formatted textual data should be represented using |
| 1271 |
subtypes of text. Plausible subtypes of text are typically |
| 1272 |
given by the common name of the representation format, e.g., |
| 1273 |
"text/richtext". |
| 1274 |
|
| 1275 |
7.1.1 The charset parameter |
| 1276 |
|
| 1277 |
A critical parameter that may be specified in the Content- |
| 1278 |
Type field for text data is the character set. This is |
| 1279 |
specified with a "charset" parameter, as in: |
| 1280 |
|
| 1281 |
Content-type: text/plain; charset=us-ascii |
| 1282 |
|
| 1283 |
Unlike some other parameter values, the values of the |
| 1284 |
charset parameter are NOT case sensitive. The default |
| 1285 |
character set, which must be assumed in the absence of a |
| 1286 |
charset parameter, is US-ASCII. |
| 1287 |
|
| 1288 |
An initial list of predefined character set names can be |
| 1289 |
found at the end of this section. Additional character sets |
| 1290 |
may be registered with IANA as described in Appendix F, |
| 1291 |
although the standardization of their use requires the usual |
| 1292 |
|
| 1293 |
|
| 1294 |
|
| 1295 |
<span class="grey"> Borenstein & Freed [Page 20]</span></pre> |
| 1296 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span> |
| 1297 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1298 |
|
| 1299 |
|
| 1300 |
IAB review and approval. Note that if the specified |
| 1301 |
character set includes 8-bit data, a Content-Transfer- |
| 1302 |
Encoding header field and a corresponding encoding on the |
| 1303 |
data are required in order to transmit the body via some |
| 1304 |
mail transfer protocols, such as SMTP. |
| 1305 |
|
| 1306 |
The default character set, US-ASCII, has been the subject of |
| 1307 |
some confusion and ambiguity in the past. Not only were |
| 1308 |
there some ambiguities in the definition, there have been |
| 1309 |
wide variations in practice. In order to eliminate such |
| 1310 |
ambiguity and variations in the future, it is strongly |
| 1311 |
recommended that new user agents explicitly specify a |
| 1312 |
character set via the Content-Type header field. "US-ASCII" |
| 1313 |
does not indicate an arbitrary seven-bit character code, but |
| 1314 |
specifies that the body uses character coding that uses the |
| 1315 |
exact correspondence of codes to characters specified in |
| 1316 |
ASCII. National use variations of ISO 646 [<a href="#ref-ISO-646">ISO-646</a>] are NOT |
| 1317 |
ASCII and their use in Internet mail is explicitly |
| 1318 |
discouraged. The omission of the ISO 646 character set is |
| 1319 |
deliberate in this regard. The character set name of "US- |
| 1320 |
ASCII" explicitly refers to ANSI X3.4-1986 [<a href="#ref-US-ASCII">US-ASCII</a>] only. |
| 1321 |
The character set name "ASCII" is reserved and must not be |
| 1322 |
used for any purpose. |
| 1323 |
|
| 1324 |
NOTE: <a href="./rfc821">RFC 821</a> explicitly specifies "ASCII", and references |
| 1325 |
an earlier version of the American Standard. Insofar as one |
| 1326 |
of the purposes of specifying a Content-Type and character |
| 1327 |
set is to permit the receiver to unambiguously determine how |
| 1328 |
the sender intended the coded message to be interpreted, |
| 1329 |
assuming anything other than "strict ASCII" as the default |
| 1330 |
would risk unintentional and incompatible changes to the |
| 1331 |
semantics of messages now being transmitted. This also |
| 1332 |
implies that messages containing characters coded according |
| 1333 |
to national variations on ISO 646, or using code-switching |
| 1334 |
procedures (e.g., those of ISO 2022), as well as 8-bit or |
| 1335 |
multiple octet character encodings MUST use an appropriate |
| 1336 |
character set specification to be consistent with this |
| 1337 |
specification. |
| 1338 |
|
| 1339 |
The complete US-ASCII character set is listed in [<a href="#ref-US-ASCII">US-ASCII</a>]. |
| 1340 |
Note that the control characters including DEL (0-31, 127) |
| 1341 |
have no defined meaning apart from the combination CRLF |
| 1342 |
(ASCII values 13 and 10) indicating a new line. Two of the |
| 1343 |
characters have de facto meanings in wide use: FF (12) often |
| 1344 |
means "start subsequent text on the beginning of a new |
| 1345 |
page"; and TAB or HT (9) often (though not always) means |
| 1346 |
"move the cursor to the next available column after the |
| 1347 |
current position where the column number is a multiple of 8 |
| 1348 |
(counting the first column as column 0)." Apart from this, |
| 1349 |
any use of the control characters or DEL in a body must be |
| 1350 |
part of a private agreement between the sender and |
| 1351 |
recipient. Such private agreements are discouraged and |
| 1352 |
should be replaced by the other capabilities of this |
| 1353 |
document. |
| 1354 |
|
| 1355 |
|
| 1356 |
|
| 1357 |
<span class="grey"> Borenstein & Freed [Page 21]</span></pre> |
| 1358 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span> |
| 1359 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1360 |
|
| 1361 |
|
| 1362 |
NOTE: Beyond US-ASCII, an enormous proliferation of |
| 1363 |
character sets is possible. It is the opinion of the IETF |
| 1364 |
working group that a large number of character sets is NOT a |
| 1365 |
good thing. We would prefer to specify a single character |
| 1366 |
set that can be used universally for representing all of the |
| 1367 |
world's languages in electronic mail. Unfortunately, |
| 1368 |
existing practice in several communities seems to point to |
| 1369 |
the continued use of multiple character sets in the near |
| 1370 |
future. For this reason, we define names for a small number |
| 1371 |
of character sets for which a strong constituent base |
| 1372 |
exists. It is our hope that ISO 10646 or some other |
| 1373 |
effort will eventually define a single world character set |
| 1374 |
which can then be specified for use in Internet mail, but in |
| 1375 |
the advance of that definition we cannot specify the use of |
| 1376 |
ISO 10646, Unicode, or any other character set whose |
| 1377 |
definition is, as of this writing, incomplete. |
| 1378 |
|
| 1379 |
The defined charset values are: |
| 1380 |
|
| 1381 |
US-ASCII -- as defined in [<a href="#ref-US-ASCII">US-ASCII</a>]. |
| 1382 |
|
| 1383 |
ISO-8859-X -- where "X" is to be replaced, as |
| 1384 |
necessary, for the parts of ISO-8859 [ISO- |
| 1385 |
8859]. Note that the ISO 646 character sets |
| 1386 |
have deliberately been omitted in favor of |
| 1387 |
their 8859 replacements, which are the |
| 1388 |
designated character sets for Internet mail. |
| 1389 |
As of the publication of this document, the |
| 1390 |
legitimate values for "X" are the digits 1 |
| 1391 |
through 9. |
| 1392 |
|
| 1393 |
Note that the character set used, if anything other than |
| 1394 |
US-ASCII, must always be explicitly specified in the |
| 1395 |
Content-Type field. |
| 1396 |
|
| 1397 |
No other character set name may be used in Internet mail |
| 1398 |
without the publication of a formal specification and its |
| 1399 |
registration with IANA as described in Appendix F, or by |
| 1400 |
private agreement, in which case the character set name must |
| 1401 |
begin with "X-". |
| 1402 |
|
| 1403 |
Implementors are discouraged from defining new character |
| 1404 |
sets for mail use unless absolutely necessary. |
| 1405 |
|
| 1406 |
The "charset" parameter has been defined primarily for the |
| 1407 |
purpose of textual data, and is described in this section |
| 1408 |
for that reason. However, it is conceivable that non- |
| 1409 |
textual data might also wish to specify a charset value for |
| 1410 |
some purpose, in which case the same syntax and values |
| 1411 |
should be used. |
| 1412 |
|
| 1413 |
In general, mail-sending software should always use the |
| 1414 |
"lowest common denominator" character set possible. For |
| 1415 |
example, if a body contains only US-ASCII characters, it |
| 1416 |
|
| 1417 |
|
| 1418 |
|
| 1419 |
<span class="grey"> Borenstein & Freed [Page 22]</span></pre> |
| 1420 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span> |
| 1421 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1422 |
|
| 1423 |
|
| 1424 |
should be marked as being in the US-ASCII character set, not |
| 1425 |
ISO-8859-1, which, like all the ISO-8859 family of character |
| 1426 |
sets, is a superset of US-ASCII. More generally, if a |
| 1427 |
widely-used character set is a subset of another character |
| 1428 |
set, and a body contains only characters in the widely-used |
| 1429 |
subset, it should be labeled as being in that subset. This |
| 1430 |
will increase the chances that the recipient will be able to |
| 1431 |
view the mail correctly. |
| 1432 |
|
| 1433 |
7.1.2 The Text/plain subtype |
| 1434 |
|
| 1435 |
The primary subtype of text is "plain". This indicates |
| 1436 |
plain (unformatted) text. The default Content-Type for |
| 1437 |
Internet mail, "text/plain; charset=us-ascii", describes |
| 1438 |
existing Internet practice, that is, it is the type of body |
| 1439 |
defined by <a href="./rfc822">RFC 822</a>. |
| 1440 |
|
| 1441 |
7.1.3 The Text/richtext subtype |
| 1442 |
|
| 1443 |
In order to promote the wider interoperability of simple |
| 1444 |
formatted text, this document defines an extremely simple |
| 1445 |
subtype of "text", the "richtext" subtype. This subtype was |
| 1446 |
designed to meet the following criteria: |
| 1447 |
|
| 1448 |
1. The syntax must be extremely simple to parse, |
| 1449 |
so that even teletype-oriented mail systems can |
| 1450 |
easily strip away the formatting information and |
| 1451 |
leave only the readable text. |
| 1452 |
|
| 1453 |
2. The syntax must be extensible to allow for new |
| 1454 |
formatting commands that are deemed essential. |
| 1455 |
|
| 1456 |
3. The capabilities must be extremely limited, to |
| 1457 |
ensure that it can represent no more than is |
| 1458 |
likely to be representable by the user's primary |
| 1459 |
word processor. While this limits what can be |
| 1460 |
sent, it increases the likelihood that what is |
| 1461 |
sent can be properly displayed. |
| 1462 |
|
| 1463 |
4. The syntax must be compatible with SGML, so |
| 1464 |
that, with an appropriate DTD (Document Type |
| 1465 |
Definition, the standard mechanism for defining a |
| 1466 |
document type using SGML), a general SGML parser |
| 1467 |
could be made to parse richtext. However, despite |
| 1468 |
this compatibility, the syntax should be far |
| 1469 |
simpler than full SGML, so that no SGML knowledge |
| 1470 |
is required in order to implement it. |
| 1471 |
|
| 1472 |
The syntax of "richtext" is very simple. It is assumed, at |
| 1473 |
the top-level, to be in the US-ASCII character set, unless |
| 1474 |
of course a different charset parameter was specified in the |
| 1475 |
Content-type field. All characters represent themselves, |
| 1476 |
with the exception of the "<" character (ASCII 60), which is |
| 1477 |
used to mark the beginning of a formatting command. |
| 1478 |
|
| 1479 |
|
| 1480 |
|
| 1481 |
<span class="grey"> Borenstein & Freed [Page 23]</span></pre> |
| 1482 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span> |
| 1483 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1484 |
|
| 1485 |
|
| 1486 |
Formatting instructions consist of formatting commands |
| 1487 |
surrounded by angle brackets ("<>", ASCII 60 and 62). Each |
| 1488 |
formatting command may be no more than 40 characters in |
| 1489 |
length, all in US-ASCII, restricted to the alphanumeric and |
| 1490 |
hyphen ("-") characters. Formatting commands may be preceded |
| 1491 |
by a forward slash or solidus ("/", ASCII 47), making them |
| 1492 |
negations, and such negations must always exist to balance |
| 1493 |
the initial opening commands, except as noted below. Thus, |
| 1494 |
if the formatting command "<bold>" appears at some point, |
| 1495 |
there must later be a "</bold>" to balance it. There are |
| 1496 |
only three exceptions to this "balancing" rule: First, the |
| 1497 |
command "<lt>" is used to represent a literal "<" character. |
| 1498 |
Second, the command "<nl>" is used to represent a required |
| 1499 |
line break. (Otherwise, CRLFs in the data are treated as |
| 1500 |
equivalent to a single SPACE character.) Finally, the |
| 1501 |
command "<np>" is used to represent a page break. (NOTE: |
| 1502 |
The 40 character limit on formatting commands does not |
| 1503 |
include the "<", ">", or "/" characters that might be |
| 1504 |
attached to such commands.) |
| 1505 |
|
| 1506 |
Initially defined formatting commands, not all of which will |
| 1507 |
be implemented by all richtext implementations, include: |
| 1508 |
|
| 1509 |
Bold -- causes the subsequent text to be in a bold |
| 1510 |
font. |
| 1511 |
Italic -- causes the subsequent text to be in an italic |
| 1512 |
font. |
| 1513 |
Fixed -- causes the subsequent text to be in a fixed |
| 1514 |
width font. |
| 1515 |
Smaller -- causes the subsequent text to be in a |
| 1516 |
smaller font. |
| 1517 |
Bigger -- causes the subsequent text to be in a bigger |
| 1518 |
font. |
| 1519 |
Underline -- causes the subsequent text to be |
| 1520 |
underlined. |
| 1521 |
Center -- causes the subsequent text to be centered. |
| 1522 |
FlushLeft -- causes the subsequent text to be left |
| 1523 |
justified. |
| 1524 |
FlushRight -- causes the subsequent text to be right |
| 1525 |
justified. |
| 1526 |
Indent -- causes the subsequent text to be indented at |
| 1527 |
the left margin. |
| 1528 |
IndentRight -- causes the subsequent text to be |
| 1529 |
indented at the right margin. |
| 1530 |
Outdent -- causes the subsequent text to be outdented |
| 1531 |
at the left margin. |
| 1532 |
OutdentRight -- causes the subsequent text to be |
| 1533 |
outdented at the right margin. |
| 1534 |
SamePage -- causes the subsequent text to be grouped, |
| 1535 |
if possible, on one page. |
| 1536 |
Subscript -- causes the subsequent text to be |
| 1537 |
interpreted as a subscript. |
| 1538 |
|
| 1539 |
|
| 1540 |
|
| 1541 |
|
| 1542 |
|
| 1543 |
<span class="grey"> Borenstein & Freed [Page 24]</span></pre> |
| 1544 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-25" ></span> |
| 1545 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1546 |
|
| 1547 |
|
| 1548 |
Superscript -- causes the subsequent text to be |
| 1549 |
interpreted as a superscript. |
| 1550 |
Heading -- causes the subsequent text to be interpreted |
| 1551 |
as a page heading. |
| 1552 |
Footing -- causes the subsequent text to be interpreted |
| 1553 |
as a page footing. |
| 1554 |
ISO-8859-X (for any value of X that is legal as a |
| 1555 |
"charset" parameter) -- causes the subsequent text |
| 1556 |
to be interpreted as text in the appropriate |
| 1557 |
character set. |
| 1558 |
US-ASCII -- causes the subsequent text to be |
| 1559 |
interpreted as text in the US-ASCII character set. |
| 1560 |
Excerpt -- causes the subsequent text to be interpreted |
| 1561 |
as a textual excerpt from another source. |
| 1562 |
Typically this will be displayed using indentation |
| 1563 |
and an alternate font, but such decisions are up |
| 1564 |
to the viewer. |
| 1565 |
Paragraph -- causes the subsequent text to be |
| 1566 |
interpreted as a single paragraph, with |
| 1567 |
appropriate paragraph breaks (typically blank |
| 1568 |
space) before and after. |
| 1569 |
Signature -- causes the subsequent text to be |
| 1570 |
interpreted as a "signature". Some systems may |
| 1571 |
wish to display signatures in a smaller font or |
| 1572 |
otherwise set them apart from the main text of the |
| 1573 |
message. |
| 1574 |
Comment -- causes the subsequent text to be interpreted |
| 1575 |
as a comment, and hence not shown to the reader. |
| 1576 |
No-op -- has no effect on the subsequent text. |
| 1577 |
lt -- <lt> is replaced by a literal "<" character. No |
| 1578 |
balancing </lt> is allowed. |
| 1579 |
nl -- <nl> causes a line break. No balancing </nl> is |
| 1580 |
allowed. |
| 1581 |
np -- <np> causes a page break. No balancing </np> is |
| 1582 |
allowed. |
| 1583 |
|
| 1584 |
Each positive formatting command affects all subsequent text |
| 1585 |
until the matching negative formatting command. Such pairs |
| 1586 |
of formatting commands must be properly balanced and nested. |
| 1587 |
Thus, a proper way to describe text in bold italics is: |
| 1588 |
|
| 1589 |
<bold><italic>the-text</italic></bold> |
| 1590 |
|
| 1591 |
or, alternately, |
| 1592 |
|
| 1593 |
<italic><bold>the-text</bold></italic> |
| 1594 |
|
| 1595 |
but, in particular, the following is illegal |
| 1596 |
richtext: |
| 1597 |
|
| 1598 |
<bold><italic>the-text</bold></italic> |
| 1599 |
|
| 1600 |
NOTE: The nesting requirement for formatting commands |
| 1601 |
imposes a slightly higher burden upon the composers of |
| 1602 |
|
| 1603 |
|
| 1604 |
|
| 1605 |
<span class="grey"> Borenstein & Freed [Page 25]</span></pre> |
| 1606 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-26" ></span> |
| 1607 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1608 |
|
| 1609 |
|
| 1610 |
richtext bodies, but potentially simplifies richtext |
| 1611 |
displayers by allowing them to be stack-based. The main |
| 1612 |
goal of richtext is to be simple enough to make multifont, |
| 1613 |
formatted email widely readable, so that those with the |
| 1614 |
capability of sending it will be able to do so with |
| 1615 |
confidence. Thus slightly increased complexity in the |
| 1616 |
composing software was deemed a reasonable tradeoff for |
| 1617 |
simplified reading software. Nonetheless, implementors of |
| 1618 |
richtext readers are encouraged to follow the general |
| 1619 |
Internet guidelines of being conservative in what you send |
| 1620 |
and liberal in what you accept. Those implementations that |
| 1621 |
can do so are encouraged to deal reasonably with improperly |
| 1622 |
nested richtext. |
| 1623 |
|
| 1624 |
Implementations must regard any unrecognized formatting |
| 1625 |
command as equivalent to "No-op", thus facilitating future |
| 1626 |
extensions to "richtext". Private extensions may be defined |
| 1627 |
using formatting commands that begin with "X-", by analogy |
| 1628 |
to Internet mail header field names. |
| 1629 |
|
| 1630 |
It is worth noting that no special behavior is required for |
| 1631 |
the TAB (HT) character. It is recommended, however, that, at |
| 1632 |
least when fixed-width fonts are in use, the common |
| 1633 |
semantics of the TAB (HT) character should be observed, |
| 1634 |
namely that it moves to the next column position that is a |
| 1635 |
multiple of 8. (In other words, if a TAB (HT) occurs in |
| 1636 |
column n, where the leftmost column is column 0, then that |
| 1637 |
TAB (HT) should be replaced by 8-(n mod 8) SPACE |
| 1638 |
characters.) |
| 1639 |
|
| 1640 |
Richtext also differentiates between "hard" and "soft" line |
| 1641 |
breaks. A line break (CRLF) in the richtext data stream is |
| 1642 |
interpreted as a "soft" line break, one that is included |
| 1643 |
only for purposes of mail transport, and is to be treated as |
| 1644 |
white space by richtext interpreters. To include a "hard" |
| 1645 |
line break (one that must be displayed as such), the "<nl>" |
| 1646 |
or "<paragraph> formatting constructs should be used. In |
| 1647 |
general, a soft line break should be treated as white space, |
| 1648 |
but when soft line breaks immediately follow a <nl> or a |
| 1649 |
</paragraph> tag they should be ignored rather than treated |
| 1650 |
as white space. |
| 1651 |
|
| 1652 |
Putting all this together, the following "text/richtext" |
| 1653 |
body fragment: |
| 1654 |
|
| 1655 |
<bold>Now</bold> is the time for |
| 1656 |
<italic>all</italic> good men |
| 1657 |
<smaller>(and <lt>women>)</smaller> to |
| 1658 |
<ignoreme></ignoreme> come |
| 1659 |
|
| 1660 |
to the aid of their |
| 1661 |
<nl> |
| 1662 |
|
| 1663 |
|
| 1664 |
|
| 1665 |
|
| 1666 |
|
| 1667 |
<span class="grey"> Borenstein & Freed [Page 26]</span></pre> |
| 1668 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-27" ></span> |
| 1669 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1670 |
|
| 1671 |
|
| 1672 |
beloved <nl><nl>country. <comment> Stupid |
| 1673 |
quote! </comment> -- the end |
| 1674 |
|
| 1675 |
represents the following formatted text (which will, no |
| 1676 |
doubt, look cryptic in the text-only version of this |
| 1677 |
document): |
| 1678 |
|
| 1679 |
Now is the time for all good men (and <women>) to |
| 1680 |
come to the aid of their |
| 1681 |
beloved |
| 1682 |
|
| 1683 |
country. -- the end |
| 1684 |
|
| 1685 |
Richtext conformance: A minimal richtext implementation is |
| 1686 |
one that simply converts "<lt>" to "<", converts CRLFs to |
| 1687 |
SPACE, converts <nl> to a newline according to local newline |
| 1688 |
convention, removes everything between a <comment> command |
| 1689 |
and the next balancing </comment> command, and removes all |
| 1690 |
other formatting commands (all text enclosed in angle |
| 1691 |
brackets). |
| 1692 |
|
| 1693 |
NOTE ON THE RELATIONSHIP OF RICHTEXT TO SGML: Richtext is |
| 1694 |
decidedly not SGML, and must not be used to transport |
| 1695 |
arbitrary SGML documents. Those who wish to use SGML |
| 1696 |
document types as a mail transport format must define a new |
| 1697 |
text or application subtype, e.g., "text/sgml-dtd-whatever" |
| 1698 |
or "application/sgml-dtd-whatever", depending on the |
| 1699 |
perceived readability of the DTD in use. Richtext is |
| 1700 |
designed to be compatible with SGML, and specifically so |
| 1701 |
that it will be possible to define a richtext DTD if one is |
| 1702 |
needed. However, this does not imply that arbitrary SGML |
| 1703 |
can be called richtext, nor that richtext implementors have |
| 1704 |
any need to understand SGML; the description in this |
| 1705 |
document is a complete definition of richtext, which is far |
| 1706 |
simpler than complete SGML. |
| 1707 |
|
| 1708 |
NOTE ON THE INTENDED USE OF RICHTEXT: It is recognized that |
| 1709 |
implementors of future mail systems will want rich text |
| 1710 |
functionality far beyond that currently defined for |
| 1711 |
richtext. The intent of richtext is to provide a common |
| 1712 |
format for expressing that functionality in a form in which |
| 1713 |
much of it, at least, will be understood by interoperating |
| 1714 |
software. Thus, in particular, software with a richer |
| 1715 |
notion of formatted text than richtext can still use |
| 1716 |
richtext as its basic representation, but can extend it with |
| 1717 |
new formatting commands and by hiding information specific |
| 1718 |
to that software system in richtext comments. As such |
| 1719 |
systems evolve, it is expected that the definition of |
| 1720 |
richtext will be further refined by future published |
| 1721 |
specifications, but richtext as defined here provides a |
| 1722 |
platform on which evolutionary refinements can be based. |
| 1723 |
|
| 1724 |
IMPLEMENTATION NOTE: In some environments, it might be |
| 1725 |
impossible to combine certain richtext formatting commands, |
| 1726 |
|
| 1727 |
|
| 1728 |
|
| 1729 |
<span class="grey"> Borenstein & Freed [Page 27]</span></pre> |
| 1730 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-28" ></span> |
| 1731 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1732 |
|
| 1733 |
|
| 1734 |
whereas in others they might be combined easily. For |
| 1735 |
example, the combination of <bold> and <italic> might |
| 1736 |
produce bold italics on systems that support such fonts, but |
| 1737 |
there exist systems that can make text bold or italicized, |
| 1738 |
but not both. In such cases, the most recently issued |
| 1739 |
recognized formatting command should be preferred. |
| 1740 |
|
| 1741 |
One of the major goals in the design of richtext was to make |
| 1742 |
it so simple that even text-only mailers will implement |
| 1743 |
richtext-to-plain-text translators, thus increasing the |
| 1744 |
likelihood that multifont text will become "safe" to use |
| 1745 |
very widely. To demonstrate this simplicity, an extremely |
| 1746 |
simple 35-line C program that converts richtext input into |
| 1747 |
plain text output is included in <a href="#appendix-D">Appendix D</a>. |
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
|
| 1752 |
|
| 1753 |
|
| 1754 |
|
| 1755 |
|
| 1756 |
|
| 1757 |
|
| 1758 |
|
| 1759 |
|
| 1760 |
|
| 1761 |
|
| 1762 |
|
| 1763 |
|
| 1764 |
|
| 1765 |
|
| 1766 |
|
| 1767 |
|
| 1768 |
|
| 1769 |
|
| 1770 |
|
| 1771 |
|
| 1772 |
|
| 1773 |
|
| 1774 |
|
| 1775 |
|
| 1776 |
|
| 1777 |
|
| 1778 |
|
| 1779 |
|
| 1780 |
|
| 1781 |
|
| 1782 |
|
| 1783 |
|
| 1784 |
|
| 1785 |
|
| 1786 |
|
| 1787 |
|
| 1788 |
|
| 1789 |
|
| 1790 |
|
| 1791 |
<span class="grey"> Borenstein & Freed [Page 28]</span></pre> |
| 1792 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-29" ></span> |
| 1793 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1794 |
|
| 1795 |
|
| 1796 |
7.2 The Multipart Content-Type |
| 1797 |
|
| 1798 |
In the case of multiple part messages, in which one or more |
| 1799 |
different sets of data are combined in a single body, a |
| 1800 |
"multipart" Content-Type field must appear in the entity's |
| 1801 |
header. The body must then contain one or more "body parts," |
| 1802 |
each preceded by an encapsulation boundary, and the last one |
| 1803 |
followed by a closing boundary. Each part starts with an |
| 1804 |
encapsulation boundary, and then contains a body part |
| 1805 |
consisting of header area, a blank line, and a body area. |
| 1806 |
Thus a body part is similar to an <a href="./rfc822">RFC 822</a> message in syntax, |
| 1807 |
but different in meaning. |
| 1808 |
|
| 1809 |
A body part is NOT to be interpreted as actually being an |
| 1810 |
RFC 822 message. To begin with, NO header fields are |
| 1811 |
actually required in body parts. A body part that starts |
| 1812 |
with a blank line, therefore, is allowed and is a body part |
| 1813 |
for which all default values are to be assumed. In such a |
| 1814 |
case, the absence of a Content-Type header field implies |
| 1815 |
that the encapsulation is plain US-ASCII text. The only |
| 1816 |
header fields that have defined meaning for body parts are |
| 1817 |
those the names of which begin with "Content-". All other |
| 1818 |
header fields are generally to be ignored in body parts. |
| 1819 |
Although they should generally be retained in mail |
| 1820 |
processing, they may be discarded by gateways if necessary. |
| 1821 |
Such other fields are permitted to appear in body parts but |
| 1822 |
should not be depended on. "X-" fields may be created for |
| 1823 |
experimental or private purposes, with the recognition that |
| 1824 |
the information they contain may be lost at some gateways. |
| 1825 |
|
| 1826 |
The distinction between an <a href="./rfc822">RFC 822</a> message and a body part |
| 1827 |
is subtle, but important. A gateway between Internet and |
| 1828 |
X.400 mail, for example, must be able to tell the difference |
| 1829 |
between a body part that contains an image and a body part |
| 1830 |
that contains an encapsulated message, the body of which is |
| 1831 |
an image. In order to represent the latter, the body part |
| 1832 |
must have "Content-Type: message", and its body (after the |
| 1833 |
blank line) must be the encapsulated message, with its own |
| 1834 |
"Content-Type: image" header field. The use of similar |
| 1835 |
syntax facilitates the conversion of messages to body parts, |
| 1836 |
and vice versa, but the distinction between the two must be |
| 1837 |
understood by implementors. (For the special case in which |
| 1838 |
all parts actually are messages, a "digest" subtype is also |
| 1839 |
defined.) |
| 1840 |
|
| 1841 |
As stated previously, each body part is preceded by an |
| 1842 |
encapsulation boundary. The encapsulation boundary MUST NOT |
| 1843 |
appear inside any of the encapsulated parts. Thus, it is |
| 1844 |
crucial that the composing agent be able to choose and |
| 1845 |
specify the unique boundary that will separate the parts. |
| 1846 |
|
| 1847 |
All present and future subtypes of the "multipart" type must |
| 1848 |
use an identical syntax. Subtypes may differ in their |
| 1849 |
semantics, and may impose additional restrictions on syntax, |
| 1850 |
|
| 1851 |
|
| 1852 |
|
| 1853 |
<span class="grey"> Borenstein & Freed [Page 29]</span></pre> |
| 1854 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-30" ></span> |
| 1855 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1856 |
|
| 1857 |
|
| 1858 |
but must conform to the required syntax for the multipart |
| 1859 |
type. This requirement ensures that all conformant user |
| 1860 |
agents will at least be able to recognize and separate the |
| 1861 |
parts of any multipart entity, even of an unrecognized |
| 1862 |
subtype. |
| 1863 |
|
| 1864 |
As stated in the definition of the Content-Transfer-Encoding |
| 1865 |
field, no encoding other than "7bit", "8bit", or "binary" is |
| 1866 |
permitted for entities of type "multipart". The multipart |
| 1867 |
delimiters and header fields are always 7-bit ASCII in any |
| 1868 |
case, and data within the body parts can be encoded on a |
| 1869 |
part-by-part basis, with Content-Transfer-Encoding fields |
| 1870 |
for each appropriate body part. |
| 1871 |
|
| 1872 |
Mail gateways, relays, and other mail handling agents are |
| 1873 |
commonly known to alter the top-level header of an <a href="./rfc822">RFC 822</a> |
| 1874 |
message. In particular, they frequently add, remove, or |
| 1875 |
reorder header fields. Such alterations are explicitly |
| 1876 |
forbidden for the body part headers embedded in the bodies |
| 1877 |
of messages of type "multipart." |
| 1878 |
|
| 1879 |
7.2.1 Multipart: The common syntax |
| 1880 |
|
| 1881 |
All subtypes of "multipart" share a common syntax, defined |
| 1882 |
in this section. A simple example of a multipart message |
| 1883 |
also appears in this section. An example of a more complex |
| 1884 |
multipart message is given in <a href="#appendix-C">Appendix C</a>. |
| 1885 |
|
| 1886 |
The Content-Type field for multipart entities requires one |
| 1887 |
parameter, "boundary", which is used to specify the |
| 1888 |
encapsulation boundary. The encapsulation boundary is |
| 1889 |
defined as a line consisting entirely of two hyphen |
| 1890 |
characters ("-", decimal code 45) followed by the boundary |
| 1891 |
parameter value from the Content-Type header field. |
| 1892 |
|
| 1893 |
NOTE: The hyphens are for rough compatibility with the |
| 1894 |
earlier RFC 934 method of message encapsulation, and for |
| 1895 |
ease of searching for the boundaries in some |
| 1896 |
implementations. However, it should be noted that multipart |
| 1897 |
messages are NOT completely compatible with RFC 934 |
| 1898 |
encapsulations; in particular, they do not obey <a href="./rfc934">RFC 934</a> |
| 1899 |
quoting conventions for embedded lines that begin with |
| 1900 |
hyphens. This mechanism was chosen over the RFC 934 |
| 1901 |
mechanism because the latter causes lines to grow with each |
| 1902 |
level of quoting. The combination of this growth with the |
| 1903 |
fact that SMTP implementations sometimes wrap long lines |
| 1904 |
made the <a href="./rfc934">RFC 934</a> mechanism unsuitable for use in the event |
| 1905 |
that deeply-nested multipart structuring is ever desired. |
| 1906 |
|
| 1907 |
Thus, a typical multipart Content-Type header field might |
| 1908 |
look like this: |
| 1909 |
|
| 1910 |
Content-Type: multipart/mixed; |
| 1911 |
|
| 1912 |
|
| 1913 |
|
| 1914 |
|
| 1915 |
<span class="grey"> Borenstein & Freed [Page 30]</span></pre> |
| 1916 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-31" ></span> |
| 1917 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1918 |
|
| 1919 |
|
| 1920 |
boundary=gc0p4Jq0M2Yt08jU534c0p |
| 1921 |
|
| 1922 |
This indicates that the entity consists of several parts, |
| 1923 |
each itself with a structure that is syntactically identical |
| 1924 |
to an <a href="./rfc822">RFC 822</a> message, except that the header area might be |
| 1925 |
completely empty, and that the parts are each preceded by |
| 1926 |
the line |
| 1927 |
|
| 1928 |
--gc0p4Jq0M2Yt08jU534c0p |
| 1929 |
|
| 1930 |
Note that the encapsulation boundary must occur at the |
| 1931 |
beginning of a line, i.e., following a CRLF, and that that |
| 1932 |
initial CRLF is considered to be part of the encapsulation |
| 1933 |
boundary rather than part of the preceding part. The |
| 1934 |
boundary must be followed immediately either by another CRLF |
| 1935 |
and the header fields for the next part, or by two CRLFs, in |
| 1936 |
which case there are no header fields for the next part (and |
| 1937 |
it is therefore assumed to be of Content-Type text/plain). |
| 1938 |
|
| 1939 |
NOTE: The CRLF preceding the encapsulation line is |
| 1940 |
considered part of the boundary so that it is possible to |
| 1941 |
have a part that does not end with a CRLF (line break). |
| 1942 |
Body parts that must be considered to end with line breaks, |
| 1943 |
therefore, should have two CRLFs preceding the encapsulation |
| 1944 |
line, the first of which is part of the preceding body part, |
| 1945 |
and the second of which is part of the encapsulation |
| 1946 |
boundary. |
| 1947 |
|
| 1948 |
The requirement that the encapsulation boundary begins with |
| 1949 |
a CRLF implies that the body of a multipart entity must |
| 1950 |
itself begin with a CRLF before the first encapsulation line |
| 1951 |
-- that is, if the "preamble" area is not used, the entity |
| 1952 |
headers must be followed by TWO CRLFs. This is indeed how |
| 1953 |
such entities should be composed. A tolerant mail reading |
| 1954 |
program, however, may interpret a body of type multipart |
| 1955 |
that begins with an encapsulation line NOT initiated by a |
| 1956 |
CRLF as also being an encapsulation boundary, but a |
| 1957 |
compliant mail sending program must not generate such |
| 1958 |
entities. |
| 1959 |
|
| 1960 |
Encapsulation boundaries must not appear within the |
| 1961 |
encapsulations, and must be no longer than 70 characters, |
| 1962 |
not counting the two leading hyphens. |
| 1963 |
|
| 1964 |
The encapsulation boundary following the last body part is a |
| 1965 |
distinguished delimiter that indicates that no further body |
| 1966 |
parts will follow. Such a delimiter is identical to the |
| 1967 |
previous delimiters, with the addition of two more hyphens |
| 1968 |
at the end of the line: |
| 1969 |
|
| 1970 |
--gc0p4Jq0M2Yt08jU534c0p-- |
| 1971 |
|
| 1972 |
There appears to be room for additional information prior to |
| 1973 |
the first encapsulation boundary and following the final |
| 1974 |
|
| 1975 |
|
| 1976 |
|
| 1977 |
<span class="grey"> Borenstein & Freed [Page 31]</span></pre> |
| 1978 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-32" ></span> |
| 1979 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 1980 |
|
| 1981 |
|
| 1982 |
boundary. These areas should generally be left blank, and |
| 1983 |
implementations should ignore anything that appears before |
| 1984 |
the first boundary or after the last one. |
| 1985 |
|
| 1986 |
NOTE: These "preamble" and "epilogue" areas are not used |
| 1987 |
because of the lack of proper typing of these parts and the |
| 1988 |
lack of clear semantics for handling these areas at |
| 1989 |
gateways, particularly X.400 gateways. |
| 1990 |
|
| 1991 |
NOTE: Because encapsulation boundaries must not appear in |
| 1992 |
the body parts being encapsulated, a user agent must |
| 1993 |
exercise care to choose a unique boundary. The boundary in |
| 1994 |
the example above could have been the result of an algorithm |
| 1995 |
designed to produce boundaries with a very low probability |
| 1996 |
of already existing in the data to be encapsulated without |
| 1997 |
having to prescan the data. Alternate algorithms might |
| 1998 |
result in more 'readable' boundaries for a recipient with an |
| 1999 |
old user agent, but would require more attention to the |
| 2000 |
possibility that the boundary might appear in the |
| 2001 |
encapsulated part. The simplest boundary possible is |
| 2002 |
something like "---", with a closing boundary of "-----". |
| 2003 |
|
| 2004 |
As a very simple example, the following multipart message |
| 2005 |
has two parts, both of them plain text, one of them |
| 2006 |
explicitly typed and one of them implicitly typed: |
| 2007 |
|
| 2008 |
From: Nathaniel Borenstein <[email protected]> |
| 2009 |
To: Ned Freed <[email protected]> |
| 2010 |
Subject: Sample message |
| 2011 |
MIME-Version: 1.0 |
| 2012 |
Content-type: multipart/mixed; boundary="simple |
| 2013 |
boundary" |
| 2014 |
|
| 2015 |
This is the preamble. It is to be ignored, though it |
| 2016 |
is a handy place for mail composers to include an |
| 2017 |
explanatory note to non-MIME compliant readers. |
| 2018 |
--simple boundary |
| 2019 |
|
| 2020 |
This is implicitly typed plain ASCII text. |
| 2021 |
It does NOT end with a linebreak. |
| 2022 |
--simple boundary |
| 2023 |
Content-type: text/plain; charset=us-ascii |
| 2024 |
|
| 2025 |
This is explicitly typed plain ASCII text. |
| 2026 |
It DOES end with a linebreak. |
| 2027 |
|
| 2028 |
--simple boundary-- |
| 2029 |
This is the epilogue. It is also to be ignored. |
| 2030 |
|
| 2031 |
The use of a Content-Type of multipart in a body part within |
| 2032 |
another multipart entity is explicitly allowed. In such |
| 2033 |
cases, for obvious reasons, care must be taken to ensure |
| 2034 |
that each nested multipart entity must use a different |
| 2035 |
boundary delimiter. See <a href="#appendix-C">Appendix C</a> for an example of nested |
| 2036 |
|
| 2037 |
|
| 2038 |
|
| 2039 |
<span class="grey"> Borenstein & Freed [Page 32]</span></pre> |
| 2040 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-33" ></span> |
| 2041 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2042 |
|
| 2043 |
|
| 2044 |
multipart entities. |
| 2045 |
|
| 2046 |
The use of the multipart Content-Type with only a single |
| 2047 |
body part may be useful in certain contexts, and is |
| 2048 |
explicitly permitted. |
| 2049 |
|
| 2050 |
The only mandatory parameter for the multipart Content-Type |
| 2051 |
is the boundary parameter, which consists of 1 to 70 |
| 2052 |
characters from a set of characters known to be very robust |
| 2053 |
through email gateways, and NOT ending with white space. |
| 2054 |
(If a boundary appears to end with white space, the white |
| 2055 |
space must be presumed to have been added by a gateway, and |
| 2056 |
should be deleted.) It is formally specified by the |
| 2057 |
following BNF: |
| 2058 |
|
| 2059 |
boundary := 0*69<bchars> bcharsnospace |
| 2060 |
|
| 2061 |
bchars := bcharsnospace / " " |
| 2062 |
|
| 2063 |
bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / |
| 2064 |
"_" |
| 2065 |
/ "," / "-" / "." / "/" / ":" / "=" / "?" |
| 2066 |
|
| 2067 |
Overall, the body of a multipart entity may be specified as |
| 2068 |
follows: |
| 2069 |
|
| 2070 |
multipart-body := preamble 1*encapsulation |
| 2071 |
close-delimiter epilogue |
| 2072 |
|
| 2073 |
encapsulation := delimiter CRLF body-part |
| 2074 |
|
| 2075 |
delimiter := CRLF "--" boundary ; taken from Content-Type |
| 2076 |
field. |
| 2077 |
; when content-type is |
| 2078 |
multipart |
| 2079 |
; There must be no space |
| 2080 |
; between "--" and boundary. |
| 2081 |
|
| 2082 |
close-delimiter := delimiter "--" ; Again, no space before |
| 2083 |
"--" |
| 2084 |
|
| 2085 |
preamble := *text ; to be ignored upon |
| 2086 |
receipt. |
| 2087 |
|
| 2088 |
epilogue := *text ; to be ignored upon |
| 2089 |
receipt. |
| 2090 |
|
| 2091 |
body-part = <"message" as defined in <a href="./rfc822">RFC 822</a>, |
| 2092 |
with all header fields optional, and with the |
| 2093 |
specified delimiter not occurring anywhere in |
| 2094 |
the message body, either on a line by itself |
| 2095 |
or as a substring anywhere. Note that the |
| 2096 |
|
| 2097 |
|
| 2098 |
|
| 2099 |
|
| 2100 |
|
| 2101 |
<span class="grey"> Borenstein & Freed [Page 33]</span></pre> |
| 2102 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-34" ></span> |
| 2103 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2104 |
|
| 2105 |
|
| 2106 |
semantics of a part differ from the semantics |
| 2107 |
of a message, as described in the text.> |
| 2108 |
|
| 2109 |
NOTE: Conspicuously missing from the multipart type is a |
| 2110 |
notion of structured, related body parts. In general, it |
| 2111 |
seems premature to try to standardize interpart structure |
| 2112 |
yet. It is recommended that those wishing to provide a more |
| 2113 |
structured or integrated multipart messaging facility should |
| 2114 |
define a subtype of multipart that is syntactically |
| 2115 |
identical, but that always expects the inclusion of a |
| 2116 |
distinguished part that can be used to specify the structure |
| 2117 |
and integration of the other parts, probably referring to |
| 2118 |
them by their Content-ID field. If this approach is used, |
| 2119 |
other implementations will not recognize the new subtype, |
| 2120 |
but will treat it as the primary subtype (multipart/mixed) |
| 2121 |
and will thus be able to show the user the parts that are |
| 2122 |
recognized. |
| 2123 |
|
| 2124 |
7.2.2 The Multipart/mixed (primary) subtype |
| 2125 |
|
| 2126 |
The primary subtype for multipart, "mixed", is intended for |
| 2127 |
use when the body parts are independent and intended to be |
| 2128 |
displayed serially. Any multipart subtypes that an |
| 2129 |
implementation does not recognize should be treated as being |
| 2130 |
of subtype "mixed". |
| 2131 |
|
| 2132 |
7.2.3 The Multipart/alternative subtype |
| 2133 |
|
| 2134 |
The multipart/alternative type is syntactically identical to |
| 2135 |
multipart/mixed, but the semantics are different. In |
| 2136 |
particular, each of the parts is an "alternative" version of |
| 2137 |
the same information. User agents should recognize that the |
| 2138 |
content of the various parts are interchangeable. The user |
| 2139 |
agent should either choose the "best" type based on the |
| 2140 |
user's environment and preferences, or offer the user the |
| 2141 |
available alternatives. In general, choosing the best type |
| 2142 |
means displaying only the LAST part that can be displayed. |
| 2143 |
This may be used, for example, to send mail in a fancy text |
| 2144 |
format in such a way that it can easily be displayed |
| 2145 |
anywhere: |
| 2146 |
|
| 2147 |
From: Nathaniel Borenstein <[email protected]> |
| 2148 |
To: Ned Freed <[email protected]> |
| 2149 |
Subject: Formatted text mail |
| 2150 |
MIME-Version: 1.0 |
| 2151 |
Content-Type: multipart/alternative; boundary=boundary42 |
| 2152 |
|
| 2153 |
|
| 2154 |
--boundary42 |
| 2155 |
Content-Type: text/plain; charset=us-ascii |
| 2156 |
|
| 2157 |
...plain text version of message goes here.... |
| 2158 |
|
| 2159 |
|
| 2160 |
|
| 2161 |
|
| 2162 |
|
| 2163 |
<span class="grey"> Borenstein & Freed [Page 34]</span></pre> |
| 2164 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-35" ></span> |
| 2165 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2166 |
|
| 2167 |
|
| 2168 |
--boundary42 |
| 2169 |
Content-Type: text/richtext |
| 2170 |
|
| 2171 |
.... richtext version of same message goes here ... |
| 2172 |
--boundary42 |
| 2173 |
Content-Type: text/x-whatever |
| 2174 |
|
| 2175 |
.... fanciest formatted version of same message goes here |
| 2176 |
... |
| 2177 |
--boundary42-- |
| 2178 |
|
| 2179 |
In this example, users whose mail system understood the |
| 2180 |
"text/x-whatever" format would see only the fancy version, |
| 2181 |
while other users would see only the richtext or plain text |
| 2182 |
version, depending on the capabilities of their system. |
| 2183 |
|
| 2184 |
In general, user agents that compose multipart/alternative |
| 2185 |
entities should place the body parts in increasing order of |
| 2186 |
preference, that is, with the preferred format last. For |
| 2187 |
fancy text, the sending user agent should put the plainest |
| 2188 |
format first and the richest format last. Receiving user |
| 2189 |
agents should pick and display the last format they are |
| 2190 |
capable of displaying. In the case where one of the |
| 2191 |
alternatives is itself of type "multipart" and contains |
| 2192 |
unrecognized sub-parts, the user agent may choose either to |
| 2193 |
show that alternative, an earlier alternative, or both. |
| 2194 |
|
| 2195 |
NOTE: From an implementor's perspective, it might seem more |
| 2196 |
sensible to reverse this ordering, and have the plainest |
| 2197 |
alternative last. However, placing the plainest alternative |
| 2198 |
first is the friendliest possible option when |
| 2199 |
mutlipart/alternative entities are viewed using a non-MIME- |
| 2200 |
compliant mail reader. While this approach does impose some |
| 2201 |
burden on compliant mail readers, interoperability with |
| 2202 |
older mail readers was deemed to be more important in this |
| 2203 |
case. |
| 2204 |
|
| 2205 |
It may be the case that some user agents, if they can |
| 2206 |
recognize more than one of the formats, will prefer to offer |
| 2207 |
the user the choice of which format to view. This makes |
| 2208 |
sense, for example, if mail includes both a nicely-formatted |
| 2209 |
image version and an easily-edited text version. What is |
| 2210 |
most critical, however, is that the user not automatically |
| 2211 |
be shown multiple versions of the same data. Either the |
| 2212 |
user should be shown the last recognized version or should |
| 2213 |
explicitly be given the choice. |
| 2214 |
|
| 2215 |
|
| 2216 |
|
| 2217 |
|
| 2218 |
|
| 2219 |
|
| 2220 |
|
| 2221 |
|
| 2222 |
|
| 2223 |
|
| 2224 |
|
| 2225 |
<span class="grey"> Borenstein & Freed [Page 35]</span></pre> |
| 2226 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-36" ></span> |
| 2227 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2228 |
|
| 2229 |
|
| 2230 |
7.2.4 The Multipart/digest subtype |
| 2231 |
|
| 2232 |
This document defines a "digest" subtype of the multipart |
| 2233 |
Content-Type. This type is syntactically identical to |
| 2234 |
multipart/mixed, but the semantics are different. In |
| 2235 |
particular, in a digest, the default Content-Type value for |
| 2236 |
a body part is changed from "text/plain" to |
| 2237 |
"message/rfc822". This is done to allow a more readable |
| 2238 |
digest format that is largely compatible (except for the |
| 2239 |
quoting convention) with <a href="./rfc934">RFC 934</a>. |
| 2240 |
|
| 2241 |
A digest in this format might, then, look something like |
| 2242 |
this: |
| 2243 |
|
| 2244 |
From: Moderator-Address |
| 2245 |
MIME-Version: 1.0 |
| 2246 |
Subject: Internet Digest, volume 42 |
| 2247 |
Content-Type: multipart/digest; |
| 2248 |
boundary="---- next message ----" |
| 2249 |
|
| 2250 |
|
| 2251 |
------ next message ---- |
| 2252 |
|
| 2253 |
From: someone-else |
| 2254 |
Subject: my opinion |
| 2255 |
|
| 2256 |
...body goes here ... |
| 2257 |
|
| 2258 |
------ next message ---- |
| 2259 |
|
| 2260 |
From: someone-else-again |
| 2261 |
Subject: my different opinion |
| 2262 |
|
| 2263 |
... another body goes here... |
| 2264 |
|
| 2265 |
------ next message ------ |
| 2266 |
|
| 2267 |
7.2.5 The Multipart/parallel subtype |
| 2268 |
|
| 2269 |
This document defines a "parallel" subtype of the multipart |
| 2270 |
Content-Type. This type is syntactically identical to |
| 2271 |
multipart/mixed, but the semantics are different. In |
| 2272 |
particular, in a parallel entity, all of the parts are |
| 2273 |
intended to be presented in parallel, i.e., simultaneously, |
| 2274 |
on hardware and software that are capable of doing so. |
| 2275 |
Composing agents should be aware that many mail readers will |
| 2276 |
lack this capability and will show the parts serially in any |
| 2277 |
event. |
| 2278 |
|
| 2279 |
|
| 2280 |
|
| 2281 |
|
| 2282 |
|
| 2283 |
|
| 2284 |
|
| 2285 |
|
| 2286 |
|
| 2287 |
<span class="grey"> Borenstein & Freed [Page 36]</span></pre> |
| 2288 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-37" ></span> |
| 2289 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2290 |
|
| 2291 |
|
| 2292 |
7.3 The Message Content-Type |
| 2293 |
|
| 2294 |
It is frequently desirable, in sending mail, to encapsulate |
| 2295 |
another mail message. For this common operation, a special |
| 2296 |
Content-Type, "message", is defined. The primary subtype, |
| 2297 |
message/rfc822, has no required parameters in the Content- |
| 2298 |
Type field. Additional subtypes, "partial" and "External- |
| 2299 |
body", do have required parameters. These subtypes are |
| 2300 |
explained below. |
| 2301 |
|
| 2302 |
NOTE: It has been suggested that subtypes of message might |
| 2303 |
be defined for forwarded or rejected messages. However, |
| 2304 |
forwarded and rejected messages can be handled as multipart |
| 2305 |
messages in which the first part contains any control or |
| 2306 |
descriptive information, and a second part, of type |
| 2307 |
message/rfc822, is the forwarded or rejected message. |
| 2308 |
Composing rejection and forwarding messages in this manner |
| 2309 |
will preserve the type information on the original message |
| 2310 |
and allow it to be correctly presented to the recipient, and |
| 2311 |
hence is strongly encouraged. |
| 2312 |
|
| 2313 |
As stated in the definition of the Content-Transfer-Encoding |
| 2314 |
field, no encoding other than "7bit", "8bit", or "binary" is |
| 2315 |
permitted for messages or parts of type "message". The |
| 2316 |
message header fields are always US-ASCII in any case, and |
| 2317 |
data within the body can still be encoded, in which case the |
| 2318 |
Content-Transfer-Encoding header field in the encapsulated |
| 2319 |
message will reflect this. Non-ASCII text in the headers of |
| 2320 |
an encapsulated message can be specified using the |
| 2321 |
mechanisms described in [<a href="./rfc1342" title="Keith">RFC-1342</a>]. |
| 2322 |
|
| 2323 |
Mail gateways, relays, and other mail handling agents are |
| 2324 |
commonly known to alter the top-level header of an <a href="./rfc822">RFC 822</a> |
| 2325 |
message. In particular, they frequently add, remove, or |
| 2326 |
reorder header fields. Such alterations are explicitly |
| 2327 |
forbidden for the encapsulated headers embedded in the |
| 2328 |
bodies of messages of type "message." |
| 2329 |
|
| 2330 |
7.3.1 The Message/rfc822 (primary) subtype |
| 2331 |
|
| 2332 |
A Content-Type of "message/rfc822" indicates that the body |
| 2333 |
contains an encapsulated message, with the syntax of an <a href="./rfc822">RFC</a> |
| 2334 |
<a href="./rfc822">822</a> message. |
| 2335 |
|
| 2336 |
7.3.2 The Message/Partial subtype |
| 2337 |
|
| 2338 |
A subtype of message, "partial", is defined in order to |
| 2339 |
allow large objects to be delivered as several separate |
| 2340 |
pieces of mail and automatically reassembled by the |
| 2341 |
receiving user agent. (The concept is similar to IP |
| 2342 |
fragmentation/reassembly in the basic Internet Protocols.) |
| 2343 |
This mechanism can be used when intermediate transport |
| 2344 |
agents limit the size of individual messages that can be |
| 2345 |
sent. Content-Type "message/partial" thus indicates that |
| 2346 |
|
| 2347 |
|
| 2348 |
|
| 2349 |
<span class="grey"> Borenstein & Freed [Page 37]</span></pre> |
| 2350 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-38" ></span> |
| 2351 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2352 |
|
| 2353 |
|
| 2354 |
the body contains a fragment of a larger message. |
| 2355 |
|
| 2356 |
Three parameters must be specified in the Content-Type field |
| 2357 |
of type message/partial: The first, "id", is a unique |
| 2358 |
identifier, as close to a world-unique identifier as |
| 2359 |
possible, to be used to match the parts together. (In |
| 2360 |
general, the identifier is essentially a message-id; if |
| 2361 |
placed in double quotes, it can be any message-id, in |
| 2362 |
accordance with the BNF for "parameter" given earlier in |
| 2363 |
this specification.) The second, "number", an integer, is |
| 2364 |
the part number, which indicates where this part fits into |
| 2365 |
the sequence of fragments. The third, "total", another |
| 2366 |
integer, is the total number of parts. This third subfield |
| 2367 |
is required on the final part, and is optional on the |
| 2368 |
earlier parts. Note also that these parameters may be given |
| 2369 |
in any order. |
| 2370 |
|
| 2371 |
Thus, part 2 of a 3-part message may have either of the |
| 2372 |
following header fields: |
| 2373 |
|
| 2374 |
Content-Type: Message/Partial; |
| 2375 |
number=2; total=3; |
| 2376 |
id="[email protected]"; |
| 2377 |
|
| 2378 |
Content-Type: Message/Partial; |
| 2379 |
id="[email protected]"; |
| 2380 |
number=2 |
| 2381 |
|
| 2382 |
But part 3 MUST specify the total number of parts: |
| 2383 |
|
| 2384 |
Content-Type: Message/Partial; |
| 2385 |
number=3; total=3; |
| 2386 |
id="[email protected]"; |
| 2387 |
|
| 2388 |
Note that part numbering begins with 1, not 0. |
| 2389 |
|
| 2390 |
When the parts of a message broken up in this manner are put |
| 2391 |
together, the result is a complete <a href="./rfc822">RFC 822</a> format message, |
| 2392 |
which may have its own Content-Type header field, and thus |
| 2393 |
may contain any other data type. |
| 2394 |
|
| 2395 |
Message fragmentation and reassembly: The semantics of a |
| 2396 |
reassembled partial message must be those of the "inner" |
| 2397 |
message, rather than of a message containing the inner |
| 2398 |
message. This makes it possible, for example, to send a |
| 2399 |
large audio message as several partial messages, and still |
| 2400 |
have it appear to the recipient as a simple audio message |
| 2401 |
rather than as an encapsulated message containing an audio |
| 2402 |
message. That is, the encapsulation of the message is |
| 2403 |
considered to be "transparent". |
| 2404 |
|
| 2405 |
When generating and reassembling the parts of a |
| 2406 |
message/partial message, the headers of the encapsulated |
| 2407 |
message must be merged with the headers of the enclosing |
| 2408 |
|
| 2409 |
|
| 2410 |
|
| 2411 |
<span class="grey"> Borenstein & Freed [Page 38]</span></pre> |
| 2412 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-39" ></span> |
| 2413 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2414 |
|
| 2415 |
|
| 2416 |
entities. In this process the following rules must be |
| 2417 |
observed: |
| 2418 |
|
| 2419 |
(1) All of the headers from the initial enclosing |
| 2420 |
entity (part one), except those that start with |
| 2421 |
"Content-" and "Message-ID", must be copied, in |
| 2422 |
order, to the new message. |
| 2423 |
|
| 2424 |
(2) Only those headers in the enclosed message |
| 2425 |
which start with "Content-" and "Message-ID" must |
| 2426 |
be appended, in order, to the headers of the new |
| 2427 |
message. Any headers in the enclosed message |
| 2428 |
which do not start with "Content-" (except for |
| 2429 |
"Message-ID") will be ignored. |
| 2430 |
|
| 2431 |
(3) All of the headers from the second and any |
| 2432 |
subsequent messages will be ignored. |
| 2433 |
|
| 2434 |
For example, if an audio message is broken into two parts, |
| 2435 |
the first part might look something like this: |
| 2436 |
|
| 2437 |
X-Weird-Header-1: Foo |
| 2438 |
From: [email protected] |
| 2439 |
To: [email protected] |
| 2440 |
Subject: Audio mail |
| 2441 |
Message-ID: [email protected] |
| 2442 |
MIME-Version: 1.0 |
| 2443 |
Content-type: message/partial; |
| 2444 |
id="[email protected]"; |
| 2445 |
number=1; total=2 |
| 2446 |
|
| 2447 |
X-Weird-Header-1: Bar |
| 2448 |
X-Weird-Header-2: Hello |
| 2449 |
Message-ID: [email protected] |
| 2450 |
Content-type: audio/basic |
| 2451 |
Content-transfer-encoding: base64 |
| 2452 |
|
| 2453 |
... first half of encoded audio data goes here... |
| 2454 |
|
| 2455 |
and the second half might look something like this: |
| 2456 |
|
| 2457 |
From: [email protected] |
| 2458 |
To: [email protected] |
| 2459 |
Subject: Audio mail |
| 2460 |
MIME-Version: 1.0 |
| 2461 |
Message-ID: [email protected] |
| 2462 |
Content-type: message/partial; |
| 2463 |
id="[email protected]"; number=2; total=2 |
| 2464 |
|
| 2465 |
... second half of encoded audio data goes here... |
| 2466 |
|
| 2467 |
Then, when the fragmented message is reassembled, the |
| 2468 |
resulting message to be displayed to the user should look |
| 2469 |
something like this: |
| 2470 |
|
| 2471 |
|
| 2472 |
|
| 2473 |
<span class="grey"> Borenstein & Freed [Page 39]</span></pre> |
| 2474 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-40" ></span> |
| 2475 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2476 |
|
| 2477 |
|
| 2478 |
X-Weird-Header-1: Foo |
| 2479 |
From: [email protected] |
| 2480 |
To: [email protected] |
| 2481 |
Subject: Audio mail |
| 2482 |
Message-ID: [email protected] |
| 2483 |
MIME-Version: 1.0 |
| 2484 |
Content-type: audio/basic |
| 2485 |
Content-transfer-encoding: base64 |
| 2486 |
|
| 2487 |
... first half of encoded audio data goes here... |
| 2488 |
... second half of encoded audio data goes here... |
| 2489 |
|
| 2490 |
It should be noted that, because some message transfer |
| 2491 |
agents may choose to automatically fragment large messages, |
| 2492 |
and because such agents may use different fragmentation |
| 2493 |
thresholds, it is possible that the pieces of a partial |
| 2494 |
message, upon reassembly, may prove themselves to comprise a |
| 2495 |
partial message. This is explicitly permitted. |
| 2496 |
|
| 2497 |
It should also be noted that the inclusion of a "References" |
| 2498 |
field in the headers of the second and subsequent pieces of |
| 2499 |
a fragmented message that references the Message-Id on the |
| 2500 |
previous piece may be of benefit to mail readers that |
| 2501 |
understand and track references. However, the generation of |
| 2502 |
such "References" fields is entirely optional. |
| 2503 |
|
| 2504 |
7.3.3 The Message/External-Body subtype |
| 2505 |
|
| 2506 |
The external-body subtype indicates that the actual body |
| 2507 |
data are not included, but merely referenced. In this case, |
| 2508 |
the parameters describe a mechanism for accessing the |
| 2509 |
external data. |
| 2510 |
|
| 2511 |
When a message body or body part is of type |
| 2512 |
"message/external-body", it consists of a header, two |
| 2513 |
consecutive CRLFs, and the message header for the |
| 2514 |
encapsulated message. If another pair of consecutive CRLFs |
| 2515 |
appears, this of course ends the message header for the |
| 2516 |
encapsulated message. However, since the encapsulated |
| 2517 |
message's body is itself external, it does NOT appear in the |
| 2518 |
area that follows. For example, consider the following |
| 2519 |
message: |
| 2520 |
|
| 2521 |
Content-type: message/external-body; access- |
| 2522 |
type=local-file; |
| 2523 |
name=/u/nsb/Me.gif |
| 2524 |
|
| 2525 |
Content-type: image/gif |
| 2526 |
|
| 2527 |
THIS IS NOT REALLY THE BODY! |
| 2528 |
|
| 2529 |
The area at the end, which might be called the "phantom |
| 2530 |
body", is ignored for most external-body messages. However, |
| 2531 |
it may be used to contain auxilliary information for some |
| 2532 |
|
| 2533 |
|
| 2534 |
|
| 2535 |
<span class="grey"> Borenstein & Freed [Page 40]</span></pre> |
| 2536 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-41" ></span> |
| 2537 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2538 |
|
| 2539 |
|
| 2540 |
such messages, as indeed it is when the access-type is |
| 2541 |
"mail-server". Of the access-types defined by this |
| 2542 |
document, the phantom body is used only when the access-type |
| 2543 |
is "mail-server". In all other cases, the phantom body is |
| 2544 |
ignored. |
| 2545 |
|
| 2546 |
The only always-mandatory parameter for message/external- |
| 2547 |
body is "access-type"; all of the other parameters may be |
| 2548 |
mandatory or optional depending on the value of access-type. |
| 2549 |
|
| 2550 |
ACCESS-TYPE -- One or more case-insensitive words, |
| 2551 |
comma-separated, indicating supported access |
| 2552 |
mechanisms by which the file or data may be |
| 2553 |
obtained. Values include, but are not limited to, |
| 2554 |
"FTP", "ANON-FTP", "TFTP", "AFS", "LOCAL-FILE", |
| 2555 |
and "MAIL-SERVER". Future values, except for |
| 2556 |
experimental values beginning with "X-", must be |
| 2557 |
registered with IANA, as described in <a href="#appendix-F">Appendix F</a> . |
| 2558 |
|
| 2559 |
In addition, the following two parameters are optional for |
| 2560 |
ALL access-types: |
| 2561 |
|
| 2562 |
EXPIRATION -- The date (in the <a href="./rfc822">RFC 822</a> "date-time" |
| 2563 |
syntax, as extended by <a href="./rfc1123">RFC 1123</a> to permit 4 digits |
| 2564 |
in the date field) after which the existence of |
| 2565 |
the external data is not guaranteed. |
| 2566 |
|
| 2567 |
SIZE -- The size (in octets) of the data. The |
| 2568 |
intent of this parameter is to help the recipient |
| 2569 |
decide whether or not to expend the necessary |
| 2570 |
resources to retrieve the external data. |
| 2571 |
|
| 2572 |
PERMISSION -- A field that indicates whether or |
| 2573 |
not it is expected that clients might also attempt |
| 2574 |
to overwrite the data. By default, or if |
| 2575 |
permission is "read", the assumption is that they |
| 2576 |
are not, and that if the data is retrieved once, |
| 2577 |
it is never needed again. If PERMISSION is "read- |
| 2578 |
write", this assumption is invalid, and any local |
| 2579 |
copy must be considered no more than a cache. |
| 2580 |
"Read" and "Read-write" are the only defined |
| 2581 |
values of permission. |
| 2582 |
|
| 2583 |
The precise semantics of the access-types defined here are |
| 2584 |
described in the sections that follow. |
| 2585 |
|
| 2586 |
7.3.3.1 The "ftp" and "tftp" access-types |
| 2587 |
|
| 2588 |
An access-type of FTP or TFTP indicates that the message |
| 2589 |
body is accessible as a file using the FTP [<a href="./rfc959" title="J.B.; Reynolds">RFC-959</a>] or TFTP |
| 2590 |
[<a href="./rfc783" title="MIT">RFC-783</a>] protocols, respectively. For these access-types, |
| 2591 |
the following additional parameters are mandatory: |
| 2592 |
|
| 2593 |
|
| 2594 |
|
| 2595 |
|
| 2596 |
|
| 2597 |
<span class="grey"> Borenstein & Freed [Page 41]</span></pre> |
| 2598 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-42" ></span> |
| 2599 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2600 |
|
| 2601 |
|
| 2602 |
NAME -- The name of the file that contains the |
| 2603 |
actual body data. |
| 2604 |
|
| 2605 |
SITE -- A machine from which the file may be |
| 2606 |
obtained, using the given protocol |
| 2607 |
|
| 2608 |
Before the data is retrieved, using these protocols, the |
| 2609 |
user will generally need to be asked to provide a login id |
| 2610 |
and a password for the machine named by the site parameter. |
| 2611 |
|
| 2612 |
In addition, the following optional parameters may also |
| 2613 |
appear when the access-type is FTP or ANON-FTP: |
| 2614 |
|
| 2615 |
DIRECTORY -- A directory from which the data named |
| 2616 |
by NAME should be retrieved. |
| 2617 |
|
| 2618 |
MODE -- A transfer mode for retrieving the |
| 2619 |
information, e.g. "image". |
| 2620 |
|
| 2621 |
7.3.3.2 The "anon-ftp" access-type |
| 2622 |
|
| 2623 |
The "anon-ftp" access-type is identical to the "ftp" access |
| 2624 |
type, except that the user need not be asked to provide a |
| 2625 |
name and password for the specified site. Instead, the ftp |
| 2626 |
protocol will be used with login "anonymous" and a password |
| 2627 |
that corresponds to the user's email address. |
| 2628 |
|
| 2629 |
7.3.3.3 The "local-file" and "afs" access-types |
| 2630 |
|
| 2631 |
An access-type of "local-file" indicates that the actual |
| 2632 |
body is accessible as a file on the local machine. An |
| 2633 |
access-type of "afs" indicates that the file is accessible |
| 2634 |
via the global AFS file system. In both cases, only a |
| 2635 |
single parameter is required: |
| 2636 |
|
| 2637 |
NAME -- The name of the file that contains the |
| 2638 |
actual body data. |
| 2639 |
|
| 2640 |
The following optional parameter may be used to describe the |
| 2641 |
locality of reference for the data, that is, the site or |
| 2642 |
sites at which the file is expected to be visible: |
| 2643 |
|
| 2644 |
SITE -- A domain specifier for a machine or set of |
| 2645 |
machines that are known to have access to the data |
| 2646 |
file. Asterisks may be used for wildcard matching |
| 2647 |
to a part of a domain name, such as |
| 2648 |
"*.bellcore.com", to indicate a set of machines on |
| 2649 |
which the data should be directly visible, while a |
| 2650 |
single asterisk may be used to indicate a file |
| 2651 |
that is expected to be universally available, |
| 2652 |
e.g., via a global file system. |
| 2653 |
|
| 2654 |
7.3.3.4 The "mail-server" access-type |
| 2655 |
|
| 2656 |
|
| 2657 |
|
| 2658 |
|
| 2659 |
<span class="grey"> Borenstein & Freed [Page 42]</span></pre> |
| 2660 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-43" ></span> |
| 2661 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2662 |
|
| 2663 |
|
| 2664 |
The "mail-server" access-type indicates that the actual body |
| 2665 |
is available from a mail server. The mandatory parameter |
| 2666 |
for this access-type is: |
| 2667 |
|
| 2668 |
SERVER -- The email address of the mail server |
| 2669 |
from which the actual body data can be obtained. |
| 2670 |
|
| 2671 |
Because mail servers accept a variety of syntax, some of |
| 2672 |
which is multiline, the full command to be sent to a mail |
| 2673 |
server is not included as a parameter on the content-type |
| 2674 |
line. Instead, it may be provided as the "phantom body" |
| 2675 |
when the content-type is message/external-body and the |
| 2676 |
access-type is mail-server. |
| 2677 |
|
| 2678 |
Note that MIME does not define a mail server syntax. |
| 2679 |
Rather, it allows the inclusion of arbitrary mail server |
| 2680 |
commands in the phantom body. Implementations should |
| 2681 |
include the phantom body in the body of the message it sends |
| 2682 |
to the mail server address to retrieve the relevant data. |
| 2683 |
|
| 2684 |
|
| 2685 |
|
| 2686 |
|
| 2687 |
|
| 2688 |
|
| 2689 |
|
| 2690 |
|
| 2691 |
|
| 2692 |
|
| 2693 |
|
| 2694 |
|
| 2695 |
|
| 2696 |
|
| 2697 |
|
| 2698 |
|
| 2699 |
|
| 2700 |
|
| 2701 |
|
| 2702 |
|
| 2703 |
|
| 2704 |
|
| 2705 |
|
| 2706 |
|
| 2707 |
|
| 2708 |
|
| 2709 |
|
| 2710 |
|
| 2711 |
|
| 2712 |
|
| 2713 |
|
| 2714 |
|
| 2715 |
|
| 2716 |
|
| 2717 |
|
| 2718 |
|
| 2719 |
|
| 2720 |
|
| 2721 |
<span class="grey"> Borenstein & Freed [Page 43]</span></pre> |
| 2722 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-44" ></span> |
| 2723 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2724 |
|
| 2725 |
|
| 2726 |
7.3.3.5 Examples and Further Explanations |
| 2727 |
|
| 2728 |
With the emerging possibility of very wide-area file |
| 2729 |
systems, it becomes very hard to know in advance the set of |
| 2730 |
machines where a file will and will not be accessible |
| 2731 |
directly from the file system. Therefore it may make sense |
| 2732 |
to provide both a file name, to be tried directly, and the |
| 2733 |
name of one or more sites from which the file is known to be |
| 2734 |
accessible. An implementation can try to retrieve remote |
| 2735 |
files using FTP or any other protocol, using anonymous file |
| 2736 |
retrieval or prompting the user for the necessary name and |
| 2737 |
password. If an external body is accessible via multiple |
| 2738 |
mechanisms, the sender may include multiple parts of type |
| 2739 |
message/external-body within an entity of type |
| 2740 |
multipart/alternative. |
| 2741 |
|
| 2742 |
However, the external-body mechanism is not intended to be |
| 2743 |
limited to file retrieval, as shown by the mail-server |
| 2744 |
access-type. Beyond this, one can imagine, for example, |
| 2745 |
using a video server for external references to video clips. |
| 2746 |
|
| 2747 |
If an entity is of type "message/external-body", then the |
| 2748 |
body of the entity will contain the header fields of the |
| 2749 |
encapsulated message. The body itself is to be found in the |
| 2750 |
external location. This means that if the body of the |
| 2751 |
"message/external-body" message contains two consecutive |
| 2752 |
CRLFs, everything after those pairs is NOT part of the |
| 2753 |
message itself. For most message/external-body messages, |
| 2754 |
this trailing area must simply be ignored. However, it is a |
| 2755 |
convenient place for additional data that cannot be included |
| 2756 |
in the content-type header field. In particular, if the |
| 2757 |
"access-type" value is "mail-server", then the trailing area |
| 2758 |
must contain commands to be sent to the mail server at the |
| 2759 |
address given by NAME@SITE, where NAME and SITE are the |
| 2760 |
values of the NAME and SITE parameters, respectively. |
| 2761 |
|
| 2762 |
The embedded message header fields which appear in the body |
| 2763 |
of the message/external-body data can be used to declare the |
| 2764 |
Content-type of the external body. Thus a complete |
| 2765 |
message/external-body message, referring to a document in |
| 2766 |
PostScript format, might look like this: |
| 2767 |
|
| 2768 |
From: Whomever |
| 2769 |
Subject: whatever |
| 2770 |
MIME-Version: 1.0 |
| 2771 |
Message-ID: [email protected] |
| 2772 |
Content-Type: multipart/alternative; boundary=42 |
| 2773 |
|
| 2774 |
|
| 2775 |
--42 |
| 2776 |
Content-Type: message/external-body; |
| 2777 |
name="BodyFormats.ps"; |
| 2778 |
|
| 2779 |
|
| 2780 |
|
| 2781 |
|
| 2782 |
|
| 2783 |
<span class="grey"> Borenstein & Freed [Page 44]</span></pre> |
| 2784 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-45" ></span> |
| 2785 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2786 |
|
| 2787 |
|
| 2788 |
site="thumper.bellcore.com"; |
| 2789 |
access-type=ANON-FTP; |
| 2790 |
directory="pub"; |
| 2791 |
mode="image"; |
| 2792 |
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" |
| 2793 |
|
| 2794 |
Content-type: application/postscript |
| 2795 |
|
| 2796 |
--42 |
| 2797 |
Content-Type: message/external-body; |
| 2798 |
name="/u/nsb/writing/rfcs/RFC-XXXX.ps"; |
| 2799 |
site="thumper.bellcore.com"; |
| 2800 |
access-type=AFS |
| 2801 |
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" |
| 2802 |
|
| 2803 |
Content-type: application/postscript |
| 2804 |
|
| 2805 |
--42 |
| 2806 |
Content-Type: message/external-body; |
| 2807 |
access-type=mail-server |
| 2808 |
server="[email protected]"; |
| 2809 |
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" |
| 2810 |
|
| 2811 |
Content-type: application/postscript |
| 2812 |
|
| 2813 |
get rfc-xxxx doc |
| 2814 |
|
| 2815 |
--42-- |
| 2816 |
|
| 2817 |
Like the message/partial type, the message/external-body |
| 2818 |
type is intended to be transparent, that is, to convey the |
| 2819 |
data type in the external body rather than to convey a |
| 2820 |
message with a body of that type. Thus the headers on the |
| 2821 |
outer and inner parts must be merged using the same rules as |
| 2822 |
for message/partial. In particular, this means that the |
| 2823 |
Content-type header is overridden, but the From and Subject |
| 2824 |
headers are preserved. |
| 2825 |
|
| 2826 |
Note that since the external bodies are not transported as |
| 2827 |
mail, they need not conform to the 7-bit and line length |
| 2828 |
requirements, but might in fact be binary files. Thus a |
| 2829 |
Content-Transfer-Encoding is not generally necessary, though |
| 2830 |
it is permitted. |
| 2831 |
|
| 2832 |
Note that the body of a message of type "message/external- |
| 2833 |
body" is governed by the basic syntax for an <a href="./rfc822">RFC 822</a> |
| 2834 |
message. In particular, anything before the first |
| 2835 |
consecutive pair of CRLFs is header information, while |
| 2836 |
anything after it is body information, which is ignored for |
| 2837 |
most access-types. |
| 2838 |
|
| 2839 |
|
| 2840 |
|
| 2841 |
|
| 2842 |
|
| 2843 |
|
| 2844 |
|
| 2845 |
<span class="grey"> Borenstein & Freed [Page 45]</span></pre> |
| 2846 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-46" ></span> |
| 2847 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2848 |
|
| 2849 |
|
| 2850 |
7.4 The Application Content-Type |
| 2851 |
|
| 2852 |
The "application" Content-Type is to be used for data which |
| 2853 |
do not fit in any of the other categories, and particularly |
| 2854 |
for data to be processed by mail-based uses of application |
| 2855 |
programs. This is information which must be processed by an |
| 2856 |
application before it is viewable or usable to a user. |
| 2857 |
Expected uses for Content-Type application include mail- |
| 2858 |
based file transfer, spreadsheets, data for mail-based |
| 2859 |
scheduling systems, and languages for "active" |
| 2860 |
(computational) email. (The latter, in particular, can pose |
| 2861 |
security problems which should be understood by |
| 2862 |
implementors, and are considered in detail in the discussion |
| 2863 |
of the application/PostScript content-type.) |
| 2864 |
|
| 2865 |
For example, a meeting scheduler might define a standard |
| 2866 |
representation for information about proposed meeting dates. |
| 2867 |
An intelligent user agent would use this information to |
| 2868 |
conduct a dialog with the user, and might then send further |
| 2869 |
mail based on that dialog. More generally, there have been |
| 2870 |
several "active" messaging languages developed in which |
| 2871 |
programs in a suitably specialized language are sent through |
| 2872 |
the mail and automatically run in the recipient's |
| 2873 |
environment. |
| 2874 |
|
| 2875 |
Such applications may be defined as subtypes of the |
| 2876 |
"application" Content-Type. This document defines three |
| 2877 |
subtypes: octet-stream, ODA, and PostScript. |
| 2878 |
|
| 2879 |
In general, the subtype of application will often be the |
| 2880 |
name of the application for which the data are intended. |
| 2881 |
This does not mean, however, that any application program |
| 2882 |
name may be used freely as a subtype of application. Such |
| 2883 |
usages must be registered with IANA, as described in |
| 2884 |
<a href="#appendix-F">Appendix F</a>. |
| 2885 |
|
| 2886 |
7.4.1 The Application/Octet-Stream (primary) subtype |
| 2887 |
|
| 2888 |
The primary subtype of application, "octet-stream", may be |
| 2889 |
used to indicate that a body contains binary data. The set |
| 2890 |
of possible parameters includes, but is not limited to: |
| 2891 |
|
| 2892 |
NAME -- a suggested name for the binary data if |
| 2893 |
stored as a file. |
| 2894 |
|
| 2895 |
TYPE -- the general type or category of binary |
| 2896 |
data. This is intended as information for the |
| 2897 |
human recipient rather than for any automatic |
| 2898 |
processing. |
| 2899 |
|
| 2900 |
CONVERSIONS -- the set of operations that have |
| 2901 |
been performed on the data before putting it in |
| 2902 |
the mail (and before any Content-Transfer-Encoding |
| 2903 |
that might have been applied). If multiple |
| 2904 |
|
| 2905 |
|
| 2906 |
|
| 2907 |
<span class="grey"> Borenstein & Freed [Page 46]</span></pre> |
| 2908 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-47" ></span> |
| 2909 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2910 |
|
| 2911 |
|
| 2912 |
conversions have occurred, they must be separated |
| 2913 |
by commas and specified in the order they were |
| 2914 |
applied -- that is, the leftmost conversion must |
| 2915 |
have occurred first, and conversions are undone |
| 2916 |
from right to left. Note that NO conversion |
| 2917 |
values are defined by this document. Any |
| 2918 |
conversion values that that do not begin with "X-" |
| 2919 |
must be preceded by a published specification and |
| 2920 |
by registration with IANA, as described in |
| 2921 |
<a href="#appendix-F">Appendix F</a>. |
| 2922 |
|
| 2923 |
PADDING -- the number of bits of padding that were |
| 2924 |
appended to the bitstream comprising the actual |
| 2925 |
contents to produce the enclosed byte-oriented |
| 2926 |
data. This is useful for enclosing a bitstream in |
| 2927 |
a body when the total number of bits is not a |
| 2928 |
multiple of the byte size. |
| 2929 |
|
| 2930 |
The values for these attributes are left undefined at |
| 2931 |
present, but may require specification in the future. An |
| 2932 |
example of a common (though UNIX-specific) usage might be: |
| 2933 |
|
| 2934 |
Content-Type: application/octet-stream; |
| 2935 |
name=foo.tar.Z; type=tar; |
| 2936 |
conversions="x-encrypt,x-compress" |
| 2937 |
|
| 2938 |
However, it should be noted that the use of such conversions |
| 2939 |
is explicitly discouraged due to a lack of portability and |
| 2940 |
standardization. The use of uuencode is particularly |
| 2941 |
discouraged, in favor of the Content-Transfer-Encoding |
| 2942 |
mechanism, which is both more standardized and more portable |
| 2943 |
across mail boundaries. |
| 2944 |
|
| 2945 |
The recommended action for an implementation that receives |
| 2946 |
application/octet-stream mail is to simply offer to put the |
| 2947 |
data in a file, with any Content-Transfer-Encoding undone, |
| 2948 |
or perhaps to use it as input to a user-specified process. |
| 2949 |
|
| 2950 |
To reduce the danger of transmitting rogue programs through |
| 2951 |
the mail, it is strongly recommended that implementations |
| 2952 |
NOT implement a path-search mechanism whereby an arbitrary |
| 2953 |
program named in the Content-Type parameter (e.g., an |
| 2954 |
"interpreter=" parameter) is found and executed using the |
| 2955 |
mail body as input. |
| 2956 |
|
| 2957 |
7.4.2 The Application/PostScript subtype |
| 2958 |
|
| 2959 |
A Content-Type of "application/postscript" indicates a |
| 2960 |
PostScript program. The language is defined in |
| 2961 |
[<a href="#ref-POSTSCRIPT" title="Inc.">POSTSCRIPT</a>]. It is recommended that Postscript as sent |
| 2962 |
through email should use Postscript document structuring |
| 2963 |
conventions if at all possible, and correctly. |
| 2964 |
|
| 2965 |
|
| 2966 |
|
| 2967 |
|
| 2968 |
|
| 2969 |
<span class="grey"> Borenstein & Freed [Page 47]</span></pre> |
| 2970 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-48" ></span> |
| 2971 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 2972 |
|
| 2973 |
|
| 2974 |
The execution of general-purpose PostScript interpreters |
| 2975 |
entails serious security risks, and implementors are |
| 2976 |
discouraged from simply sending PostScript email bodies to |
| 2977 |
"off-the-shelf" interpreters. While it is usually safe to |
| 2978 |
send PostScript to a printer, where the potential for harm |
| 2979 |
is greatly constrained, implementors should consider all of |
| 2980 |
the following before they add interactive display of |
| 2981 |
PostScript bodies to their mail readers. |
| 2982 |
|
| 2983 |
The remainder of this section outlines some, though probably |
| 2984 |
not all, of the possible problems with sending PostScript |
| 2985 |
through the mail. |
| 2986 |
|
| 2987 |
Dangerous operations in the PostScript language include, but |
| 2988 |
may not be limited to, the PostScript operators deletefile, |
| 2989 |
renamefile, filenameforall, and file. File is only |
| 2990 |
dangerous when applied to something other than standard |
| 2991 |
input or output. Implementations may also define additional |
| 2992 |
nonstandard file operators; these may also pose a threat to |
| 2993 |
security. Filenameforall, the wildcard file search |
| 2994 |
operator, may appear at first glance to be harmless. Note, |
| 2995 |
however, that this operator has the potential to reveal |
| 2996 |
information about what files the recipient has access to, |
| 2997 |
and this information may itself be sensitive. Message |
| 2998 |
senders should avoid the use of potentially dangerous file |
| 2999 |
operators, since these operators are quite likely to be |
| 3000 |
unavailable in secure PostScript implementations. Message- |
| 3001 |
receiving and -displaying software should either completely |
| 3002 |
disable all potentially dangerous file operators or take |
| 3003 |
special care not to delegate any special authority to their |
| 3004 |
operation. These operators should be viewed as being done by |
| 3005 |
an outside agency when interpreting PostScript documents. |
| 3006 |
Such disabling and/or checking should be done completely |
| 3007 |
outside of the reach of the PostScript language itself; care |
| 3008 |
should be taken to insure that no method exists for |
| 3009 |
reenabling full-function versions of these operators. |
| 3010 |
|
| 3011 |
The PostScript language provides facilities for exiting the |
| 3012 |
normal interpreter, or server, loop. Changes made in this |
| 3013 |
"outer" environment are customarily retained across |
| 3014 |
documents, and may in some cases be retained semipermanently |
| 3015 |
in nonvolatile memory. The operators associated with exiting |
| 3016 |
the interpreter loop have the potential to interfere with |
| 3017 |
subsequent document processing. As such, their unrestrained |
| 3018 |
use constitutes a threat of service denial. PostScript |
| 3019 |
operators that exit the interpreter loop include, but may |
| 3020 |
not be limited to, the exitserver and startjob operators. |
| 3021 |
Message-sending software should not generate PostScript that |
| 3022 |
depends on exiting the interpreter loop to operate. The |
| 3023 |
ability to exit will probably be unavailable in secure |
| 3024 |
PostScript implementations. Message-receiving and |
| 3025 |
-displaying software should, if possible, disable the |
| 3026 |
ability to make retained changes to the PostScript |
| 3027 |
environment. Eliminate the startjob and exitserver commands. |
| 3028 |
|
| 3029 |
|
| 3030 |
|
| 3031 |
<span class="grey"> Borenstein & Freed [Page 48]</span></pre> |
| 3032 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-49" ></span> |
| 3033 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3034 |
|
| 3035 |
|
| 3036 |
If these commands cannot be eliminated, at least set the |
| 3037 |
password associated with them to a hard-to-guess value. |
| 3038 |
|
| 3039 |
PostScript provides operators for setting system-wide and |
| 3040 |
device-specific parameters. These parameter settings may be |
| 3041 |
retained across jobs and may potentially pose a threat to |
| 3042 |
the correct operation of the interpreter. The PostScript |
| 3043 |
operators that set system and device parameters include, but |
| 3044 |
may not be limited to, the setsystemparams and setdevparams |
| 3045 |
operators. Message-sending software should not generate |
| 3046 |
PostScript that depends on the setting of system or device |
| 3047 |
parameters to operate correctly. The ability to set these |
| 3048 |
parameters will probably be unavailable in secure PostScript |
| 3049 |
implementations. Message-receiving and -displaying software |
| 3050 |
should, if possible, disable the ability to change system |
| 3051 |
and device parameters. If these operators cannot be |
| 3052 |
disabled, at least set the password associated with them to |
| 3053 |
a hard-to-guess value. |
| 3054 |
|
| 3055 |
Some PostScript implementations provide nonstandard |
| 3056 |
facilities for the direct loading and execution of machine |
| 3057 |
code. Such facilities are quite obviously open to |
| 3058 |
substantial abuse. Message-sending software should not |
| 3059 |
make use of such features. Besides being totally hardware- |
| 3060 |
specific, they are also likely to be unavailable in secure |
| 3061 |
implementations of PostScript. Message-receiving and |
| 3062 |
-displaying software should not allow such operators to be |
| 3063 |
used if they exist. |
| 3064 |
|
| 3065 |
PostScript is an extensible language, and many, if not most, |
| 3066 |
implementations of it provide a number of their own |
| 3067 |
extensions. This document does not deal with such extensions |
| 3068 |
explicitly since they constitute an unknown factor. |
| 3069 |
Message-sending software should not make use of nonstandard |
| 3070 |
extensions; they are likely to be missing from some |
| 3071 |
implementations. Message-receiving and -displaying software |
| 3072 |
should make sure that any nonstandard PostScript operators |
| 3073 |
are secure and don't present any kind of threat. |
| 3074 |
|
| 3075 |
It is possible to write PostScript that consumes huge |
| 3076 |
amounts of various system resources. It is also possible to |
| 3077 |
write PostScript programs that loop infinitely. Both types |
| 3078 |
of programs have the potential to cause damage if sent to |
| 3079 |
unsuspecting recipients. Message-sending software should |
| 3080 |
avoid the construction and dissemination of such programs, |
| 3081 |
which is antisocial. Message-receiving and -displaying |
| 3082 |
software should provide appropriate mechanisms to abort |
| 3083 |
processing of a document after a reasonable amount of time |
| 3084 |
has elapsed. In addition, PostScript interpreters should be |
| 3085 |
limited to the consumption of only a reasonable amount of |
| 3086 |
any given system resource. |
| 3087 |
|
| 3088 |
Finally, bugs may exist in some PostScript interpreters |
| 3089 |
which could possibly be exploited to gain unauthorized |
| 3090 |
|
| 3091 |
|
| 3092 |
|
| 3093 |
<span class="grey"> Borenstein & Freed [Page 49]</span></pre> |
| 3094 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-50" ></span> |
| 3095 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3096 |
|
| 3097 |
|
| 3098 |
access to a recipient's system. Apart from noting this |
| 3099 |
possibility, there is no specific action to take to prevent |
| 3100 |
this, apart from the timely correction of such bugs if any |
| 3101 |
are found. |
| 3102 |
|
| 3103 |
7.4.3 The Application/ODA subtype |
| 3104 |
|
| 3105 |
The "ODA" subtype of application is used to indicate that a |
| 3106 |
body contains information encoded according to the Office |
| 3107 |
Document Architecture [<a href="#ref-ODA" title="Part 1-8">ODA</a>] standards, using the ODIF |
| 3108 |
representation format. For application/oda, the Content- |
| 3109 |
Type line should also specify an attribute/value pair that |
| 3110 |
indicates the document application profile (DAP), using the |
| 3111 |
key word "profile". Thus an appropriate header field might |
| 3112 |
look like this: |
| 3113 |
|
| 3114 |
Content-Type: application/oda; profile=Q112 |
| 3115 |
|
| 3116 |
Consult the ODA standard [<a href="#ref-ODA" title="Part 1-8">ODA</a>] for further information. |
| 3117 |
|
| 3118 |
|
| 3119 |
|
| 3120 |
|
| 3121 |
|
| 3122 |
|
| 3123 |
|
| 3124 |
|
| 3125 |
|
| 3126 |
|
| 3127 |
|
| 3128 |
|
| 3129 |
|
| 3130 |
|
| 3131 |
|
| 3132 |
|
| 3133 |
|
| 3134 |
|
| 3135 |
|
| 3136 |
|
| 3137 |
|
| 3138 |
|
| 3139 |
|
| 3140 |
|
| 3141 |
|
| 3142 |
|
| 3143 |
|
| 3144 |
|
| 3145 |
|
| 3146 |
|
| 3147 |
|
| 3148 |
|
| 3149 |
|
| 3150 |
|
| 3151 |
|
| 3152 |
|
| 3153 |
|
| 3154 |
|
| 3155 |
<span class="grey"> Borenstein & Freed [Page 50]</span></pre> |
| 3156 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-51" ></span> |
| 3157 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3158 |
|
| 3159 |
|
| 3160 |
7.5 The Image Content-Type |
| 3161 |
|
| 3162 |
A Content-Type of "image" indicates that the bodycontains an |
| 3163 |
image. The subtype names the specific image format. These |
| 3164 |
names are case insensitive. Two initial subtypes are "jpeg" |
| 3165 |
for the JPEG format, JFIF encoding, and "gif" for GIF format |
| 3166 |
[<a href="#ref-GIF" title="Ohio">GIF</a>]. |
| 3167 |
|
| 3168 |
The list of image subtypes given here is neither exclusive |
| 3169 |
nor exhaustive, and is expected to grow as more types are |
| 3170 |
registered with IANA, as described in <a href="#appendix-F">Appendix F</a>. |
| 3171 |
|
| 3172 |
7.6 The Audio Content-Type |
| 3173 |
|
| 3174 |
A Content-Type of "audio" indicates that the body contains |
| 3175 |
audio data. Although there is not yet a consensus on an |
| 3176 |
"ideal" audio format for use with computers, there is a |
| 3177 |
pressing need for a format capable of providing |
| 3178 |
interoperable behavior. |
| 3179 |
|
| 3180 |
The initial subtype of "basic" is specified to meet this |
| 3181 |
requirement by providing an absolutely minimal lowest common |
| 3182 |
denominator audio format. It is expected that richer |
| 3183 |
formats for higher quality and/or lower bandwidth audio will |
| 3184 |
be defined by a later document. |
| 3185 |
|
| 3186 |
The content of the "audio/basic" subtype is audio encoded |
| 3187 |
using 8-bit ISDN u-law [<a href="#ref-PCM" title=""Pulse Code Modulation (PCM) of Voice Frequencies"">PCM</a>]. When this subtype is present, |
| 3188 |
a sample rate of 8000 Hz and a single channel is assumed. |
| 3189 |
|
| 3190 |
7.7 The Video Content-Type |
| 3191 |
|
| 3192 |
A Content-Type of "video" indicates that the body contains a |
| 3193 |
time-varying-picture image, possibly with color and |
| 3194 |
coordinated sound. The term "video" is used extremely |
| 3195 |
generically, rather than with reference to any particular |
| 3196 |
technology or format, and is not meant to preclude subtypes |
| 3197 |
such as animated drawings encoded compactly. The subtype |
| 3198 |
"mpeg" refers to video coded according to the MPEG standard |
| 3199 |
[<a href="#ref-MPEG" title="May">MPEG</a>]. |
| 3200 |
|
| 3201 |
Note that although in general this document strongly |
| 3202 |
discourages the mixing of multiple media in a single body, |
| 3203 |
it is recognized that many so-called "video" formats include |
| 3204 |
a representation for synchronized audio, and this is |
| 3205 |
explicitly permitted for subtypes of "video". |
| 3206 |
|
| 3207 |
7.8 Experimental Content-Type Values |
| 3208 |
|
| 3209 |
A Content-Type value beginning with the characters "X-" is a |
| 3210 |
private value, to be used by consenting mail systems by |
| 3211 |
mutual agreement. Any format without a rigorous and public |
| 3212 |
definition must be named with an "X-" prefix, and publicly |
| 3213 |
specified values shall never begin with "X-". (Older |
| 3214 |
|
| 3215 |
|
| 3216 |
|
| 3217 |
<span class="grey"> Borenstein & Freed [Page 51]</span></pre> |
| 3218 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-52" ></span> |
| 3219 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3220 |
|
| 3221 |
|
| 3222 |
versions of the widely-used Andrew system use the "X-BE2" |
| 3223 |
name, so new systems should probably choose a different |
| 3224 |
name.) |
| 3225 |
|
| 3226 |
In general, the use of "X-" top-level types is strongly |
| 3227 |
discouraged. Implementors should invent subtypes of the |
| 3228 |
existing types whenever possible. The invention of new |
| 3229 |
types is intended to be restricted primarily to the |
| 3230 |
development of new media types for email, such as digital |
| 3231 |
odors or holography, and not for new data formats in |
| 3232 |
general. In many cases, a subtype of application will be |
| 3233 |
more appropriate than a new top-level type. |
| 3234 |
|
| 3235 |
|
| 3236 |
|
| 3237 |
|
| 3238 |
|
| 3239 |
|
| 3240 |
|
| 3241 |
|
| 3242 |
|
| 3243 |
|
| 3244 |
|
| 3245 |
|
| 3246 |
|
| 3247 |
|
| 3248 |
|
| 3249 |
|
| 3250 |
|
| 3251 |
|
| 3252 |
|
| 3253 |
|
| 3254 |
|
| 3255 |
|
| 3256 |
|
| 3257 |
|
| 3258 |
|
| 3259 |
|
| 3260 |
|
| 3261 |
|
| 3262 |
|
| 3263 |
|
| 3264 |
|
| 3265 |
|
| 3266 |
|
| 3267 |
|
| 3268 |
|
| 3269 |
|
| 3270 |
|
| 3271 |
|
| 3272 |
|
| 3273 |
|
| 3274 |
|
| 3275 |
|
| 3276 |
|
| 3277 |
|
| 3278 |
|
| 3279 |
<span class="grey"> Borenstein & Freed [Page 52]</span></pre> |
| 3280 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-53" ></span> |
| 3281 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3282 |
|
| 3283 |
|
| 3284 |
Summary |
| 3285 |
|
| 3286 |
Using the MIME-Version, Content-Type, and Content-Transfer- |
| 3287 |
Encoding header fields, it is possible to include, in a |
| 3288 |
standardized way, arbitrary types of data objects with <a href="./rfc822">RFC</a> |
| 3289 |
<a href="./rfc822">822</a> conformant mail messages. No restrictions imposed by |
| 3290 |
either <a href="./rfc821">RFC 821</a> or <a href="./rfc822">RFC 822</a> are violated, and care has been |
| 3291 |
taken to avoid problems caused by additional restrictions |
| 3292 |
imposed by the characteristics of some Internet mail |
| 3293 |
transport mechanisms (see <a href="#appendix-B">Appendix B</a>). The "multipart" and |
| 3294 |
"message" Content-Types allow mixing and hierarchical |
| 3295 |
structuring of objects of different types in a single |
| 3296 |
message. Further Content-Types provide a standardized |
| 3297 |
mechanism for tagging messages or body parts as audio, |
| 3298 |
image, or several other kinds of data. A distinguished |
| 3299 |
parameter syntax allows further specification of data format |
| 3300 |
details, particularly the specification of alternate |
| 3301 |
character sets. Additional optional header fields provide |
| 3302 |
mechanisms for certain extensions deemed desirable by many |
| 3303 |
implementors. Finally, a number of useful Content-Types are |
| 3304 |
defined for general use by consenting user agents, notably |
| 3305 |
text/richtext, message/partial, and message/external-body. |
| 3306 |
|
| 3307 |
|
| 3308 |
|
| 3309 |
|
| 3310 |
|
| 3311 |
|
| 3312 |
|
| 3313 |
|
| 3314 |
|
| 3315 |
|
| 3316 |
|
| 3317 |
|
| 3318 |
|
| 3319 |
|
| 3320 |
|
| 3321 |
|
| 3322 |
|
| 3323 |
|
| 3324 |
|
| 3325 |
|
| 3326 |
|
| 3327 |
|
| 3328 |
|
| 3329 |
|
| 3330 |
|
| 3331 |
|
| 3332 |
|
| 3333 |
|
| 3334 |
|
| 3335 |
|
| 3336 |
|
| 3337 |
|
| 3338 |
|
| 3339 |
|
| 3340 |
|
| 3341 |
<span class="grey"> Borenstein & Freed [Page 53]</span></pre> |
| 3342 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-54" ></span> |
| 3343 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3344 |
|
| 3345 |
|
| 3346 |
Acknowledgements |
| 3347 |
|
| 3348 |
This document is the result of the collective effort of a |
| 3349 |
large number of people, at several IETF meetings, on the |
| 3350 |
IETF-SMTP and IETF-822 mailing lists, and elsewhere. |
| 3351 |
Although any enumeration seems doomed to suffer from |
| 3352 |
egregious omissions, the following are among the many |
| 3353 |
contributors to this effort: |
| 3354 |
|
| 3355 |
Harald Tveit Alvestrand Timo Lehtinen |
| 3356 |
Randall Atkinson John R. MacMillan |
| 3357 |
Philippe Brandon Rick McGowan |
| 3358 |
Kevin Carosso Leo Mclaughlin |
| 3359 |
Uhhyung Choi Goli Montaser-Kohsari |
| 3360 |
Cristian Constantinof Keith Moore |
| 3361 |
Mark Crispin Tom Moore |
| 3362 |
Dave Crocker Erik Naggum |
| 3363 |
Terry Crowley Mark Needleman |
| 3364 |
Walt Daniels John Noerenberg |
| 3365 |
Frank Dawson Mats Ohrman |
| 3366 |
Hitoshi Doi Julian Onions |
| 3367 |
Kevin Donnelly Michael Patton |
| 3368 |
Keith Edwards David J. Pepper |
| 3369 |
Chris Eich Blake C. Ramsdell |
| 3370 |
Johnny Eriksson Luc Rooijakkers |
| 3371 |
Craig Everhart Marshall T. Rose |
| 3372 |
Patrik Faeltstroem Jonathan Rosenberg |
| 3373 |
Erik E. Fair Jan Rynning |
| 3374 |
Roger Fajman Harri Salminen |
| 3375 |
Alain Fontaine Michael Sanderson |
| 3376 |
James M. Galvin Masahiro Sekiguchi |
| 3377 |
Philip Gladstone Mark Sherman |
| 3378 |
Thomas Gordon Keld Simonsen |
| 3379 |
Phill Gross Bob Smart |
| 3380 |
James Hamilton Peter Speck |
| 3381 |
Steve Hardcastle-Kille Henry Spencer |
| 3382 |
David Herron Einar Stefferud |
| 3383 |
Bruce Howard Michael Stein |
| 3384 |
Bill Janssen Klaus Steinberger |
| 3385 |
Olle Jaernefors Peter Svanberg |
| 3386 |
Risto Kankkunen James Thompson |
| 3387 |
Phil Karn Steve Uhler |
| 3388 |
Alan Katz Stuart Vance |
| 3389 |
Tim Kehres Erik van der Poel |
| 3390 |
Neil Katin Guido van Rossum |
| 3391 |
Kyuho Kim Peter Vanderbilt |
| 3392 |
Anders Klemets Greg Vaudreuil |
| 3393 |
John Klensin Ed Vielmetti |
| 3394 |
Valdis Kletniek Ryan Waldron |
| 3395 |
Jim Knowles Wally Wedel |
| 3396 |
Stev Knowles Sven-Ove Westberg |
| 3397 |
Bob Kummerfeld Brian Wideen |
| 3398 |
|
| 3399 |
|
| 3400 |
|
| 3401 |
|
| 3402 |
|
| 3403 |
<span class="grey"> Borenstein & Freed [Page 54]</span></pre> |
| 3404 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-55" ></span> |
| 3405 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3406 |
|
| 3407 |
|
| 3408 |
Pekka Kytolaakso John Wobus |
| 3409 |
Stellan Lagerstr.m Glenn Wright |
| 3410 |
Vincent Lau Rayan Zachariassen |
| 3411 |
Donald Lindsay David Zimmerman |
| 3412 |
The authors apologize for any omissions from this list, |
| 3413 |
which are certainly unintentional. |
| 3414 |
|
| 3415 |
|
| 3416 |
|
| 3417 |
|
| 3418 |
|
| 3419 |
|
| 3420 |
|
| 3421 |
|
| 3422 |
|
| 3423 |
|
| 3424 |
|
| 3425 |
|
| 3426 |
|
| 3427 |
|
| 3428 |
|
| 3429 |
|
| 3430 |
|
| 3431 |
|
| 3432 |
|
| 3433 |
|
| 3434 |
|
| 3435 |
|
| 3436 |
|
| 3437 |
|
| 3438 |
|
| 3439 |
|
| 3440 |
|
| 3441 |
|
| 3442 |
|
| 3443 |
|
| 3444 |
|
| 3445 |
|
| 3446 |
|
| 3447 |
|
| 3448 |
|
| 3449 |
|
| 3450 |
|
| 3451 |
|
| 3452 |
|
| 3453 |
|
| 3454 |
|
| 3455 |
|
| 3456 |
|
| 3457 |
|
| 3458 |
|
| 3459 |
|
| 3460 |
|
| 3461 |
|
| 3462 |
|
| 3463 |
|
| 3464 |
|
| 3465 |
<span class="grey"> Borenstein & Freed [Page 55]</span></pre> |
| 3466 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-56" ></span> |
| 3467 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3468 |
|
| 3469 |
|
| 3470 |
<a href="#appendix-A">Appendix A</a> -- Minimal MIME-Conformance |
| 3471 |
|
| 3472 |
The mechanisms described in this document are open-ended. |
| 3473 |
It is definitely not expected that all implementations will |
| 3474 |
support all of the Content-Types described, nor that they |
| 3475 |
will all share the same extensions. In order to promote |
| 3476 |
interoperability, however, it is useful to define the |
| 3477 |
concept of "MIME-conformance" to define a certain level of |
| 3478 |
implementation that allows the useful interworking of |
| 3479 |
messages with content that differs from US ASCII text. In |
| 3480 |
this section, we specify the requirements for such |
| 3481 |
conformance. |
| 3482 |
|
| 3483 |
A mail user agent that is MIME-conformant MUST: |
| 3484 |
|
| 3485 |
1. Always generate a "MIME-Version: 1.0" header |
| 3486 |
field. |
| 3487 |
|
| 3488 |
2. Recognize the Content-Transfer-Encoding header |
| 3489 |
field, and decode all received data encoded with |
| 3490 |
either the quoted-printable or base64 |
| 3491 |
implementations. Encode any data sent that is |
| 3492 |
not in seven-bit mail-ready representation using |
| 3493 |
one of these transformations and include the |
| 3494 |
appropriate Content-Transfer-Encoding header |
| 3495 |
field, unless the underlying transport mechanism |
| 3496 |
supports non-seven-bit data, as SMTP does not. |
| 3497 |
|
| 3498 |
3. Recognize and interpret the Content-Type |
| 3499 |
header field, and avoid showing users raw data |
| 3500 |
with a Content-Type field other than text. Be |
| 3501 |
able to send at least text/plain messages, with |
| 3502 |
the character set specified as a parameter if it |
| 3503 |
is not US-ASCII. |
| 3504 |
|
| 3505 |
4. Explicitly handle the following Content-Type |
| 3506 |
values, to at least the following extents: |
| 3507 |
|
| 3508 |
Text: |
| 3509 |
-- Recognize and display "text" mail |
| 3510 |
with the character set "US-ASCII." |
| 3511 |
-- Recognize other character sets at |
| 3512 |
least to the extent of being able |
| 3513 |
to inform the user about what |
| 3514 |
character set the message uses. |
| 3515 |
-- Recognize the "ISO-8859-*" character |
| 3516 |
sets to the extent of being able to |
| 3517 |
display those characters that are |
| 3518 |
common to ISO-8859-* and US-ASCII, |
| 3519 |
namely all characters represented |
| 3520 |
by octet values 0-127. |
| 3521 |
-- For unrecognized subtypes, show or |
| 3522 |
offer to show the user the "raw" |
| 3523 |
version of the data. An ability at |
| 3524 |
|
| 3525 |
|
| 3526 |
|
| 3527 |
<span class="grey"> Borenstein & Freed [Page 56]</span></pre> |
| 3528 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-57" ></span> |
| 3529 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3530 |
|
| 3531 |
|
| 3532 |
least to convert "text/richtext" to |
| 3533 |
plain text, as shown in <a href="#appendix-D">Appendix D</a>, |
| 3534 |
is encouraged, but not required for |
| 3535 |
conformance. |
| 3536 |
Message: |
| 3537 |
--Recognize and display at least the |
| 3538 |
primary (822) encapsulation. |
| 3539 |
Multipart: |
| 3540 |
-- Recognize the primary (mixed) |
| 3541 |
subtype. Display all relevant |
| 3542 |
information on the message level |
| 3543 |
and the body part header level and |
| 3544 |
then display or offer to display |
| 3545 |
each of the body parts |
| 3546 |
individually. |
| 3547 |
-- Recognize the "alternative" subtype, |
| 3548 |
and avoid showing the user |
| 3549 |
redundant parts of |
| 3550 |
multipart/alternative mail. |
| 3551 |
-- Treat any unrecognized subtypes as if |
| 3552 |
they were "mixed". |
| 3553 |
Application: |
| 3554 |
-- Offer the ability to remove either of |
| 3555 |
the two types of Content-Transfer- |
| 3556 |
Encoding defined in this document |
| 3557 |
and put the resulting information |
| 3558 |
in a user file. |
| 3559 |
|
| 3560 |
5. Upon encountering any unrecognized Content- |
| 3561 |
Type, an implementation must treat it as if it had |
| 3562 |
a Content-Type of "application/octet-stream" with |
| 3563 |
no parameter sub-arguments. How such data are |
| 3564 |
handled is up to an implementation, but likely |
| 3565 |
options for handling such unrecognized data |
| 3566 |
include offering the user to write it into a file |
| 3567 |
(decoded from its mail transport format) or |
| 3568 |
offering the user to name a program to which the |
| 3569 |
decoded data should be passed as input. |
| 3570 |
Unrecognized predefined types, which in a MIME- |
| 3571 |
conformant mailer might still include audio, |
| 3572 |
image, or video, should also be treated in this |
| 3573 |
way. |
| 3574 |
|
| 3575 |
A user agent that meets the above conditions is said to be |
| 3576 |
MIME-conformant. The meaning of this phrase is that it is |
| 3577 |
assumed to be "safe" to send virtually any kind of |
| 3578 |
properly-marked data to users of such mail systems, because |
| 3579 |
such systems will at least be able to treat the data as |
| 3580 |
undifferentiated binary, and will not simply splash it onto |
| 3581 |
the screen of unsuspecting users. There is another sense |
| 3582 |
in which it is always "safe" to send data in a format that |
| 3583 |
is MIME-conformant, which is that such data will not break |
| 3584 |
or be broken by any known systems that are conformant with |
| 3585 |
<a href="./rfc821">RFC 821</a> and <a href="./rfc822">RFC 822</a>. User agents that are MIME-conformant |
| 3586 |
|
| 3587 |
|
| 3588 |
|
| 3589 |
<span class="grey"> Borenstein & Freed [Page 57]</span></pre> |
| 3590 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-58" ></span> |
| 3591 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3592 |
|
| 3593 |
|
| 3594 |
have the additional guarantee that the user will not be |
| 3595 |
shown data that were never intended to be viewed as text. |
| 3596 |
|
| 3597 |
|
| 3598 |
|
| 3599 |
|
| 3600 |
|
| 3601 |
|
| 3602 |
|
| 3603 |
|
| 3604 |
|
| 3605 |
|
| 3606 |
|
| 3607 |
|
| 3608 |
|
| 3609 |
|
| 3610 |
|
| 3611 |
|
| 3612 |
|
| 3613 |
|
| 3614 |
|
| 3615 |
|
| 3616 |
|
| 3617 |
|
| 3618 |
|
| 3619 |
|
| 3620 |
|
| 3621 |
|
| 3622 |
|
| 3623 |
|
| 3624 |
|
| 3625 |
|
| 3626 |
|
| 3627 |
|
| 3628 |
|
| 3629 |
|
| 3630 |
|
| 3631 |
|
| 3632 |
|
| 3633 |
|
| 3634 |
|
| 3635 |
|
| 3636 |
|
| 3637 |
|
| 3638 |
|
| 3639 |
|
| 3640 |
|
| 3641 |
|
| 3642 |
|
| 3643 |
|
| 3644 |
|
| 3645 |
|
| 3646 |
|
| 3647 |
|
| 3648 |
|
| 3649 |
|
| 3650 |
|
| 3651 |
<span class="grey"> Borenstein & Freed [Page 58]</span></pre> |
| 3652 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-59" ></span> |
| 3653 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3654 |
|
| 3655 |
|
| 3656 |
<a href="#appendix-B">Appendix B</a> -- General Guidelines For Sending Email Data |
| 3657 |
|
| 3658 |
Internet email is not a perfect, homogeneous system. Mail |
| 3659 |
may become corrupted at several stages in its travel to a |
| 3660 |
final destination. Specifically, email sent throughout the |
| 3661 |
Internet may travel across many networking technologies. |
| 3662 |
Many networking and mail technologies do not support the |
| 3663 |
full functionality possible in the SMTP transport |
| 3664 |
environment. Mail traversing these systems is likely to be |
| 3665 |
modified in such a way that it can be transported. |
| 3666 |
|
| 3667 |
There exist many widely-deployed non-conformant MTAs in the |
| 3668 |
Internet. These MTAs, speaking the SMTP protocol, alter |
| 3669 |
messages on the fly to take advantage of the internal data |
| 3670 |
structure of the hosts they are implemented on, or are just |
| 3671 |
plain broken. |
| 3672 |
|
| 3673 |
The following guidelines may be useful to anyone devising a |
| 3674 |
data format (Content-Type) that will survive the widest |
| 3675 |
range of networking technologies and known broken MTAs |
| 3676 |
unscathed. Note that anything encoded in the base64 |
| 3677 |
encoding will satisfy these rules, but that some well-known |
| 3678 |
mechanisms, notably the UNIX uuencode facility, will not. |
| 3679 |
Note also that anything encoded in the Quoted-Printable |
| 3680 |
encoding will survive most gateways intact, but possibly not |
| 3681 |
some gateways to systems that use the EBCDIC character set. |
| 3682 |
|
| 3683 |
(1) Under some circumstances the encoding used for |
| 3684 |
data may change as part of normal gateway or user |
| 3685 |
agent operation. In particular, conversion from |
| 3686 |
base64 to quoted-printable and vice versa may be |
| 3687 |
necessary. This may result in the confusion of |
| 3688 |
CRLF sequences with line breaks in text body |
| 3689 |
parts. As such, the persistence of CRLF as |
| 3690 |
something other than a line break should not be |
| 3691 |
relied on. |
| 3692 |
|
| 3693 |
(2) Many systems may elect to represent and store |
| 3694 |
text data using local newline conventions. Local |
| 3695 |
newline conventions may not match the <a href="./rfc822">RFC822</a> CRLF |
| 3696 |
convention -- systems are known that use plain CR, |
| 3697 |
plain LF, CRLF, or counted records. The result is |
| 3698 |
that isolated CR and LF characters are not well |
| 3699 |
tolerated in general; they may be lost or |
| 3700 |
converted to delimiters on some systems, and hence |
| 3701 |
should not be relied on. |
| 3702 |
|
| 3703 |
(3) TAB (HT) characters may be misinterpreted or |
| 3704 |
may be automatically converted to variable numbers |
| 3705 |
of spaces. This is unavoidable in some |
| 3706 |
environments, notably those not based on the ASCII |
| 3707 |
character set. Such conversion is STRONGLY |
| 3708 |
DISCOURAGED, but it may occur, and mail formats |
| 3709 |
should not rely on the persistence of TAB (HT) |
| 3710 |
|
| 3711 |
|
| 3712 |
|
| 3713 |
<span class="grey"> Borenstein & Freed [Page 59]</span></pre> |
| 3714 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-60" ></span> |
| 3715 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3716 |
|
| 3717 |
|
| 3718 |
characters. |
| 3719 |
|
| 3720 |
(4) Lines longer than 76 characters may be wrapped |
| 3721 |
or truncated in some environments. Line wrapping |
| 3722 |
and line truncation are STRONGLY DISCOURAGED, but |
| 3723 |
unavoidable in some cases. Applications which |
| 3724 |
require long lines should somehow differentiate |
| 3725 |
between soft and hard line breaks. (A simple way |
| 3726 |
to do this is to use the quoted-printable |
| 3727 |
encoding.) |
| 3728 |
|
| 3729 |
(5) Trailing "white space" characters (SPACE, TAB |
| 3730 |
(HT)) on a line may be discarded by some transport |
| 3731 |
agents, while other transport agents may pad lines |
| 3732 |
with these characters so that all lines in a mail |
| 3733 |
file are of equal length. The persistence of |
| 3734 |
trailing white space, therefore, should not be |
| 3735 |
relied on. |
| 3736 |
|
| 3737 |
(6) Many mail domains use variations on the ASCII |
| 3738 |
character set, or use character sets such as |
| 3739 |
EBCDIC which contain most but not all of the US- |
| 3740 |
ASCII characters. The correct translation of |
| 3741 |
characters not in the "invariant" set cannot be |
| 3742 |
depended on across character converting gateways. |
| 3743 |
For example, this situation is a problem when |
| 3744 |
sending uuencoded information across BITNET, an |
| 3745 |
EBCDIC system. Similar problems can occur without |
| 3746 |
crossing a gateway, since many Internet hosts use |
| 3747 |
character sets other than ASCII internally. The |
| 3748 |
definition of Printable Strings in X.400 adds |
| 3749 |
further restrictions in certain special cases. In |
| 3750 |
particular, the only characters that are known to |
| 3751 |
be consistent across all gateways are the 73 |
| 3752 |
characters that correspond to the upper and lower |
| 3753 |
case letters A-Z and a-z, the 10 digits 0-9, and |
| 3754 |
the following eleven special characters: |
| 3755 |
|
| 3756 |
"'" (ASCII code 39) |
| 3757 |
"(" (ASCII code 40) |
| 3758 |
")" (ASCII code 41) |
| 3759 |
"+" (ASCII code 43) |
| 3760 |
"," (ASCII code 44) |
| 3761 |
"-" (ASCII code 45) |
| 3762 |
"." (ASCII code 46) |
| 3763 |
"/" (ASCII code 47) |
| 3764 |
":" (ASCII code 58) |
| 3765 |
"=" (ASCII code 61) |
| 3766 |
"?" (ASCII code 63) |
| 3767 |
|
| 3768 |
A maximally portable mail representation, such as |
| 3769 |
the base64 encoding, will confine itself to |
| 3770 |
relatively short lines of text in which the only |
| 3771 |
meaningful characters are taken from this set of |
| 3772 |
|
| 3773 |
|
| 3774 |
|
| 3775 |
<span class="grey"> Borenstein & Freed [Page 60]</span></pre> |
| 3776 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-61" ></span> |
| 3777 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3778 |
|
| 3779 |
|
| 3780 |
73 characters. |
| 3781 |
|
| 3782 |
Please note that the above list is NOT a list of recommended |
| 3783 |
practices for MTAs. RFC 821 MTAs are prohibited from |
| 3784 |
altering the character of white space or wrapping long |
| 3785 |
lines. These BAD and illegal practices are known to occur |
| 3786 |
on established networks, and implementions should be robust |
| 3787 |
in dealing with the bad effects they can cause. |
| 3788 |
|
| 3789 |
|
| 3790 |
|
| 3791 |
|
| 3792 |
|
| 3793 |
|
| 3794 |
|
| 3795 |
|
| 3796 |
|
| 3797 |
|
| 3798 |
|
| 3799 |
|
| 3800 |
|
| 3801 |
|
| 3802 |
|
| 3803 |
|
| 3804 |
|
| 3805 |
|
| 3806 |
|
| 3807 |
|
| 3808 |
|
| 3809 |
|
| 3810 |
|
| 3811 |
|
| 3812 |
|
| 3813 |
|
| 3814 |
|
| 3815 |
|
| 3816 |
|
| 3817 |
|
| 3818 |
|
| 3819 |
|
| 3820 |
|
| 3821 |
|
| 3822 |
|
| 3823 |
|
| 3824 |
|
| 3825 |
|
| 3826 |
|
| 3827 |
|
| 3828 |
|
| 3829 |
|
| 3830 |
|
| 3831 |
|
| 3832 |
|
| 3833 |
|
| 3834 |
|
| 3835 |
|
| 3836 |
|
| 3837 |
<span class="grey"> Borenstein & Freed [Page 61]</span></pre> |
| 3838 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-62" ></span> |
| 3839 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3840 |
|
| 3841 |
|
| 3842 |
<a href="#appendix-C">Appendix C</a> -- A Complex Multipart Example |
| 3843 |
|
| 3844 |
What follows is the outline of a complex multipart message. |
| 3845 |
This message has five parts to be displayed serially: two |
| 3846 |
introductory plain text parts, an embedded multipart |
| 3847 |
message, a richtext part, and a closing encapsulated text |
| 3848 |
message in a non-ASCII character set. The embedded |
| 3849 |
multipart message has two parts to be displayed in parallel, |
| 3850 |
a picture and an audio fragment. |
| 3851 |
|
| 3852 |
MIME-Version: 1.0 |
| 3853 |
From: Nathaniel Borenstein <[email protected]> |
| 3854 |
Subject: A multipart example |
| 3855 |
Content-Type: multipart/mixed; |
| 3856 |
boundary=unique-boundary-1 |
| 3857 |
|
| 3858 |
This is the preamble area of a multipart message. |
| 3859 |
Mail readers that understand multipart format |
| 3860 |
should ignore this preamble. |
| 3861 |
If you are reading this text, you might want to |
| 3862 |
consider changing to a mail reader that understands |
| 3863 |
how to properly display multipart messages. |
| 3864 |
--unique-boundary-1 |
| 3865 |
|
| 3866 |
...Some text appears here... |
| 3867 |
[Note that the preceding blank line means |
| 3868 |
no header fields were given and this is text, |
| 3869 |
with charset US ASCII. It could have been |
| 3870 |
done with explicit typing as in the next part.] |
| 3871 |
|
| 3872 |
--unique-boundary-1 |
| 3873 |
Content-type: text/plain; charset=US-ASCII |
| 3874 |
|
| 3875 |
This could have been part of the previous part, |
| 3876 |
but illustrates explicit versus implicit |
| 3877 |
typing of body parts. |
| 3878 |
|
| 3879 |
--unique-boundary-1 |
| 3880 |
Content-Type: multipart/parallel; |
| 3881 |
boundary=unique-boundary-2 |
| 3882 |
|
| 3883 |
|
| 3884 |
--unique-boundary-2 |
| 3885 |
Content-Type: audio/basic |
| 3886 |
Content-Transfer-Encoding: base64 |
| 3887 |
|
| 3888 |
... base64-encoded 8000 Hz single-channel |
| 3889 |
u-law-format audio data goes here.... |
| 3890 |
|
| 3891 |
--unique-boundary-2 |
| 3892 |
Content-Type: image/gif |
| 3893 |
Content-Transfer-Encoding: Base64 |
| 3894 |
|
| 3895 |
|
| 3896 |
|
| 3897 |
|
| 3898 |
|
| 3899 |
<span class="grey"> Borenstein & Freed [Page 62]</span></pre> |
| 3900 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-63" ></span> |
| 3901 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3902 |
|
| 3903 |
|
| 3904 |
... base64-encoded image data goes here.... |
| 3905 |
|
| 3906 |
--unique-boundary-2-- |
| 3907 |
|
| 3908 |
--unique-boundary-1 |
| 3909 |
Content-type: text/richtext |
| 3910 |
|
| 3911 |
This is <bold><italic>richtext.</italic></bold> |
| 3912 |
<nl><nl>Isn't it |
| 3913 |
<bigger><bigger>cool?</bigger></bigger> |
| 3914 |
|
| 3915 |
--unique-boundary-1 |
| 3916 |
Content-Type: message/rfc822 |
| 3917 |
|
| 3918 |
From: (name in US-ASCII) |
| 3919 |
Subject: (subject in US-ASCII) |
| 3920 |
Content-Type: Text/plain; charset=ISO-8859-1 |
| 3921 |
Content-Transfer-Encoding: Quoted-printable |
| 3922 |
|
| 3923 |
... Additional text in ISO-8859-1 goes here ... |
| 3924 |
|
| 3925 |
--unique-boundary-1-- |
| 3926 |
|
| 3927 |
|
| 3928 |
|
| 3929 |
|
| 3930 |
|
| 3931 |
|
| 3932 |
|
| 3933 |
|
| 3934 |
|
| 3935 |
|
| 3936 |
|
| 3937 |
|
| 3938 |
|
| 3939 |
|
| 3940 |
|
| 3941 |
|
| 3942 |
|
| 3943 |
|
| 3944 |
|
| 3945 |
|
| 3946 |
|
| 3947 |
|
| 3948 |
|
| 3949 |
|
| 3950 |
|
| 3951 |
|
| 3952 |
|
| 3953 |
|
| 3954 |
|
| 3955 |
|
| 3956 |
|
| 3957 |
|
| 3958 |
|
| 3959 |
|
| 3960 |
|
| 3961 |
<span class="grey"> Borenstein & Freed [Page 63]</span></pre> |
| 3962 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-64" ></span> |
| 3963 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 3964 |
|
| 3965 |
|
| 3966 |
<a href="#appendix-D">Appendix D</a> -- A Simple Richtext-to-Text Translator in C |
| 3967 |
|
| 3968 |
One of the major goals in the design of the richtext subtype |
| 3969 |
of the text Content-Type is to make formatted text so simple |
| 3970 |
that even text-only mailers will implement richtext-to- |
| 3971 |
plain-text translators, thus increasing the likelihood that |
| 3972 |
multifont text will become "safe" to use very widely. To |
| 3973 |
demonstrate this simplicity, what follows is an extremely |
| 3974 |
simple 44-line C program that converts richtext input into |
| 3975 |
plain text output: |
| 3976 |
|
| 3977 |
#include <stdio.h> |
| 3978 |
#include <ctype.h> |
| 3979 |
main() { |
| 3980 |
int c, i; |
| 3981 |
char token[50]; |
| 3982 |
|
| 3983 |
while((c = getc(stdin)) != EOF) { |
| 3984 |
if (c == '<') { |
| 3985 |
for (i=0; (i<49 && (c = getc(stdin)) != '>' |
| 3986 |
&& c != EOF); ++i) { |
| 3987 |
token[i] = isupper(c) ? tolower(c) : c; |
| 3988 |
} |
| 3989 |
if (c == EOF) break; |
| 3990 |
if (c != '>') while ((c = getc(stdin)) != |
| 3991 |
'>' |
| 3992 |
&& c != EOF) {;} |
| 3993 |
if (c == EOF) break; |
| 3994 |
token[i] = '\0'; |
| 3995 |
if (!strcmp(token, "lt")) { |
| 3996 |
putc('<', stdout); |
| 3997 |
} else if (!strcmp(token, "nl")) { |
| 3998 |
putc('\n', stdout); |
| 3999 |
} else if (!strcmp(token, "/paragraph")) { |
| 4000 |
fputs("\n\n", stdout); |
| 4001 |
} else if (!strcmp(token, "comment")) { |
| 4002 |
int commct=1; |
| 4003 |
while (commct > 0) { |
| 4004 |
while ((c = getc(stdin)) != '<' |
| 4005 |
&& c != EOF) ; |
| 4006 |
if (c == EOF) break; |
| 4007 |
for (i=0; (c = getc(stdin)) != '>' |
| 4008 |
&& c != EOF; ++i) { |
| 4009 |
token[i] = isupper(c) ? |
| 4010 |
tolower(c) : c; |
| 4011 |
} |
| 4012 |
if (c== EOF) break; |
| 4013 |
token[i] = NULL; |
| 4014 |
if (!strcmp(token, "/comment")) -- |
| 4015 |
commct; |
| 4016 |
if (!strcmp(token, "comment")) |
| 4017 |
++commct; |
| 4018 |
|
| 4019 |
|
| 4020 |
|
| 4021 |
|
| 4022 |
|
| 4023 |
<span class="grey"> Borenstein & Freed [Page 64]</span></pre> |
| 4024 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-65" ></span> |
| 4025 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4026 |
|
| 4027 |
|
| 4028 |
} |
| 4029 |
} /* Ignore all other tokens */ |
| 4030 |
} else if (c != '\n') putc(c, stdout); |
| 4031 |
} |
| 4032 |
putc('\n', stdout); /* for good measure */ |
| 4033 |
} |
| 4034 |
It should be noted that one can do considerably better than |
| 4035 |
this in displaying richtext data on a dumb terminal. In |
| 4036 |
particular, one can replace font information such as "bold" |
| 4037 |
with textual emphasis (like *this* or _T_H_I_S_). One can |
| 4038 |
also properly handle the richtext formatting commands |
| 4039 |
regarding indentation, justification, and others. However, |
| 4040 |
the above program is all that is necessary in order to |
| 4041 |
present richtext on a dumb terminal. |
| 4042 |
|
| 4043 |
|
| 4044 |
|
| 4045 |
|
| 4046 |
|
| 4047 |
|
| 4048 |
|
| 4049 |
|
| 4050 |
|
| 4051 |
|
| 4052 |
|
| 4053 |
|
| 4054 |
|
| 4055 |
|
| 4056 |
|
| 4057 |
|
| 4058 |
|
| 4059 |
|
| 4060 |
|
| 4061 |
|
| 4062 |
|
| 4063 |
|
| 4064 |
|
| 4065 |
|
| 4066 |
|
| 4067 |
|
| 4068 |
|
| 4069 |
|
| 4070 |
|
| 4071 |
|
| 4072 |
|
| 4073 |
|
| 4074 |
|
| 4075 |
|
| 4076 |
|
| 4077 |
|
| 4078 |
|
| 4079 |
|
| 4080 |
|
| 4081 |
|
| 4082 |
|
| 4083 |
|
| 4084 |
|
| 4085 |
<span class="grey"> Borenstein & Freed [Page 65]</span></pre> |
| 4086 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-66" ></span> |
| 4087 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4088 |
|
| 4089 |
|
| 4090 |
<a href="#appendix-E">Appendix E</a> -- Collected Grammar |
| 4091 |
|
| 4092 |
This appendix contains the complete BNF grammar for all the |
| 4093 |
syntax specified by this document. |
| 4094 |
|
| 4095 |
By itself, however, this grammar is incomplete. It refers |
| 4096 |
to several entities that are defined by <a href="./rfc822">RFC 822</a>. Rather |
| 4097 |
than reproduce those definitions here, and risk |
| 4098 |
unintentional differences between the two, this document |
| 4099 |
simply refers the reader to RFC 822 for the remaining |
| 4100 |
definitions. Wherever a term is undefined, it refers to the |
| 4101 |
<a href="./rfc822">RFC 822</a> definition. |
| 4102 |
|
| 4103 |
attribute := token |
| 4104 |
|
| 4105 |
body-part = <"message" as defined in <a href="./rfc822">RFC 822</a>, |
| 4106 |
with all header fields optional, and with the |
| 4107 |
specified delimiter not occurring anywhere in |
| 4108 |
the message body, either on a line by itself |
| 4109 |
or as a substring anywhere.> |
| 4110 |
|
| 4111 |
boundary := 0*69<bchars> bcharsnospace |
| 4112 |
|
| 4113 |
bchars := bcharsnospace / " " |
| 4114 |
|
| 4115 |
bcharsnospace := DIGIT / ALPHA / "'" / "(" / ")" / "+" / |
| 4116 |
"_" |
| 4117 |
/ "," / "-" / "." / "/" / ":" / "=" / "?" |
| 4118 |
|
| 4119 |
close-delimiter := delimiter "--" |
| 4120 |
|
| 4121 |
Content-Description := *text |
| 4122 |
|
| 4123 |
Content-ID := msg-id |
| 4124 |
|
| 4125 |
Content-Transfer-Encoding := "BASE64" / "QUOTED- |
| 4126 |
PRINTABLE" / |
| 4127 |
"8BIT" / "7BIT" / |
| 4128 |
"BINARY" / x-token |
| 4129 |
|
| 4130 |
Content-Type := type "/" subtype *[";" parameter] |
| 4131 |
|
| 4132 |
delimiter := CRLF "--" boundary ; taken from Content-Type |
| 4133 |
field. |
| 4134 |
; when content-type is |
| 4135 |
multipart |
| 4136 |
; There should be no space |
| 4137 |
; between "--" and boundary. |
| 4138 |
|
| 4139 |
encapsulation := delimiter CRLF body-part |
| 4140 |
|
| 4141 |
epilogue := *text ; to be ignored upon |
| 4142 |
receipt. |
| 4143 |
|
| 4144 |
|
| 4145 |
|
| 4146 |
|
| 4147 |
<span class="grey"> Borenstein & Freed [Page 66]</span></pre> |
| 4148 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-67" ></span> |
| 4149 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4150 |
|
| 4151 |
|
| 4152 |
MIME-Version := 1*text |
| 4153 |
|
| 4154 |
multipart-body := preamble 1*encapsulation close-delimiter |
| 4155 |
epilogue |
| 4156 |
|
| 4157 |
parameter := attribute "=" value |
| 4158 |
|
| 4159 |
preamble := *text ; to be ignored upon |
| 4160 |
receipt. |
| 4161 |
|
| 4162 |
subtype := token |
| 4163 |
|
| 4164 |
token := 1*<any CHAR except SPACE, CTLs, or tspecials> |
| 4165 |
|
| 4166 |
tspecials := "(" / ")" / "<" / ">" / "@" ; Must be in |
| 4167 |
/ "," / ";" / ":" / "\" / <"> ; quoted-string, |
| 4168 |
/ "/" / "[" / "]" / "?" / "." ; to use within |
| 4169 |
/ "=" ; parameter values |
| 4170 |
|
| 4171 |
|
| 4172 |
type := "application" / "audio" ; case- |
| 4173 |
insensitive |
| 4174 |
/ "image" / "message" |
| 4175 |
/ "multipart" / "text" |
| 4176 |
/ "video" / x-token |
| 4177 |
|
| 4178 |
value := token / quoted-string |
| 4179 |
|
| 4180 |
x-token := <The two characters "X-" followed, with no |
| 4181 |
intervening white space, by any token> |
| 4182 |
|
| 4183 |
|
| 4184 |
|
| 4185 |
|
| 4186 |
|
| 4187 |
|
| 4188 |
|
| 4189 |
|
| 4190 |
|
| 4191 |
|
| 4192 |
|
| 4193 |
|
| 4194 |
|
| 4195 |
|
| 4196 |
|
| 4197 |
|
| 4198 |
|
| 4199 |
|
| 4200 |
|
| 4201 |
|
| 4202 |
|
| 4203 |
|
| 4204 |
|
| 4205 |
|
| 4206 |
|
| 4207 |
|
| 4208 |
|
| 4209 |
<span class="grey"> Borenstein & Freed [Page 67]</span></pre> |
| 4210 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-68" ></span> |
| 4211 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4212 |
|
| 4213 |
|
| 4214 |
<a href="#appendix-F">Appendix F</a> -- IANA Registration Procedures |
| 4215 |
|
| 4216 |
MIME has been carefully designed to have extensible |
| 4217 |
mechanisms, and it is expected that the set of content- |
| 4218 |
type/subtype pairs and their associated parameters will grow |
| 4219 |
significantly with time. Several other MIME fields, notably |
| 4220 |
character set names, access-type parameters for the |
| 4221 |
message/external-body type, conversions parameters for the |
| 4222 |
application type, and possibly even Content-Transfer- |
| 4223 |
Encoding values, are likely to have new values defined over |
| 4224 |
time. In order to ensure that the set of such values is |
| 4225 |
developed in an orderly, well-specified, and public manner, |
| 4226 |
MIME defines a registration process which uses the Internet |
| 4227 |
Assigned Numbers Authority (IANA) as a central registry for |
| 4228 |
such values. |
| 4229 |
|
| 4230 |
In general, parameters in the content-type header field are |
| 4231 |
used to convey supplemental information for various content |
| 4232 |
types, and their use is defined when the content-type and |
| 4233 |
subtype are defined. New parameters should not be defined |
| 4234 |
as a way to introduce new functionality. |
| 4235 |
|
| 4236 |
In order to simplify and standardize the registration |
| 4237 |
process, this appendix gives templates for the registration |
| 4238 |
of new values with IANA. Each of these is given in the form |
| 4239 |
of an email message template, to be filled in by the |
| 4240 |
registering party. |
| 4241 |
|
| 4242 |
F.1 Registration of New Content-type/subtype Values |
| 4243 |
|
| 4244 |
Note that MIME is generally expected to be extended by |
| 4245 |
subtypes. If a new fundamental top-level type is needed, |
| 4246 |
its specification should be published as an RFC or |
| 4247 |
submitted in a form suitable to become an RFC, and be |
| 4248 |
subject to the Internet standards process. |
| 4249 |
|
| 4250 |
To: [email protected] |
| 4251 |
Subject: Registration of new MIME content-type/subtype |
| 4252 |
|
| 4253 |
MIME type name: |
| 4254 |
|
| 4255 |
(If the above is not an existing top-level MIME type, |
| 4256 |
please explain why an existing type cannot be used.) |
| 4257 |
|
| 4258 |
MIME subtype name: |
| 4259 |
|
| 4260 |
Required parameters: |
| 4261 |
|
| 4262 |
Optional parameters: |
| 4263 |
|
| 4264 |
Encoding considerations: |
| 4265 |
|
| 4266 |
Security considerations: |
| 4267 |
|
| 4268 |
|
| 4269 |
|
| 4270 |
|
| 4271 |
<span class="grey"> Borenstein & Freed [Page 68]</span></pre> |
| 4272 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-69" ></span> |
| 4273 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4274 |
|
| 4275 |
|
| 4276 |
Published specification: |
| 4277 |
|
| 4278 |
(The published specification must be an Internet RFC or |
| 4279 |
RFC-to-be if a new top-level type is being defined, and |
| 4280 |
must be a publicly available specification in any |
| 4281 |
case.) |
| 4282 |
|
| 4283 |
Person & email address to contact for further |
| 4284 |
information: |
| 4285 |
F.2 Registration of New Character Set Values |
| 4286 |
|
| 4287 |
To: [email protected] |
| 4288 |
Subject: Registration of new MIME character set value |
| 4289 |
|
| 4290 |
MIME character set name: |
| 4291 |
|
| 4292 |
Published specification: |
| 4293 |
|
| 4294 |
(The published specification must be an Internet RFC or |
| 4295 |
RFC-to-be or an international standard.) |
| 4296 |
|
| 4297 |
Person & email address to contact for further |
| 4298 |
information: |
| 4299 |
|
| 4300 |
F.3 Registration of New Access-type Values for |
| 4301 |
Message/external-body |
| 4302 |
|
| 4303 |
To: [email protected] |
| 4304 |
Subject: Registration of new MIME Access-type for |
| 4305 |
Message/external-body content-type |
| 4306 |
|
| 4307 |
MIME access-type name: |
| 4308 |
|
| 4309 |
Required parameters: |
| 4310 |
|
| 4311 |
Optional parameters: |
| 4312 |
|
| 4313 |
Published specification: |
| 4314 |
|
| 4315 |
(The published specification must be an Internet RFC or |
| 4316 |
RFC-to-be.) |
| 4317 |
|
| 4318 |
Person & email address to contact for further |
| 4319 |
information: |
| 4320 |
|
| 4321 |
|
| 4322 |
F.4 Registration of New Conversions Values for Application |
| 4323 |
|
| 4324 |
To: [email protected] |
| 4325 |
Subject: Registration of new MIME Conversions value |
| 4326 |
for Application content-type |
| 4327 |
|
| 4328 |
MIME Conversions name: |
| 4329 |
|
| 4330 |
|
| 4331 |
|
| 4332 |
|
| 4333 |
<span class="grey"> Borenstein & Freed [Page 69]</span></pre> |
| 4334 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-70" ></span> |
| 4335 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4336 |
|
| 4337 |
|
| 4338 |
Published specification: |
| 4339 |
|
| 4340 |
(The published specification must be an Internet RFC or |
| 4341 |
RFC-to-be.) |
| 4342 |
|
| 4343 |
Person & email address to contact for further |
| 4344 |
information: |
| 4345 |
|
| 4346 |
|
| 4347 |
|
| 4348 |
|
| 4349 |
|
| 4350 |
|
| 4351 |
|
| 4352 |
|
| 4353 |
|
| 4354 |
|
| 4355 |
|
| 4356 |
|
| 4357 |
|
| 4358 |
|
| 4359 |
|
| 4360 |
|
| 4361 |
|
| 4362 |
|
| 4363 |
|
| 4364 |
|
| 4365 |
|
| 4366 |
|
| 4367 |
|
| 4368 |
|
| 4369 |
|
| 4370 |
|
| 4371 |
|
| 4372 |
|
| 4373 |
|
| 4374 |
|
| 4375 |
|
| 4376 |
|
| 4377 |
|
| 4378 |
|
| 4379 |
|
| 4380 |
|
| 4381 |
|
| 4382 |
|
| 4383 |
|
| 4384 |
|
| 4385 |
|
| 4386 |
|
| 4387 |
|
| 4388 |
|
| 4389 |
|
| 4390 |
|
| 4391 |
|
| 4392 |
|
| 4393 |
|
| 4394 |
|
| 4395 |
<span class="grey"> Borenstein & Freed [Page 70]</span></pre> |
| 4396 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-71" ></span> |
| 4397 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4398 |
|
| 4399 |
|
| 4400 |
<a href="#appendix-G">Appendix G</a> -- Summary of the Seven Content-types |
| 4401 |
|
| 4402 |
Content-type: text |
| 4403 |
|
| 4404 |
Subtypes defined by this document: plain, richtext |
| 4405 |
|
| 4406 |
Important Parameters: charset |
| 4407 |
|
| 4408 |
Encoding notes: quoted-printable generally preferred if an |
| 4409 |
encoding is needed and the character set is mostly an |
| 4410 |
ASCII superset. |
| 4411 |
|
| 4412 |
Security considerations: Rich text formats such as TeX and |
| 4413 |
Troff often contain mechanisms for executing arbitrary |
| 4414 |
commands or file system operations, and should not be |
| 4415 |
used automatically unless these security problems have |
| 4416 |
been addressed. Even plain text may contain control |
| 4417 |
characters that can be used to exploit the capabilities |
| 4418 |
of "intelligent" terminals and cause security |
| 4419 |
violations. User interfaces designed to run on such |
| 4420 |
terminals should be aware of and try to prevent such |
| 4421 |
problems. |
| 4422 |
________________________________________________________________ |
| 4423 |
|
| 4424 |
Content-type: multipart |
| 4425 |
|
| 4426 |
Subtypes defined by this document: mixed, alternative, |
| 4427 |
digest, parallel. |
| 4428 |
|
| 4429 |
Important Parameters: boundary |
| 4430 |
|
| 4431 |
Encoding notes: No content-transfer-encoding is permitted. |
| 4432 |
|
| 4433 |
________________________________________________________________ |
| 4434 |
|
| 4435 |
Content-type: message |
| 4436 |
|
| 4437 |
Subtypes defined by this document: <a href="./rfc822">rfc822</a>, partial, |
| 4438 |
external-body |
| 4439 |
|
| 4440 |
Important Parameters: id, number, total |
| 4441 |
|
| 4442 |
Encoding notes: No content-transfer-encoding is permitted. |
| 4443 |
|
| 4444 |
________________________________________________________________ |
| 4445 |
|
| 4446 |
Content-type: application |
| 4447 |
|
| 4448 |
Subtypes defined by this document: octet-stream, |
| 4449 |
postscript, oda |
| 4450 |
|
| 4451 |
Important Parameters: profile |
| 4452 |
|
| 4453 |
|
| 4454 |
|
| 4455 |
|
| 4456 |
|
| 4457 |
<span class="grey"> Borenstein & Freed [Page 71]</span></pre> |
| 4458 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-72" ></span> |
| 4459 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4460 |
|
| 4461 |
|
| 4462 |
Encoding notes: base64 generally preferred for octet-stream |
| 4463 |
or other unreadable subtypes. |
| 4464 |
|
| 4465 |
Security considerations: This type is intended for the |
| 4466 |
transmission of data to be interpreted by locally-installed |
| 4467 |
programs. If used, for example, to transmit executable |
| 4468 |
binary programs or programs in general-purpose interpreted |
| 4469 |
languages, such as LISP programs or shell scripts, severe |
| 4470 |
security problems could result. In general, authors of |
| 4471 |
mail-reading agents are cautioned against giving their |
| 4472 |
systems the power to execute mail-based application data |
| 4473 |
without carefully considering the security implications. |
| 4474 |
While it is certainly possible to define safe application |
| 4475 |
formats and even safe interpreters for unsafe formats, each |
| 4476 |
interpreter should be evaluated separately for possible |
| 4477 |
security problems. |
| 4478 |
________________________________________________________________ |
| 4479 |
|
| 4480 |
Content-type: image |
| 4481 |
|
| 4482 |
Subtypes defined by this document: jpeg, gif |
| 4483 |
|
| 4484 |
Important Parameters: none |
| 4485 |
|
| 4486 |
Encoding notes: base64 generally preferred |
| 4487 |
|
| 4488 |
________________________________________________________________ |
| 4489 |
|
| 4490 |
Content-type: audio |
| 4491 |
|
| 4492 |
Subtypes defined by this document: basic |
| 4493 |
|
| 4494 |
Important Parameters: none |
| 4495 |
|
| 4496 |
Encoding notes: base64 generally preferred |
| 4497 |
|
| 4498 |
________________________________________________________________ |
| 4499 |
|
| 4500 |
Content-type: video |
| 4501 |
|
| 4502 |
Subtypes defined by this document: mpeg |
| 4503 |
|
| 4504 |
Important Parameters: none |
| 4505 |
|
| 4506 |
Encoding notes: base64 generally preferred |
| 4507 |
|
| 4508 |
|
| 4509 |
|
| 4510 |
|
| 4511 |
|
| 4512 |
|
| 4513 |
|
| 4514 |
|
| 4515 |
|
| 4516 |
|
| 4517 |
|
| 4518 |
|
| 4519 |
<span class="grey"> Borenstein & Freed [Page 72]</span></pre> |
| 4520 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-73" ></span> |
| 4521 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4522 |
|
| 4523 |
|
| 4524 |
<a href="#appendix-H">Appendix H</a> -- Canonical Encoding Model |
| 4525 |
|
| 4526 |
|
| 4527 |
|
| 4528 |
There was some confusion, in earlier drafts of this memo, |
| 4529 |
regarding the model for when email data was to be converted |
| 4530 |
to canonical form and encoded, and in particular how this |
| 4531 |
process would affect the treatment of CRLFs, given that the |
| 4532 |
representation of newlines varies greatly from system to |
| 4533 |
system. For this reason, a canonical model for encoding is |
| 4534 |
presented below. |
| 4535 |
|
| 4536 |
The process of composing a MIME message part can be modelled |
| 4537 |
as being done in a number of steps. Note that these steps |
| 4538 |
are roughly similar to those steps used in <a href="./rfc1113">RFC1113</a>: |
| 4539 |
|
| 4540 |
Step 1. Creation of local form. |
| 4541 |
|
| 4542 |
The body part to be transmitted is created in the system's |
| 4543 |
native format. The native character set is used, and where |
| 4544 |
appropriate local end of line conventions are used as well. |
| 4545 |
The may be a UNIX-style text file, or a Sun raster image, or |
| 4546 |
a VMS indexed file, or audio data in a system-dependent |
| 4547 |
format stored only in memory, or anything else that |
| 4548 |
corresponds to the local model for the representation of |
| 4549 |
some form of information. |
| 4550 |
|
| 4551 |
Step 2. Conversion to canonical form. |
| 4552 |
|
| 4553 |
The entire body part, including "out-of-band" information |
| 4554 |
such as record lengths and possibly file attribute |
| 4555 |
information, is converted to a universal canonical form. |
| 4556 |
The specific content type of the body part as well as its |
| 4557 |
associated attributes dictate the nature of the canonical |
| 4558 |
form that is used. Conversion to the proper canonical form |
| 4559 |
may involve character set conversion, transformation of |
| 4560 |
audio data, compression, or various other operations |
| 4561 |
specific to the various content types. |
| 4562 |
|
| 4563 |
For example, in the case of text/plain data, the text must |
| 4564 |
be converted to a supported character set and lines must be |
| 4565 |
delimited with CRLF delimiters in accordance with <a href="./rfc822">RFC822</a>. |
| 4566 |
Note that the restriction on line lengths implied by <a href="./rfc822">RFC822</a> |
| 4567 |
is eliminated if the next step employs either quoted- |
| 4568 |
printable or base64 encoding. |
| 4569 |
|
| 4570 |
Step 3. Apply transfer encoding. |
| 4571 |
|
| 4572 |
A Content-Transfer-Encoding appropriate for this body part |
| 4573 |
is applied. Note that there is no fixed relationship |
| 4574 |
between the content type and the transfer encoding. In |
| 4575 |
particular, it may be appropriate to base the choice of |
| 4576 |
base64 or quoted-printable on character frequency counts |
| 4577 |
which are specific to a given instance of body part. |
| 4578 |
|
| 4579 |
|
| 4580 |
|
| 4581 |
<span class="grey"> Borenstein & Freed [Page 73]</span></pre> |
| 4582 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-74" ></span> |
| 4583 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4584 |
|
| 4585 |
|
| 4586 |
Step 4. Insertion into message. |
| 4587 |
|
| 4588 |
The encoded object is inserted into a MIME message with |
| 4589 |
appropriate body part headers and boundary markers. |
| 4590 |
|
| 4591 |
It is vital to note that these steps are only a model; they |
| 4592 |
are specifically NOT a blueprint for how an actual system |
| 4593 |
would be built. In particular, the model fails to account |
| 4594 |
for two common designs: |
| 4595 |
|
| 4596 |
1. In many cases the conversion to a canonical |
| 4597 |
form prior to encoding will be subsumed into the |
| 4598 |
encoder itself, which understands local formats |
| 4599 |
directly. For example, the local newline |
| 4600 |
convention for text bodyparts might be carried |
| 4601 |
through to the encoder itself along with knowledge |
| 4602 |
of what that format is. |
| 4603 |
|
| 4604 |
2. The output of the encoders may have to pass |
| 4605 |
through one or more additional steps prior to |
| 4606 |
being transmitted as a message. As such, the |
| 4607 |
output of the encoder may not be compliant with |
| 4608 |
the formats specified by <a href="./rfc822">RFC822</a>. In particular, |
| 4609 |
once again it may be appropriate for the |
| 4610 |
converter's output to be expressed using local |
| 4611 |
newline conventions rather than using the standard |
| 4612 |
<a href="./rfc822">RFC822</a> CRLF delimiters. |
| 4613 |
|
| 4614 |
Other implementation variations are conceivable as well. |
| 4615 |
The only important aspect of this discussion is that the |
| 4616 |
resulting messages are consistent with those produced by the |
| 4617 |
model described here. |
| 4618 |
|
| 4619 |
|
| 4620 |
|
| 4621 |
|
| 4622 |
|
| 4623 |
|
| 4624 |
|
| 4625 |
|
| 4626 |
|
| 4627 |
|
| 4628 |
|
| 4629 |
|
| 4630 |
|
| 4631 |
|
| 4632 |
|
| 4633 |
|
| 4634 |
|
| 4635 |
|
| 4636 |
|
| 4637 |
|
| 4638 |
|
| 4639 |
|
| 4640 |
|
| 4641 |
|
| 4642 |
|
| 4643 |
<span class="grey"> Borenstein & Freed [Page 74]</span></pre> |
| 4644 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-75" ></span> |
| 4645 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4646 |
|
| 4647 |
|
| 4648 |
References |
| 4649 |
|
| 4650 |
[<a id="ref-US-ASCII">US-ASCII</a>] Coded Character Set--7-Bit American Standard Code |
| 4651 |
for Information Interchange, ANSI X3.4-1986. |
| 4652 |
|
| 4653 |
[<a id="ref-ATK">ATK</a>] Borenstein, Nathaniel S., Multimedia Applications |
| 4654 |
Development with the Andrew Toolkit, Prentice-Hall, 1990. |
| 4655 |
|
| 4656 |
[<a id="ref-GIF">GIF</a>] Graphics Interchange Format (Version 89a), Compuserve, |
| 4657 |
Inc., Columbus, Ohio, 1990. |
| 4658 |
|
| 4659 |
[<a id="ref-ISO-2022">ISO-2022</a>] International Standard--Information Processing-- |
| 4660 |
ISO 7-bit and 8-bit coded character sets--Code extension |
| 4661 |
techniques, ISO 2022:1986. |
| 4662 |
|
| 4663 |
[<a id="ref-ISO-8859">ISO-8859</a>] Information Processing -- 8-bit Single-Byte Coded |
| 4664 |
Graphic Character Sets -- Part 1: Latin Alphabet No. 1, ISO |
| 4665 |
8859-1:1987. Part 2: Latin alphabet No. 2, ISO 8859-2, |
| 4666 |
1987. Part 3: Latin alphabet No. 3, ISO 8859-3, 1988. Part |
| 4667 |
4: Latin alphabet No. 4, ISO 8859-4, 1988. Part 5: |
| 4668 |
Latin/Cyrillic alphabet, ISO 8859-5, 1988. Part 6: |
| 4669 |
Latin/Arabic alphabet, ISO 8859-6, 1987. Part 7: |
| 4670 |
Latin/Greek alphabet, ISO 8859-7, 1987. Part 8: |
| 4671 |
Latin/Hebrew alphabet, ISO 8859-8, 1988. Part 9: Latin |
| 4672 |
alphabet No. 5, ISO 8859-9, 1990. |
| 4673 |
|
| 4674 |
[<a id="ref-ISO-646">ISO-646</a>] International Standard--Information Processing-- |
| 4675 |
ISO 7-bit coded character set for information interchange, |
| 4676 |
ISO 646:1983. |
| 4677 |
|
| 4678 |
[<a id="ref-MPEG">MPEG</a>] Video Coding Draft Standard ISO 11172 CD, ISO |
| 4679 |
IEC/TJC1/SC2/WG11 (Motion Picture Experts Group), May, 1991. |
| 4680 |
|
| 4681 |
[<a id="ref-ODA">ODA</a>] ISO 8613; Information Processing: Text and Office |
| 4682 |
System; Office Document Architecture (ODA) and Interchange |
| 4683 |
Format (ODIF), Part 1-8, 1989. |
| 4684 |
|
| 4685 |
[<a id="ref-PCM">PCM</a>] CCITT, Fascicle III.4 - Recommendation G.711, Geneva, |
| 4686 |
1972, "Pulse Code Modulation (PCM) of Voice Frequencies". |
| 4687 |
|
| 4688 |
[<a id="ref-POSTSCRIPT">POSTSCRIPT</a>] Adobe Systems, Inc., PostScript Language |
| 4689 |
Reference Manual, Addison-Wesley, 1985. |
| 4690 |
|
| 4691 |
[<a id="ref-X400">X400</a>] Schicker, Pietro, "Message Handling Systems, X.400", |
| 4692 |
Message Handling Systems and Distributed Applications, E. |
| 4693 |
Stefferud, O-j. Jacobsen, and P. Schicker, eds., North- |
| 4694 |
Holland, 1989, pp. 3-41. |
| 4695 |
|
| 4696 |
[<a id="ref-RFC-783">RFC-783</a>] Sollins, K.R. TFTP Protocol (revision 2). June, |
| 4697 |
1981, MIT, <a href="./rfc783">RFC-783</a>. |
| 4698 |
|
| 4699 |
[<a id="ref-RFC-821">RFC-821</a>] Postel, J.B. Simple Mail Transfer Protocol. |
| 4700 |
August, 1982, USC/Information Sciences Institute, <a href="./rfc821">RFC-821</a>. |
| 4701 |
|
| 4702 |
|
| 4703 |
|
| 4704 |
|
| 4705 |
<span class="grey"> Borenstein & Freed [Page 75]</span></pre> |
| 4706 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-76" ></span> |
| 4707 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4708 |
|
| 4709 |
|
| 4710 |
[<a id="ref-RFC-822">RFC-822</a>] Crocker, D. Standard for the format of ARPA |
| 4711 |
Internet text messages. August, 1982, UDEL, <a href="./rfc822">RFC-822</a>. |
| 4712 |
|
| 4713 |
[<a id="ref-RFC-934">RFC-934</a>] Rose, M.T.; Stefferud, E.A. Proposed standard |
| 4714 |
for message encapsulation. January, 1985, Delaware |
| 4715 |
and NMA, <a href="./rfc934">RFC-934</a>. |
| 4716 |
|
| 4717 |
[<a id="ref-RFC-959">RFC-959</a>] Postel, J.B.; Reynolds, J.K. File Transfer |
| 4718 |
Protocol. October, 1985, USC/Information Sciences |
| 4719 |
Institute, <a href="./rfc959">RFC-959</a>. |
| 4720 |
|
| 4721 |
[<a id="ref-RFC-1049">RFC-1049</a>] Sirbu, M.A. Content-Type header field for |
| 4722 |
Internet messages. March, 1988, CMU, <a href="./rfc1049">RFC-1049</a>. |
| 4723 |
|
| 4724 |
[<a id="ref-RFC-1113">RFC-1113</a>] Linn, J. Privacy enhancement for Internet |
| 4725 |
electronic mail: Part I - message encipherment and |
| 4726 |
authentication procedures. August, 1989, IAB Privacy Task |
| 4727 |
Force, <a href="./rfc1113">RFC-1113</a>. |
| 4728 |
|
| 4729 |
[<a id="ref-RFC-1154">RFC-1154</a>] Robinson, D.; Ullmann, R. Encoding header field |
| 4730 |
for Internet messages. April, 1990, Prime Computer, |
| 4731 |
Inc., <a href="./rfc1154">RFC-1154</a>. |
| 4732 |
|
| 4733 |
[<a id="ref-RFC-1342">RFC-1342</a>] Moore, Keith, Representation of Non-Ascii Text in |
| 4734 |
Internet Message Headers. June, 1992, University of |
| 4735 |
Tennessee, <a href="./rfc1342">RFC-1342</a>. |
| 4736 |
|
| 4737 |
Security Considerations |
| 4738 |
|
| 4739 |
Security issues are discussed in Section 7.4.2 and in |
| 4740 |
Appendix G. Implementors should pay special attention to |
| 4741 |
the security implications of any mail content-types that can |
| 4742 |
cause the remote execution of any actions in the recipient's |
| 4743 |
environment. In such cases, the discussion of the |
| 4744 |
applicaton/postscript content-type in Section 7.4.2 may |
| 4745 |
serve as a model for considering other content-types with |
| 4746 |
remote execution capabilities. |
| 4747 |
|
| 4748 |
|
| 4749 |
|
| 4750 |
|
| 4751 |
|
| 4752 |
|
| 4753 |
|
| 4754 |
|
| 4755 |
|
| 4756 |
|
| 4757 |
|
| 4758 |
|
| 4759 |
|
| 4760 |
|
| 4761 |
|
| 4762 |
|
| 4763 |
|
| 4764 |
|
| 4765 |
|
| 4766 |
|
| 4767 |
<span class="grey"> Borenstein & Freed [Page 76]</span></pre> |
| 4768 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-77" ></span> |
| 4769 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4770 |
|
| 4771 |
|
| 4772 |
Authors' Addresses |
| 4773 |
|
| 4774 |
For more information, the authors of this document may be |
| 4775 |
contacted via Internet mail: |
| 4776 |
|
| 4777 |
Nathaniel S. Borenstein |
| 4778 |
MRE 2D-296, Bellcore |
| 4779 |
445 South St. |
| 4780 |
Morristown, NJ 07962-1910 |
| 4781 |
|
| 4782 |
Phone: +1 201 829 4270 |
| 4783 |
Fax: +1 201 829 7019 |
| 4784 |
Email: [email protected] |
| 4785 |
|
| 4786 |
|
| 4787 |
Ned Freed |
| 4788 |
Innosoft International, Inc. |
| 4789 |
250 West First Street |
| 4790 |
Suite 240 |
| 4791 |
Claremont, CA 91711 |
| 4792 |
|
| 4793 |
Phone: +1 714 624 7907 |
| 4794 |
Fax: +1 714 621 5319 |
| 4795 |
Email: [email protected] |
| 4796 |
|
| 4797 |
|
| 4798 |
|
| 4799 |
|
| 4800 |
|
| 4801 |
|
| 4802 |
|
| 4803 |
|
| 4804 |
|
| 4805 |
|
| 4806 |
|
| 4807 |
|
| 4808 |
|
| 4809 |
|
| 4810 |
|
| 4811 |
|
| 4812 |
|
| 4813 |
|
| 4814 |
|
| 4815 |
|
| 4816 |
|
| 4817 |
|
| 4818 |
|
| 4819 |
|
| 4820 |
|
| 4821 |
|
| 4822 |
|
| 4823 |
|
| 4824 |
|
| 4825 |
|
| 4826 |
|
| 4827 |
|
| 4828 |
|
| 4829 |
<span class="grey"> Borenstein & Freed [Page 77]</span></pre> |
| 4830 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-i" ></span> |
| 4831 |
<span class="grey"> RFC 1341MIME: Multipurpose Internet Mail ExtensionsJune 1992</span> |
| 4832 |
|
| 4833 |
|
| 4834 |
|
| 4835 |
|
| 4836 |
|
| 4837 |
THIS PAGE INTENTIONALLY LEFT BLANK. |
| 4838 |
|
| 4839 |
Please discard this page and place the following table of |
| 4840 |
contents after the title page. |
| 4841 |
|
| 4842 |
|
| 4843 |
|
| 4844 |
|
| 4845 |
|
| 4846 |
|
| 4847 |
|
| 4848 |
|
| 4849 |
|
| 4850 |
|
| 4851 |
|
| 4852 |
|
| 4853 |
|
| 4854 |
|
| 4855 |
|
| 4856 |
|
| 4857 |
|
| 4858 |
|
| 4859 |
|
| 4860 |
|
| 4861 |
|
| 4862 |
|
| 4863 |
|
| 4864 |
|
| 4865 |
|
| 4866 |
|
| 4867 |
|
| 4868 |
|
| 4869 |
|
| 4870 |
|
| 4871 |
|
| 4872 |
|
| 4873 |
|
| 4874 |
|
| 4875 |
|
| 4876 |
|
| 4877 |
|
| 4878 |
|
| 4879 |
|
| 4880 |
|
| 4881 |
|
| 4882 |
|
| 4883 |
|
| 4884 |
|
| 4885 |
|
| 4886 |
|
| 4887 |
|
| 4888 |
|
| 4889 |
|
| 4890 |
|
| 4891 |
<span class="grey"> Borenstein & Freed [Page i]</span></pre> |
| 4892 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-ii" ></span> |
| 4893 |
<span class="grey"> Table of Contents</span> |
| 4894 |
|
| 4895 |
|
| 4896 |
<a href="#section-1">1</a> Introduction....................................... <a href="#page-1">1</a> |
| 4897 |
<a href="#section-2">2</a> Notations, Conventions, and Generic BNF Grammar.... <a href="#page-3">3</a> |
| 4898 |
<a href="#section-3">3</a> The MIME-Version Header Field...................... <a href="#page-5">5</a> |
| 4899 |
<a href="#section-4">4</a> The Content-Type Header Field...................... <a href="#page-6">6</a> |
| 4900 |
<a href="#section-5">5</a> The Content-Transfer-Encoding Header Field......... <a href="#page-10">10</a> |
| 4901 |
<a href="#section-5.1">5.1</a> Quoted-Printable Content-Transfer-Encoding......... <a href="#page-14">14</a> |
| 4902 |
<a href="#section-5.2">5.2</a> Base64 Content-Transfer-Encoding................... <a href="#page-17">17</a> |
| 4903 |
<a href="#section-6">6</a> Additional Optional Content- Header Fields......... <a href="#page-19">19</a> |
| 4904 |
<a href="#section-6.1">6.1</a> Optional Content-ID Header Field................... <a href="#page-19">19</a> |
| 4905 |
<a href="#section-6.2">6.2</a> Optional Content-Description Header Field.......... <a href="#page-19">19</a> |
| 4906 |
<a href="#section-7">7</a> The Predefined Content-Type Values................. <a href="#page-20">20</a> |
| 4907 |
<a href="#section-7.1">7.1</a> The Text Content-Type.............................. <a href="#page-20">20</a> |
| 4908 |
<a href="#section-7.1.1">7.1.1</a> The charset parameter.............................. <a href="#page-20">20</a> |
| 4909 |
<a href="#section-7.1.2">7.1.2</a> The Text/plain subtype............................. <a href="#page-23">23</a> |
| 4910 |
<a href="#section-7.1.3">7.1.3</a> The Text/richtext subtype.......................... <a href="#page-23">23</a> |
| 4911 |
<a href="#section-7.2">7.2</a> The Multipart Content-Type......................... <a href="#page-29">29</a> |
| 4912 |
<a href="#section-7.2.1">7.2.1</a> Multipart: The common syntax...................... <a href="#page-30">30</a> |
| 4913 |
<a href="#section-7.2.2">7.2.2</a> The Multipart/mixed (primary) subtype.............. <a href="#page-34">34</a> |
| 4914 |
<a href="#section-7.2.3">7.2.3</a> The Multipart/alternative subtype.................. <a href="#page-34">34</a> |
| 4915 |
<a href="#section-7.2.4">7.2.4</a> The Multipart/digest subtype....................... <a href="#page-36">36</a> |
| 4916 |
<a href="#section-7.2.5">7.2.5</a> The Multipart/parallel subtype..................... <a href="#page-36">36</a> |
| 4917 |
<a href="#section-7.3">7.3</a> The Message Content-Type........................... <a href="#page-37">37</a> |
| 4918 |
<a href="#section-7.3.1">7.3.1</a> The Message/rfc822 (primary) subtype............... <a href="#page-37">37</a> |
| 4919 |
<a href="#section-7.3.2">7.3.2</a> The Message/Partial subtype........................ <a href="#page-37">37</a> |
| 4920 |
<a href="#section-7.3.3">7.3.3</a> The Message/External-Body subtype.................. <a href="#page-40">40</a> |
| 4921 |
<a href="#section-7.4">7.4</a> The Application Content-Type....................... <a href="#page-46">46</a> |
| 4922 |
<a href="#section-7.4.1">7.4.1</a> The Application/Octet-Stream (primary) subtype..... <a href="#page-46">46</a> |
| 4923 |
<a href="#section-7.4.2">7.4.2</a> The Application/PostScript subtype................. <a href="#page-47">47</a> |
| 4924 |
<a href="#section-7.4.3">7.4.3</a> The Application/ODA subtype........................ <a href="#page-50">50</a> |
| 4925 |
<a href="#section-7.5">7.5</a> The Image Content-Type............................. <a href="#page-51">51</a> |
| 4926 |
<a href="#section-7.6">7.6</a> The Audio Content-Type............................. <a href="#page-51">51</a> |
| 4927 |
<a href="#section-7.7">7.7</a> The Video Content-Type............................. <a href="#page-51">51</a> |
| 4928 |
<a href="#section-7.8">7.8</a> Experimental Content-Type Values................... <a href="#page-51">51</a> |
| 4929 |
Summary............................................ <a href="#page-53">53</a> |
| 4930 |
Acknowledgements................................... <a href="#page-54">54</a> |
| 4931 |
<a href="#appendix-A">Appendix A</a> -- Minimal MIME-Conformance............. <a href="#page-56">56</a> |
| 4932 |
<a href="#appendix-B">Appendix B</a> -- General Guidelines For Sending Email Data59 |
| 4933 |
<a href="#appendix-C">Appendix C</a> -- A Complex Multipart Example.......... <a href="#page-62">62</a> |
| 4934 |
<a href="#appendix-D">Appendix D</a> -- A Simple Richtext-to-Text Translator in C64 |
| 4935 |
<a href="#appendix-E">Appendix E</a> -- Collected Grammar.................... <a href="#page-66">66</a> |
| 4936 |
<a href="#appendix-F">Appendix F</a> -- IANA Registration Procedures......... <a href="#page-68">68</a> |
| 4937 |
<a href="#appendix-F.1">F.1</a> Registration of New Content-type/subtype Values..68 |
| 4938 |
<a href="#appendix-F.2">F.2</a> Registration of New Character Set Values...... <a href="#page-69">69</a> |
| 4939 |
F.3 Registration of New Access-type Values for Message/external-body69 |
| 4940 |
F.4 Registration of New Conversions Values for Application69 |
| 4941 |
<a href="#appendix-G">Appendix G</a> -- Summary of the Seven Content-types... <a href="#page-71">71</a> |
| 4942 |
<a href="#appendix-H">Appendix H</a> -- Canonical Encoding Model............. <a href="#page-73">73</a> |
| 4943 |
References......................................... <a href="#page-75">75</a> |
| 4944 |
Security Considerations............................ <a href="#page-76">76</a> |
| 4945 |
Authors' Addresses................................. <a href="#page-77">77</a> |
| 4946 |
|
| 4947 |
|
| 4948 |
|
| 4949 |
<span class="grey"> Borenstein & Freed [Page ii]</span></pre> |
| 4950 |
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-iii" ></span> |
| 4951 |
<span class="grey"> Borenstein & Freed [Page iii]</span> |
| 4952 |
</pre> |