home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_j_p / draft-ietf-mhtml-rev-00.txt < prev    next >
Text File  |  1997-07-07  |  44KB  |  1,071 lines

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