home *** CD-ROM | disk | FTP | other *** search
/ Magazyn WWW 1998 October / www_10_1998.iso / info / ogonki / rfc1341.txt < prev    next >
Text File  |  1998-09-09  |  211KB  |  5,262 lines

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