home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc2110 < prev    next >
Text File  |  1997-03-04  |  42KB  |  1,068 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          J. Palme
  8. Request for Comments: 2110                     Stockholm University/KTH
  9. Category: Standards Track                                    A. Hopmann
  10.                                                   Microsoft Corporation
  11.                                                              March 1997
  12.  
  13.  
  14.  MIME E-mail Encapsulation of Aggregate Documents, such as HTML (MHTML)
  15.  
  16. Status of this Document
  17.  
  18.    This document specifies an Internet standards track protocol for the
  19.    Internet community, and requests discussion and suggestions for
  20.    improvements.  Please refer to the current edition of the "Internet
  21.    Official Protocol Standards" (STD 1) for the standardization state
  22.    and status of this protocol.  Distribution of this memo is unlimited.
  23.  
  24. Abstract
  25.  
  26.    Although HTML [RFC 1866] was designed within the context of MIME,
  27.    more than the specification of HTML as defined in RFC 1866 is needed
  28.    for two electronic mail user agents to be able to interoperate using
  29.    HTML as a document format. These issues include the naming of objects
  30.    that are normally referred to by URIs, and the means of aggregating
  31.    objects that go together. This document describes a set of guidelines
  32.    that will allow conforming mail user agents to be able to send,
  33.    deliver and display these objects, such as HTML objects, that can
  34.    contain links represented by URIs. In order to be able to handle
  35.    inter-linked objects, the document uses the MIME type
  36.    multipart/related and specifies the MIME content-headers "Content-
  37.    Location" and "Content-Base".
  38.  
  39. Table of Contents
  40.  
  41.    1. Introduction..............................................  2
  42.    2. Terminology...............................................  3
  43.       2.1 Conformance requirement terminology...................  3
  44.       2.2 Other terminology.....................................  4
  45.    3. Overview..................................................  5
  46.    4. The Content-Location and Content-Base MIME Content Headers  6
  47.       4.1 MIME content headers..................................  6
  48.       4.2 The Content-Base header...............................  7
  49.       4.3 The Content-Location Header...........................  7
  50.       4.4 Encoding of URIs in e-mail headers....................  8
  51.    5. Base URIs for resolution of relative URIs.................  8
  52.    6. Sending documents without linked objects..................  9
  53.    7. Use of the Content-Type: Multipart/related................  9
  54.    8. Format of Links to Other Body Parts....................... 11
  55.  
  56.  
  57.  
  58. Palme & Hopmann             Standards Track                     [Page 1]
  59.  
  60. RFC 2110                         MHTML                        March 1997
  61.  
  62.  
  63.       8.1 General principle..................................... 11
  64.       8.2 Use of the Content-Location header.................... 11
  65.       8.3 Use of the Content-ID header and CID URLs............. 12
  66.    9 Examples................................................... 12
  67.       9.1 Example of a HTML body without included linked objects 12
  68.       9.2 Example with absolute URIs to an embedded GIF picture  13
  69.       9.3 Example with relative URIs to an embedded GIF picture  13
  70.       9.4 Example using CID URL and Content-ID header to an
  71.           embedded GIF picture.................................. 14
  72.    10. Content-Disposition header............................... 15
  73.    11. Character encoding issues and end-of-line issues......... 15
  74.    12. Security Considerations.................................. 16
  75.    13. Acknowledgments.......................................... 17
  76.    14. References............................................... 18
  77.    15. Author's Address......................................... 19
  78.  
  79. Mailing List Information
  80.  
  81.    Further discussion on this document should be done through the
  82.    mailing list MHTML@SEGATE.SUNET.SE.
  83.  
  84.    To subscribe to this list, send a message to
  85.       LISTSERV@SEGATE.SUNET.SE
  86.    which contains the text
  87.    SUB MHTML <your name (not your e-mail address)>
  88.  
  89.    Archives of this list are available by anonymous ftp from
  90.       FTP://SEGATE.SUNET.SE/lists/mHTML/
  91.    The archives are also available by e-mail. Send a message to
  92.    LISTSERV@SEGATE.SUNET.SE with the text "INDEX MHTML" to get a list
  93.    of the archive files, and then a new message "GET <file name>" to
  94.    retrieve the archive files.
  95.  
  96.    Comments on less important details may also be sent to the editor,
  97.    Jacob Palme <jpalme@dsv.su.se>.
  98.  
  99.    More information may also be available at URL:
  100.    HTTP://www.dsv.su.se/~jpalme/ietf/jp-ietf-home.HTML
  101.  
  102. 1. Introduction
  103.  
  104.    There are a number of document formats, HTML [HTML2], PDF [PDF] and
  105.    VRML for example, which provide links using URIs for their
  106.    resolution. There is an obvious need to be able to send documents in
  107.    these formats in e-mail [RFC821=SMTP, RFC822]. This document gives
  108.    additional specifications on how to send such documents in MIME [RFC
  109.    1521=MIME1] e-mail messages. This version of this standard was based
  110.    on full consideration only of the needs for objects with links in the
  111.  
  112.  
  113.  
  114. Palme & Hopmann             Standards Track                     [Page 2]
  115.  
  116. RFC 2110                         MHTML                        March 1997
  117.  
  118.  
  119.    Text/HTML media type (as defined in RFC 1866 [HTML2]), but the
  120.    standard may still be applicable also to other formats for sets of
  121.    interlinked objects, linked by URIs. There is no conformance
  122.    requirement that implementations claiming conformance to this
  123.    standard are able to handle URI-s in other document formats than
  124.    HTML.
  125.  
  126.    URIs in documents in HTML and other similar formats reference other
  127.    objects and resources, either embedded or directly accessible through
  128.    hypertext links. When mailing such a document, it is often desirable
  129.    to also mail all of the additional resources that are referenced in
  130.    it; those elements are necessary for the complete interpretation of
  131.    the primary object.
  132.  
  133.    An alternative way for sending an HTML document or other object
  134.    containing URIs in e-mail is to only send the URL, and let the
  135.    recipient look up the document using HTTP. That method is described
  136.    in [URLBODY] and is not described in this document.
  137.  
  138.    An informational RFC will at a later time be published as a
  139.    supplement to this standard. The informational RFC will discuss
  140.    implementation methods and some implementation problems. Implementors
  141.    are recommended to read this informational RFC when developing
  142.    implementations of the MHTML standard. This informational RFC is,
  143.    when this RFC is published, still in IETF draft status, and will stay
  144.    that way for at least six months in order to gain more implementation
  145.    experience before it is published.
  146.  
  147. 2. Terminology
  148.  
  149. 2.1 Conformance requirement terminology
  150.  
  151.    This specification uses the same words as RFC 1123 [HOSTS] for
  152.    defining the significance of each particular requirement. These words
  153.    are:
  154.  
  155.    MUST    This word or the adjective "required" means that the item is
  156.            an absolute requirement of the specification.
  157.  
  158.    SHOULD  This word or the adjective "recommended" means that there may
  159.            exist valid reasons in particular circumstances to ignore this
  160.            item, but the full implications should be understood and the
  161.            case carefully weighed before choosing a different course.
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170. Palme & Hopmann             Standards Track                     [Page 3]
  171.  
  172. RFC 2110                         MHTML                        March 1997
  173.  
  174.  
  175.    MAY     This word or the adjective "optional" means that this item is
  176.            truly optional. One vendor may choose to include the item
  177.            because a particular marketplace requires it or because it
  178.            enhances the product, for example; another vendor may omit
  179.            the same item.
  180.  
  181.    An implementation is not compliant if it fails to satisfy one or more
  182.    of the MUST requirements for the protocols it implements. An
  183.    implementation that satisfies all the MUST and all the SHOULD
  184.    requirements for its protocols is said to be "unconditionally
  185.    compliant"; one that satisfies all the MUST requirements but not all
  186.    the SHOULD requirements for its protocols is said to be
  187.    "conditionally compliant."
  188.  
  189. 2.2 Other terminology
  190.  
  191.    Most of the terms used in this document are defined in other RFCs.
  192.  
  193.    Absolute URI,         See RFC 1808 [RELURL].
  194.    AbsoluteURI
  195.  
  196.    CID                   See [MIDCID].
  197.  
  198.    Content-Base          See section 4.2 below.
  199.  
  200.    Content-ID            See [MIDCID].
  201.  
  202.    Content-Location      MIME message or content part header with the
  203.                          URI of the MIME message or content part body,
  204.                          defined in section 4.3 below.
  205.  
  206.    Content-Transfer-Enco Conversion of a text into 7-bit octets as
  207.    ding                  specified in [MIME1].
  208.  
  209.    CR                    See [RFC822].
  210.  
  211.    CRLF                  See [RFC822].
  212.  
  213.    Displayed text        The text shown to the user reading a document
  214.                          with a web browser. This may be different from
  215.                          the HTML markup, see the definition of HTML
  216.                          markup below.
  217.  
  218.    Header                Field in a message or content heading specifying
  219.                          the value of one attribute.
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Palme & Hopmann             Standards Track                     [Page 4]
  227.  
  228. RFC 2110                         MHTML                        March 1997
  229.  
  230.  
  231.    Heading               Part of a message or content before the first
  232.                          CRLFCRLF, containing formatted fields with
  233.                          attributes of the message or content.
  234.  
  235.    HTML                  See RFC 1866 [HTML2].
  236.  
  237.    HTML Aggregate        HTML objects together with some or all objects,
  238.                          to objects which the HTML object contains
  239.                          hyperlinks.
  240.  
  241.    HTML markup           A file containing HTML encodings as specified
  242.                          in [HTML] which may be different from the
  243.                          displayed text which a person using a web
  244.                          browser sees. For example, the HTML markup
  245.                          may contain "<" where the displayed text
  246.                          contains the character "<".
  247.  
  248.    LF                    See [RFC822].
  249.  
  250.    MIC                   Message Integrity Codes, codes use to verify
  251.                          that a  message has not been modified.
  252.  
  253.    MIME                  See RFC 1521 [MIME1], [MIME2].
  254.  
  255.    MUA                   Messaging User Agent.
  256.  
  257.    PDF                   Portable Document Format, see [PDF].
  258.  
  259.    Relative URI,         See RFC 1866 [HTML2] and RFC 1808[RELURL].
  260.    RelativeURI
  261.  
  262.    URI, absolute and     See RFC 1866 [HTML2].
  263.    relative
  264.  
  265.    URL                   See RFC 1738 [URL].
  266.  
  267.    URL, relative         See [RELURL].
  268.  
  269.    VRML                  Virtual Reality Markup Language.
  270.  
  271. 3. Overview
  272.  
  273.    An aggregate document is a MIME-encoded message that contains a root
  274.    document as well as other data that is required in order to represent
  275.    that document (inline pictures, style sheets, applets, etc.).
  276.    Aggregate documents can also include additional elements that are
  277.    linked to the first object.  It is important to keep in mind the
  278.    differing needs of several audiences. Mail sending agents might send
  279.  
  280.  
  281.  
  282. Palme & Hopmann             Standards Track                     [Page 5]
  283.  
  284. RFC 2110                         MHTML                        March 1997
  285.  
  286.  
  287.    aggregate documents as an encoding of normal day-to-day electronic
  288.    mail. Mail sending agents might also send aggregate documents when a
  289.    user wishes to mail a particular document from the web to someone
  290.    else. Finally mail sending agents might send aggregate documents as
  291.    automatic responders, providing access to WWW resources for non-IP
  292.    connected clients.
  293.  
  294.    Mail receiving agents also have several differing needs. Some mail
  295.    receiving agents might be able to receive an aggregate document and
  296.    display it just as any other text content type would be displayed.
  297.    Others might have to pass this aggregate document to a browsing
  298.    program, and provisions need to be made to make this possible.
  299.  
  300.    Finally several other constraints on the problem arise. It is
  301.    important that it be possible for a document to be signed and for it
  302.    to be able to be transmitted to a client and displayed with a minimum
  303.    risk of breaking the message integrity (MIC) check that is part of
  304.    the signature.
  305.  
  306. 4. The Content-Location and Content-Base MIME Content Headers
  307.  
  308. 4.1 MIME content headers
  309.  
  310.    In order to resolve URI references to other body parts, two MIME
  311.    content headers are defined, Content-Location and Content-Base. Both
  312.    these headers can occur in any message or content heading, and will
  313.    then be valid within this heading and for its content.
  314.  
  315.    In practice, at present only those URIs which are URLs are used, but
  316.    it is anticipated that other forms of URIs will in the future be
  317.    used.
  318.  
  319.    The syntax for these headers is, using the syntax definition tools
  320.    from [RFC822]:
  321.  
  322.        content-location ::= "Content-Location:" ( absoluteURI |
  323.                             relativeURI )
  324.  
  325.        content-base ::= "Content-Base:" absoluteURI
  326.  
  327.    where URI is at present (June 1996) restricted to the syntax for URLs
  328.    as defined in RFC 1738 [URL].
  329.  
  330.    These two headers are valid only for exactly the content heading or
  331.    message heading where they occurs and its text. They are thus not
  332.    valid for the parts inside multipart headings, and are thus
  333.    meaningless in multipart headings.
  334.  
  335.  
  336.  
  337.  
  338. Palme & Hopmann             Standards Track                     [Page 6]
  339.  
  340. RFC 2110                         MHTML                        March 1997
  341.  
  342.  
  343.    These two headers may occur both inside and outside of a
  344.    multipart/related part.
  345.  
  346. 4.2 The Content-Base header
  347.  
  348.    The Content-Base gives a base for relative URIs occurring in other
  349.    heading fields and in HTML documents which do not have any BASE
  350.    element in its HTML code. Its value MUST be an absolute URI.
  351.  
  352.    Example showing which Content-Base is valid where:
  353.  
  354.     Content-Type: Multipart/related; boundary="boundary-example-1";
  355.                   type=Text/HTML; start=foo2*foo3@bar2.net
  356.      ; A Content-Base header cannot be placed here, since this is a
  357.      ; multipart MIME object.
  358.  
  359.     --boundary-example-1
  360.  
  361.     Part 1:
  362.     Content-Type: Text/HTML; charset=US-ASCII
  363.     Content-ID: <foo2*foo3@bar2.net>
  364.     Content-Location: http://www.ietf.cnir.reston.va.us/images/foo1.bar1
  365.     ;  This Content-Location must contain an absolute URI, since no base
  366.     ;  is valid here.
  367.  
  368.     --boundary-example-1
  369.  
  370.     Part 2:
  371.     Content-Type: Text/HTML; charset=US-ASCII
  372.     Content-ID: <foo4*foo5@bar2.net>
  373.     Content-Location: foo1.bar1   ; The Content-Base below applies to
  374.                                   ; this relative URI
  375.     Content-Base: http://www.ietf.cnri.reston.va.us/images/
  376.  
  377.     --boundary-example-1--
  378.  
  379. 4.3 The Content-Location Header
  380.  
  381.    The Content-Location header specifies the URI that corresponds to the
  382.    content of the body part in whose heading the header is placed. Its
  383.    value CAN be an absolute or relative URI. Any URI or URL scheme may
  384.    be used, but use of non-standardized URI or URL schemes might entail
  385.    some risk that recipients cannot handle them correctly.
  386.  
  387.    The Content-Location header can be used to indicate that the data
  388.    sent under this heading is also retrievable, in identical format,
  389.    through normal use of this URI. If used for this purpose, it must
  390.    contain an absolute URI or be resolvable, through a Content-Base
  391.  
  392.  
  393.  
  394. Palme & Hopmann             Standards Track                     [Page 7]
  395.  
  396. RFC 2110                         MHTML                        March 1997
  397.  
  398.  
  399.    header, into an absolute URI. In this case, the information sent in
  400.    the message can be seen as a cached version of the original data.
  401.  
  402.    The header can also be used for data which is not available to some
  403.    or all recipients of the message, for example if the header refers to
  404.    an object which is only retrievable using this URI in a restricted
  405.    domain, such as within a company-internal web space. The header can
  406.    even contain a fictious URI and need in that case not be globally
  407.    unique.
  408.  
  409.    Example:
  410.  
  411.    Content-Type: Multipart/related; boundary="boundary-example-1";
  412.                     type=Text/HTML
  413.  
  414.       --boundary-example-1
  415.  
  416.       Part 1:
  417.       Content-Type: Text/HTML; charset=US-ASCII
  418.  
  419.       ... ... <IMG SRC="fiction1/fiction2"> ... ...
  420.  
  421.       --boundary-example-1
  422.  
  423.       Part 2:
  424.       Content-Type: Text/HTML; charset=US-ASCII
  425.       Content-Location: fiction1/fiction2
  426.  
  427.       --boundary-example-1--
  428.  
  429. 4.4 Encoding of URIs in e-mail headers
  430.  
  431.    Since MIME header fields have a limited length and URIs can get quite
  432.    long, these lines may have to be folded. If such folding is done, the
  433.    algorithm defined in [URLBODY] section 3.1 should be employed.
  434.  
  435. 5. Base URIs for resolution of relative URIs
  436.  
  437.    Relative URIs inside contents of MIME body parts are resolved
  438.    relative to a base URI. In order to determine this base URI, the
  439.    first-applicable method in the following list applies.
  440.  
  441.      (a) There is a base specification inside the MIME body part
  442.           containing the link which resolves relative URIs into absolute
  443.           URIs. For example, HTML provides the BASE element for this.
  444.  
  445.      (b) There is a Content-Base header (as defined in section 4.2),
  446.           specifying the base to be used.
  447.  
  448.  
  449.  
  450. Palme & Hopmann             Standards Track                     [Page 8]
  451.  
  452. RFC 2110                         MHTML                        March 1997
  453.  
  454.  
  455.      (c) There is a Content-Location header in the heading of the body
  456.           part which can then serve as the base in the same way as the
  457.           requested URI can serve as a base for relative URIs within a
  458.           file retrieved via HTTP [HTTP].
  459.  
  460.    When the methods above do not yield an absolute URI the procedure in
  461.    section 8.2 for matching relative URIs MUST be followed.
  462.  
  463. 6. Sending documents without linked objects
  464.  
  465.    If a document, such as an HTML object, is sent without other objects,
  466.    to which it is linked, it MAY be sent as a Text/HTML body part by
  467.    itself.  In this case, multipart/related need not be used.
  468.  
  469.    Such a document may either not include any links, or contain links
  470.    which the recipient resolves via ordinary net look up, or contain
  471.    links which the recipient cannot resolve.
  472.  
  473.    Inclusion of links which the recipient has to look up through the net
  474.    may not work for some recipients, since all e-mail recipients do not
  475.    have full internet connectivity. Also, such links may work for the
  476.    sender but not for the recipient, for example when the link refers to
  477.    an URI within a company-internal network not accessible from outside
  478.    the company.
  479.  
  480.    Note that documents with links that the recipient cannot resolve MAY
  481.    be sent, although this is discouraged. For example, two persons
  482.    developing a new HTML page may exchange incomplete versions.
  483.  
  484. 7. Use of the Content-Type: Multipart/related
  485.  
  486.    If a message contains one or more MIME body parts containing links
  487.    and also contains as separate body parts, data, to which these links
  488.    (as defined, for example, in RFC 1866 [HTML2]) refers, then this
  489.    whole set of body parts (referring body parts and referred-to body
  490.    parts) SHOULD be sent within a multipart/related body part as defined
  491.    in [REL].
  492.  
  493.    The root body part of the multipart/related SHOULD be the start
  494.    object for rendering the object, such as a text/html object, and
  495.    which contains links to objects in other body parts, or a
  496.    multipart/alternative of which at least one alternative resolves to
  497.    such a start object.  Implementors are warned, however, that many
  498.    mail programs treat multipart/alternative as if it had been
  499.    multipart/mixed (even though MIME [MIME1] requires support for
  500.    multipart/alternative).
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Palme & Hopmann             Standards Track                     [Page 9]
  507.  
  508. RFC 2110                         MHTML                        March 1997
  509.  
  510.  
  511.    [REL] requires that the type attribute of the "Content-Type:
  512.    Multipart/related" statement be the type of the root object, and this
  513.    value can thus be "multipart/alternative". If the root is not the
  514.    first body part within the multipart/related, [REL] further requires
  515.    that its Content-ID MUST be given in a start parameter to the
  516.    "Content-Type: Multipart/related" header.
  517.  
  518.    When presenting the root body part to the user, the additional body
  519.    parts within the multipart/related can be used:
  520.  
  521.        (a) For those recipients who only have e-mail but not full
  522.            Internet access.
  523.  
  524.        (b) For those recipients who for other reasons, such as firewalls
  525.            or the use of company-internal links, cannot retrieve the
  526.            linked body parts through the net.
  527.  
  528.           Note that this means that you can, via e-mail, send HTML which
  529.            includes URIs which the recipient cannot resolve via HTTPor
  530.            other connectivity-requiring URIs.
  531.  
  532.        (c) For items which are not available on the web.
  533.  
  534.        (d) For any recipient to speed up access.
  535.  
  536.    The type parameter of the "Content-Type: Multipart/related" MUST be
  537.    the same as the Content-Type of its root.
  538.  
  539.    When a sending MUA sends objects which were retrieved from the WWW,
  540.    it SHOULD maintain their WWW URIs. It SHOULD not transform these URIs
  541.    into some other URI form prior to transmitting them. This will allow
  542.    the receiving MUA to both verify MICs included with the email
  543.    message, as well as verify the documents against their WWW
  544.    counterpoints.
  545.  
  546.    In certain special cases this will not work if the original HTML
  547.    document contains URIs as parameters to objects and applets. In such
  548.    a case, it might be better to rewrite the document before sending it.
  549.    This problem is discussed in more detail in the informational RFC
  550.    which will be published as a supplement to this standard.
  551.  
  552.    This standard does not cover the case where a multipart/related
  553.    contains links to MIME body parts outside of the current
  554.    multipart/related or in other MIME messages, even if methods similar
  555.    to those described in this standard are used. Implementors who
  556.    provide such links are warned that mailers implementing this standard
  557.    may not be able to resolve such links.
  558.  
  559.  
  560.  
  561.  
  562. Palme & Hopmann             Standards Track                    [Page 10]
  563.  
  564. RFC 2110                         MHTML                        March 1997
  565.  
  566.  
  567.    Within such a multipart/related, ALL different parts MUST have
  568.    different Content-Location or Content-ID values.
  569.  
  570. 8. Format of Links to Other Body Parts
  571.  
  572. 8.1 General principle
  573.  
  574.    A body part, such as a text/HTML body part, may contain hyperlinks to
  575.    objects which are included as other body parts in the same message
  576.    and within the same multipart/related content. Often such linked
  577.    objects are meant to be displayed inline to the reader of the main
  578.    document; for example, objects referenced with the IMG tag in HTML
  579.    [RFC 1866=HTML2].  New tags with this property are proposed in the
  580.    ongoing development of HTML (example: applet, frame).
  581.  
  582.    In order to send such messages, there is a need to indicate which
  583.    other body parts are referred to by the links in the body parts
  584.    containing such links. For example, a body part of Content-Type:
  585.    Text/HTML often has links to other objects, which might be included
  586.    in other body parts in the same MIME message. The referencing of
  587.    other body parts is done in the following way: For each body part
  588.    containing links and each distinct URI within it, which refers to
  589.    data which is sent in the same MIME message, there SHOULD be a
  590.    separate body part within the current multipart/related part of the
  591.    message containing this data. Each such body part SHOULD contain a
  592.    Content-Location header (see section 8.2) or a Content-ID header (see
  593.    section 8.3).
  594.  
  595.    An e-mail system which claims conformance to this standard MUST
  596.    support receipt of multipart/related (as defined in section 7) with
  597.    links between body parts using both the Content-Location (as defined
  598.    in section 8.2) and the Content-ID method (as defined in section
  599.    8.3).
  600.  
  601. 8.2 Use of the Content-Location header
  602.  
  603.    If there is a Content-Base header, then the recipient MUST employ
  604.    relative to absolute resolution as defined in RFC 1808 [RELURL] of
  605.    relative URIs in both the HTML markup and the Content-Location header
  606.    before matching a hyperlink in the HTML markup to a Content-Location
  607.    header. The same applies if the Content-Location contains an absolute
  608.    URI, and the HTML markup contains a BASE element so that relative
  609.    URIs in the HTML markup can be resolved.
  610.  
  611.    If there is NO Content-Base header, and the Content-Location header
  612.    contains a relative URI, then NO relative to absolute resolution
  613.    SHOULD be performed. Matching the relative URI in the Content-
  614.    Location header to a hyperlink in an HTML markup text is in this case
  615.  
  616.  
  617.  
  618. Palme & Hopmann             Standards Track                    [Page 11]
  619.  
  620. RFC 2110                         MHTML                        March 1997
  621.  
  622.  
  623.    a two step process. First remove any LWSP from the relative URI which
  624.    may have been introduced as described in section 4.4. Then perform an
  625.    exact textual match against the HTML URIs. For this matching process,
  626.    ignore BASE specifications, such as the BASE element in HTML. Note
  627.    that this only applies for matching Content-Location headers, not for
  628.    URL-s in the HTML document which are resolved through network look up
  629.    at read time.
  630.  
  631.    The URI in the Content-Location header need not refer to an object
  632.    which is actually available globally for retrieval using this URI
  633.    (after resolution of relative URIs). However, URI-s in Content-
  634.    Location headers (if absolute, or resolvable to absolute URIs) SHOULD
  635.    still be globally unique.
  636.  
  637. 8.3 Use of the Content-ID header and CID URLs
  638.  
  639.    When CID (Content-ID) URLs as defined in RFC 1738 [URL] and RFC 1873
  640.    [MIDCID] are used for links between body parts, the Content-Location
  641.    statement will normally be replaced by a Content-ID header. Thus, the
  642.    following two headers are identical in meaning:
  643.  
  644.    Content-ID: foo@bar.net
  645.    Content-Location: CID: foo@bar.net
  646.  
  647.    Note: Content-IDs MUST be globally unique [MIME1]. It is thus not
  648.    permitted to make them unique only within this message or within this
  649.    multipart/related.
  650.  
  651. 9 Examples
  652.  
  653. 9.1 Example of a HTML body without included linked objects
  654.  
  655.    The first example is the simplest form of an HTML email message. This
  656.    is not an aggregate HTML object, but simply a message with a single
  657.    HTML body part. This message contains a hyperlink but does not
  658.    provide the ability to resolve the hyperlink. To resolve the
  659.    hyperlink the receiving client would need either IP access to the
  660.    Internet, or an electronic mail web gateway.
  661.  
  662.       From: foo1@bar.net
  663.       To: foo2@bar.net
  664.       Subject: A simple example
  665.       Mime-Version: 1.0
  666.       Content-Type: Text/HTML; charset=US-ASCII
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674. Palme & Hopmann             Standards Track                    [Page 12]
  675.  
  676. RFC 2110                         MHTML                        March 1997
  677.  
  678.  
  679.       <HTML>
  680.       <head></head>
  681.       <body>
  682.       <h1>Hi there!</h1>
  683.       An example of an HTML message.<p>
  684.       Try clicking <a href="http://www.resnova.com/">here.</a><p>
  685.       </body></HTML>
  686.  
  687. 9.2 Example with absolute URIs to an embedded GIF picture
  688.  
  689.     From: foo1@bar.net
  690.     To: foo2@bar.net
  691.     Subject: A simple example
  692.     Mime-Version: 1.0
  693.     Content-Type: Multipart/related; boundary="boundary-example-1";
  694.                   type=Text/HTML; start=foo3*foo1@bar.net
  695.  
  696.     --boundary-example-1
  697.        Content-Type: Text/HTML;charset=US-ASCII
  698.        Content-ID: <foo3*foo1@bar.net>
  699.  
  700.        ... text of the HTML document, which might contain a hyperlink
  701.        to the other body part, for example through a statement such as:
  702.        <IMG SRC="http://www.ietf.cnri.reston.va.us/images/ietflogo.gif"
  703.         ALT="IETF logo">
  704.  
  705.     --boundary-example-1
  706.        Content-Location:
  707.              http://www.ietf.cnri.reston.va.us/images/ietflogo.gif
  708.        Content-Type: IMAGE/GIF
  709.        Content-Transfer-Encoding: BASE64
  710.  
  711.        R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
  712.        NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaGliaXRlZC4A
  713.        etc...
  714.  
  715.     --boundary-example-1--
  716.  
  717. 9.3 Example with relative URIs to an embedded GIF picture
  718.  
  719.       From: foo1@bar.net
  720.       To: foo2@bar.net
  721.       Subject: A simple example
  722.       Mime-Version: 1.0
  723.       Content-Base: http://www.ietf.cnri.reston.va.us
  724.       Content-Type: Multipart/related; boundary="boundary-example-1";
  725.                     type=Text/HTML
  726.  
  727.  
  728.  
  729.  
  730. Palme & Hopmann             Standards Track                    [Page 13]
  731.  
  732. RFC 2110                         MHTML                        March 1997
  733.  
  734.  
  735.       --boundary-example-1
  736.          Content-Type: Text/HTML; charset=ISO-8859-1
  737.          Content-Transfer-Encoding: QUOTED-PRINTABLE
  738.  
  739.          ... text of the HTML document, which might contain a hyperlink
  740.          to the other body part, for example through a statement such as:
  741.          <IMG SRC="/images/ietflogo.gif" ALT="IETF logo">
  742.          Example of a copyright sign encoded with Quoted-Printable: =A9
  743.          Example of a copyright sign mapped onto HTML markup: ¨
  744.  
  745.       --boundary-example-1
  746.          Content-Location: /images/ietflogo.gif
  747.          Content-Type: IMAGE/GIF
  748.          Content-Transfer-Encoding: BASE64
  749.  
  750.          R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
  751.          NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaGliaXRlZC4A
  752.          etc...
  753.  
  754.       --boundary-example-1--
  755.  
  756. 9.4 Example using CID URL and Content-ID header to an embedded GIF
  757.    picture
  758.  
  759.       From: foo1@bar.net
  760.       To: foo2@bar.net
  761.       Subject: A simple example
  762.       Mime-Version: 1.0
  763.       Content-Type: Multipart/related; boundary="boundary-example-1";
  764.                     type=Text/HTML
  765.  
  766.       --boundary-example-1
  767.          Content-Type: Text/HTML; charset=US-ASCII
  768.  
  769.          ... text of the HTML document, which might contain a hyperlink
  770.          to the other body part, for example through a statement such as:
  771.          <IMG SRC="cid:foo4*foo1@bar.net" ALT="IETF logo">
  772.  
  773.       --boundary-example-1
  774.          Content-ID: <foo4*foo1@bar.net>
  775.          Content-Type: IMAGE/GIF
  776.          Content-Transfer-Encoding: BASE64
  777.  
  778.          R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
  779.          NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaGliaXRlZC4A
  780.          etc...
  781.  
  782.       --boundary-example-1--
  783.  
  784.  
  785.  
  786. Palme & Hopmann             Standards Track                    [Page 14]
  787.  
  788. RFC 2110                         MHTML                        March 1997
  789.  
  790.  
  791. 10. Content-Disposition header
  792.  
  793.    Note the specification in [REL] on the relations between Content-
  794.    Disposition and multipart/related.
  795.  
  796. 11. Character encoding issues and end-of-line issues
  797.  
  798.    For the encoding of characters in HTML documents and other text
  799.    documents into a MIME-compatible octet stream, the following
  800.    mechanisms are relevant:
  801.  
  802.    - HTML [HTML2, HTML-I18N] as an application of SGML [SGML] allows
  803.      characters to be denoted by character entities as well as by numeric
  804.      character references (e.g. "Latin small letter a with acute accent"
  805.      may be represented by "á" or "á") in the HTML markup.
  806.  
  807.    - HTML documents, in common with other documents of the MIME
  808.      "Content-Type  text", can be represented in MIME using one of
  809.      several character encodings. The MIME Content-Type "charset"
  810.      parameter value indicates the particular encoding used. For the
  811.      exact meaning and use of the "charset" parameter, please see
  812.      [MIME-IMB section 4.2].
  813.  
  814.       Note that the "charset" parameter refers only to the MIME
  815.       character encoding. For example, the string "á" can be sent
  816.       in MIME with "charset=US-ASCII", while the raw character "Latin
  817.       small letter a with acute accent" cannot.
  818.  
  819.    The above mechanisms are well defined and documented, and therefore
  820.    not further explained here. In sending a message, all the above
  821.    mentioned mechanisms MAY be used, and any mixture of them MAY occur
  822.    when sending the document via e-mail. Receiving mail user agents
  823.    (together with any Web browser they may use to display the document)
  824.    MUST be capable of handling any combinations of these mechanisms.
  825.  
  826.    Also note that:
  827.  
  828.    - Any documents including HTML documents that contain octet values
  829.      outside the 7-bit range need a content-transfer-encoding applied
  830.      before transmission over certain transport protocols
  831.      [MIME1, chapter 5].
  832.  
  833.    - The MIME standard [MIME1] requires that documents of "Content-Type:
  834.      Text MUST be in canonical form before Content-Transfer-Encoding,
  835.      i.e. that line breaks are encoded as CRLFs, not as bare CRs or bare
  836.      LFs or something else. This is in contrast to [HTTP] where section
  837.      3.6.1 allows other representations of line breaks.
  838.  
  839.  
  840.  
  841.  
  842. Palme & Hopmann             Standards Track                    [Page 15]
  843.  
  844. RFC 2110                         MHTML                        March 1997
  845.  
  846.  
  847.    Note that this might cause problems with integrity checks based on
  848.    checksums, which might not be preserved when moving a document from
  849.    the HTTP to the MIME environment. If a document has to be converted
  850.    in such a way that a checksum integrity check becomes invalid, then
  851.    this integrity check header SHOULD be removed from the document.
  852.  
  853.    Other sources of problems are Content-Encoding used in HTTP but not
  854.    allowed in MIME, and charsets that are not able to represent line
  855.    breaks as CRLF. A good overview of the differences between HTTP and
  856.    MIME with regards to "Content-Type: Text" can be found in [HTTP],
  857.    appendix C.
  858.  
  859.    If the original document has line breaks in the canonical form
  860.    (CRLF), then the document SHOULD remain unconverted so that integrity
  861.    check sums are not invalidated.
  862.  
  863.    A provider of HTML documents who wants his documents to be
  864.    transferable via both HTTP and SMTP without invalidating checksum
  865.    integrity checks, should always provide original documents in the
  866.    canonical form with CRLF for line breaks.
  867.  
  868.    Some transport mechanisms may specify a default "charset" parameter
  869.    if none is supplied [HTTP, MIME1]. Because the default differs for
  870.    different mechanisms, when HTML is transferred through mail, the
  871.    charset parameter SHOULD be included, rather than relying on the
  872.    default.
  873.  
  874. 12. Security Considerations
  875.  
  876.    Some Security Considerations include the potential to mail someone an
  877.    object, and claim that it is represented by a particular URI (by
  878.    giving it a Content-Location header). There can be no assurance that
  879.    a WWW request for that same URI would normally result in that same
  880.    object. It might be unsuitable to cache the data in such a way that
  881.    the cached data can be used for retrieval of this URI from other
  882.    messages or message parts than those included in the same message as
  883.    the Content-Location header. Because of this problem, receiving User
  884.    Agents SHOULD not cache this data in the same way that data that was
  885.    retrieved through an HTTP or FTP request might be cached.
  886.  
  887.    URLs, especially File URLs, may in their name contain company-
  888.    internal information, which may then inadvertently be revealed to
  889.    recipients of documents containing such URLs.
  890.  
  891.    One way of implementing messages with linked body parts is to handle
  892.    the linked body parts in a combined mail and WWW proxy server. The
  893.    mail client is only given the start body part, which it passes to a
  894.    web browser. This web browser requests the linked parts from the
  895.  
  896.  
  897.  
  898. Palme & Hopmann             Standards Track                    [Page 16]
  899.  
  900. RFC 2110                         MHTML                        March 1997
  901.  
  902.  
  903.    proxy server. If this method is used, and if the combined server is
  904.    used by more than one user, then methods must be employed to ensure
  905.    that body parts of a message to one person is not retrievable by
  906.    another person.  Use of passwords (also known as tickets or magic
  907.    cookies) is one way of achieving this. Note that some caching WWW
  908.    proxy servers may not distinguish between cached objects from e-mail
  909.    and HTTP, which may be a security risk.
  910.  
  911.    In addition, by allowing people to mail aggregate objects, we are
  912.    opening the door to other potential security problems that until now
  913.    were only problems for WWW users. For example, some HTML documents
  914.    now either themselves contain executable content (JavaScript) or
  915.    contain links to executable content (The "INSERT" specification,
  916.    Java). It would be exceedingly dangerous for a receiving User Agent
  917.    to execute content received through a mail message without careful
  918.    attention to restrictions on the capabilities of that executable
  919.    content.
  920.  
  921.    Some WWW applications hide passwords and tickets (access tokens to
  922.    information which may not be available to anyone) and other sensitive
  923.    information in hidden fields in the web documents or in on-the-fly
  924.    constructed URLs. If a person gets such a document, and forwards it
  925.    via e-mail, the person may inadvertently disclose sensitive
  926.    information.
  927.  
  928. 13. Acknowledgments
  929.  
  930.    Harald T. Alvestrand, Richard Baker, Dave Crocker, Martin J. Duerst,
  931.    Lewis Geer, Roy Fielding, Al Gilman, Paul Hoffman, Richard W.
  932.    Jesmajian, Mark K. Joseph, Greg Herlihy, Valdis Kletnieks, Daniel
  933.    LaLiberte, Ed Levinson, Jay Levitt, Albert Lunde, Larry Masinter,
  934.    Keith Moore, Gavin Nicol, Pete Resnick, Jon Smirl, Einar Stefferud,
  935.    Jamie Zawinski, Steve Zilles and several other people have helped us
  936.    with preparing this document. I alone take responsibility for any
  937.    errors which may still be in the document.
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. Palme & Hopmann             Standards Track                    [Page 17]
  955.  
  956. RFC 2110                         MHTML                        March 1997
  957.  
  958.  
  959. 14. References
  960.  
  961. Ref.            Author, title
  962. ---------       --------------------------------------------------------
  963.  
  964. [CONDISP]       R. Troost, S. Dorner: "Communicating Presentation
  965.                 Information in Internet Messages: The
  966.                 Content-Disposition Header", RFC 1806, June 1995.
  967.  
  968. [HOSTS]         R. Braden (editor): "Requirements for Internet Hosts --
  969.                 Application and Support", STD-3, RFC 1123, October 1989.
  970.  
  971. [HTML-I18N]     F. Yergeau, G. Nicol, G. Adams, & M. Duerst:
  972.                 "Internationalization  of the Hypertext Markup
  973.                 Language". RFC 2070, January 1997.
  974.  
  975. [HTML2]         T. Berners-Lee, D. Connolly: "Hypertext Markup Language
  976.                 - 2.0", RFC 1866, November 1995.
  977.  
  978. [HTTP]          T. Berners-Lee, R. Fielding, H. Frystyk: Hypertext
  979.                 Transfer Protocol -- HTTP/1.0. RFC 1945, May 1996.
  980.  
  981. [MD5]           R. Rivest: "The MD5 Message-Digest Algorithm", RFC 1321,
  982.                 April 1992.
  983.  
  984. [MIDCID]        E. Levinson: "Content-ID and Message-ID Uniform
  985.                 Resource Locators". RFC 2111, February 1997.
  986.  
  987. [MIME-IMB]      N. Freed & N. Borenstein: "Multipurpose Internet Mail
  988.                 Extensions (MIME) Part One: Format of Internet Message
  989.                 Bedies". RFC 2045, November 1996.
  990.  
  991. [MIME1]         N. Borenstein & N. Freed: "MIME (Multipurpose Internet
  992.                 Mail Extensions) Part One: Mechanisms for Specifying and
  993.                 Describing the Format of Internet Message Bodies", RFC
  994.                 1521, Sept 1993.
  995.  
  996. [MIME2]         N. Borenstein & N. Freed: "Multipurpose Internet Mail
  997.                 Extensions (MIME) Part Two: Media Types". RFC 2046,
  998.                 November 1996.
  999.  
  1000. [NEWS]          M.R. Horton, R. Adams: "Standard for interchange of
  1001.                 USENET messages", RFC 1036, December 1987.
  1002.  
  1003.  
  1004.  
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Palme & Hopmann             Standards Track                    [Page 18]
  1011.  
  1012. RFC 2110                         MHTML                        March 1997
  1013.  
  1014.  
  1015. [PDF]           Bienz, T., Cohn, R. and Meehan, J.: "Portable Document
  1016.                 Format Reference Manual, Version 1.1", Adboe Systems
  1017.                 Inc.
  1018.  
  1019. [REL]           Edward Levinson: "The MIME Multipart/Related Content-
  1020.                 Type". RFC 2112, February 1997.
  1021.  
  1022. [RELURL]        R. Fielding: "Relative Uniform Resource Locators", RFC
  1023.                 1808, June 1995.
  1024.  
  1025. [RFC822]        D. Crocker: "Standard for the format of ARPA Internet
  1026.                 text messages." STD 11, RFC 822, August 1982.
  1027.  
  1028. [SGML]          ISO 8879. Information Processing -- Text and Office  -
  1029.                 Standard Generalized Markup Language (SGML),
  1030.                 1986. <URL:http://www.iso.ch/cate/d16387.html>
  1031.  
  1032. [SMTP]          J. Postel: "Simple Mail Transfer Protocol", STD 10, RFC
  1033.                 821, August 1982.
  1034.  
  1035. [URL]           T. Berners-Lee, L. Masinter, M. McCahill: "Uniform
  1036.                 Resource Locators (URL)", RFC 1738, December 1994.
  1037.  
  1038. [URLBODY]       N. Freed and Keith Moore: "Definition of the URL MIME
  1039.                 External-Body Access-Type", RFC 2017, October 1996.
  1040.  
  1041. 15. Author's Address
  1042.  
  1043.    For contacting the editors, preferably write to Jacob Palme rather
  1044.    than Alex Hopmann.
  1045.  
  1046.    Jacob Palme                          Phone: +46-8-16 16 67
  1047.    Stockholm University and KTH         Fax: +46-8-783 08 29
  1048.    Electrum 230                         E-mail: jpalme@dsv.su.se
  1049.    S-164 40 Kista, Sweden
  1050.  
  1051.    Alex Hopmann                         E-mail: alexhop@microsoft.com
  1052.    Microsoft Corporation
  1053.    3590 North First Street
  1054.    Suite 300
  1055.    San Jose
  1056.    CA 95134
  1057.    Working group chairman:
  1058.  
  1059.    Einar Stefferud <stef@nma.com>
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065.  
  1066. Palme & Hopmann             Standards Track                    [Page 19]
  1067.  
  1068.