home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / r / rfc1341.zip / RFC1341.TXT < prev   
Text File  |  1993-01-17  |  216KB  |  5,259 lines

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