<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>

<!--
     ASCII to XML transformation by Invisible Worlds, Inc.
     http://invisible.net/
     Last transformation: 03-Feb-1999, 02:03:52

     Cannonical version of this document is at:
     http://info.internet.isi.edu/in-notes/rfc/files/rfc2111.txt

     Implementors should verify all content with
     cannonical version.  Failure to do so may result in
     protocol failures.
-->

<rfc number="2111"
     category="std">
<front>
<title abbrev="CID and MID URLs">Content-ID and Message-ID Uniform Resource Locators</title>
<author initials="E." surname="Levinson" fullname="Edward Levinson">
<organization/>
<address>
<postal>
<street>47 Clive Street</street>
<street>Metuchen</street>
<street>NJ  08840-1060</street>
<country>USA</country>
</postal>
<phone>+1 908 549 3716</phone>
<email>XIson@cnj.digex.net</email>
</address>
</author>
<date month="March" year="1997"/>
<area>Applications</area>
<keyword>content-type</keyword>
<keyword>encapsulate</keyword>
<keyword>hypertext markup language</keyword>
<keyword>multipurpose internet mail extensions</keyword>
<keyword>uniform resource</keyword>
<abstract>
<t>
   The Uniform Resource Locator (URL) schemes, &quot;cid:&quot; and &quot;mid:&quot; allow
   references to messages and the body parts of messages.  For example,
   within a single multipart message, one HTML body part might include
   embedded references to other parts of the same message.
</t>
</abstract>
</front>
<middle>
<!-- RFC original section: (1.) -->
<section title="Introduction">
<t>
   The use of <xref target="_XREF_MIME"/> within email to convey Web pages and their
   associated images requires a URL scheme to permit the HTML to refer
   to the images or other data included in the message.  The Content-ID
   Uniform Resource Locator, &quot;cid:&quot;, serves that purpose.
</t>
<t>
   Similarly Net News readers use Message-IDs to link related messages
   together.  The Message-ID URL provides a scheme, &quot;mid:&quot;, to refer to
   such messages as a &quot;resource&quot;.
</t>
<t>
   The &quot;mid&quot; (Message-ID) and &quot;cid&quot; (Content-ID) URL schemes provide
   identifiers for messages and their body parts.  The &quot;mid&quot; scheme uses
   (a part of) the message-id of an email message to refer to a specific
   message.  The &quot;cid&quot; scheme refers to a specific body part of a
   message; its use is generally limited to references to other body
   parts in the same message as the referring body part.  The &quot;mid&quot;
   scheme may also refer to a specific body part within a designated
   message, by including the content-ID&apos;s address.
</t>
<t>
   A note on terminology.  The terms &quot;body part&quot; and &quot;MIME entity&quot; are
   used interchangeably.  They refer to the headers and body of a MIME
   message, either the message itself or one of the body parts contained
   in a Multipart message.
</t>
</section>
<!-- RFC original section: (2.) -->
<section title="The MID and CID URL Schemes">
<t>
   RFC1738 <xref target="_XREF_URL"/> reserves the &quot;mid&quot; and &quot;cid&quot; schemes for Message-ID and
   Content-ID respectively.  This memorandum defines the syntax for
   those URLs.  Because they use the same syntactic elements they are
   presented together.
</t>
<t>
   The URLs take the form
</t>
<figure><artwork>
        content-id    = url-addr-spec

        message-id    = url-addr-spec

        url-addr-spec = addr-spec  ; URL encoding of RFC 822 addr-spec

        cid-url       = &quot;cid&quot; &quot;:&quot; content-id

        mid-url       = &quot;mid&quot; &quot;:&quot; message-id [ &quot;/&quot; content-id ]
</artwork></figure>
<t><list><t>
      Note: in Internet mail messages, the addr-spec in a Content-ID
      <xref target="_XREF_MIME"/> or Message-ID <xref target="_XREF_822"/> header are enclosed in angle brackets
      (&lt;&gt;).  Since addr-spec in a Message-ID or Content-ID might contain
      characters not allowed within a URL; any such character (including
      &quot;/&quot;, which is reserved within the &quot;mid&quot; scheme) must be hex-
      encoded using the %hh escape mechanism in <xref target="_XREF_URL"/>.
</t></list>
</t>
<t>
   A &quot;mid&quot; URL with only a &quot;message-id&quot; refers to an entire message.
   With the appended &quot;content-id&quot;, it refers to a body part within a
   message, as does a &quot;cid&quot; URL.  The Content-ID of a MIME body part is
   required to be globally unique.  However, in many systems that store
   messages, body parts are not indexed independently their context
   (message).  The &quot;mid&quot; URL long form was designed to supply the
   context needed to support interoperability with such systems.
</t>
<t>
   A implementation conforming to this specification is required to
   support the &quot;mid&quot; URL long form (message-id/content-id).  Conforming
   implementations can choose to, but are not required to, take
   advantage of the content-id&apos;s uniqueness and interpret a &quot;cid&quot; URL to
   refer to any body part within the message store.
</t>
<t>
   In limited circumstances (e.g., within multipart/alternate), a single
   message may contain several body parts that have the same Content-ID.
   That occurs, for example, when identical data can be accessed through
   different methods [MIME, sect. 7.2.3].  In those cases, conforming
   implementations are required to use the rules of the containing MIME
   entity (e.g., multi-part/alternate) to select the body part to which
   the Content-ID refers.
</t>
<t>
   A &quot;cid&quot; URL is converted to the corresponding Content-ID message
   header <xref target="_XREF_MIME"/> by removing the &quot;cid:&quot; prefix, converting %hh hex-
   escaped characters to their ASCII equivalents and enclosing the
   remaining parts with an angle bracket pair, &quot;&lt;&quot; and &quot;&gt;&quot;.  For
   example, &quot;mid:foo4%25foo1@bar.net&quot; corresponds to
</t>
<figure><artwork>
        Message-ID: &lt;foo4%foo1@bar.net&gt;
</artwork></figure>
<t>
   A &quot;mid&quot; URL is converted to a Message-ID or Message-ID/Content-ID
   pair in a similar fashion.
</t>
<t>
   Both message-id and content-id are required to be globally unique.
   That is, no two different messages will ever have the same Message-ID
   addr-spec; no different body parts will ever have the same Content-ID
   addr-spec.  A common technique used by many message systems is to use
   a time and date stamp along with the local host&apos;s domain name, e.g.,
   950124.162336@XIson.com.
</t>
</section>
<section title="Some Examples">
<t>
   The following message contains an HTML body part that refers to an
   image contained in another body part.  Both body parts are contained
   in a Multipart/Related MIME entity.  The HTML IMG tag contains a
   cidurl which points to the image.
</t>
<figure><artwork>
     From: foo1@bar.net
     To: foo2@bar.net
     Subject: A simple example
     Mime-Version: 1.0
     Content-Type: multipart/related; boundary=&quot;boundary-example-1&quot;;
                   type=Text/HTML

     --boundary-example 1
     Content-Type: Text/HTML; charset=US-ASCII

     ... text of the HTML document, which might contain a hyperlink
     to the other body part, for example through a statement such as:
     &lt;IMG SRC=&quot;cid:foo4*foo1@bar.net&quot; ALT=&quot;IETF logo&quot;&gt;

     --boundary-example-1
     Content-ID: foo4*foo1@bar.net
     Content-Type: IMAGE/GIF
     Content-Transfer-Encoding: BASE64
     R0lGODlhGAGgAPEAAP/////ZRaCgoAAAACH+PUNvcHlyaWdodCAoQykgMTk5
     NSBJRVRGLiBVbmF1dGhvcml6ZWQgZHVwbGljYXRpb24gcHJvaGliaXRlZC4A
     etc...

     --boundary-example-1--
</artwork></figure>
<t>
   The following message points to another message (hopefully still in
   the recipient&apos;s message store).
</t>
<figure><artwork>
     From: bar@none.com
     To: phooey@all.com
     Subject: Here&apos;s how to do it
     Content-type: text/html; charset=usascii

     ...  The items in my
     &lt;A HREF= &quot;mid:960830.1639@XIson.com/partA.960830.1639@XIson.com&quot;&gt;
     previous message&lt;/A&gt;, shows how the approach you propose can be
     used to accomplish ...
</artwork></figure>
</section>
<!-- RFC original section: (3.) -->
<section title="Security Considerations">
<t>
   The URLs defined here provide an addressing or referencing mechanism.
   The values of these URLs disclose no more about the originators
   environment than the corresponding Message-ID and Content-ID values.
   Where concern exists about such disclosures the originator of a
   message using mid and cid URLs must take precautions to insure that
   confidential information is not disclosed.  Those precautions should
   already be in place to handle existing mail use of the Message-ID and
   Content-ID.
</t>
</section>
<!-- RFC original section: (4.) -->
<section title="References (BOILERPLATE)">
<t>
This RFC contained boilerplate in this section which has been moved
to the RFC2223-compliant unnumbered section &quot;References.&quot;
</t>
</section>
<!-- RFC original section: (5.) -->
<section title="Acknowledgments">
<t>
   The original concept of &quot;mid&quot; and &quot;cid&quot; URLs were part of the Tim
   Berners-Lee&apos;s original vision of the World Wide Web. The ideas and
   design have benefited greatly by discussions with Harald Alvestrand,
   Dan Connolly, Roy Fielding, Larry Masinter, Jacob Palme, and others
   in the MHTML working group.
</t>
</section>
<!-- RFC original section: (6.) -->
<section title="Author&apos;s Address (BOILERPLATE)">
<t>
This RFC contained boilerplate in this section which has been moved
to the RFC2223-compliant unnumbered section &quot;Author&apos;s Address.&quot;
</t>
</section>
</middle>
<back>
<!-- BEGIN INCLUDE REFERENCES ** DO NOT REMOVE -->
<references>
<reference anchor="_XREF_822">
<front>
<title abbrev="Standard for the Format of ARPA Internet">Standard for the Format of ARPA Internet Text Messages, &quot;, University of Delaware</title>
<author initials="D." surname="Crocker" fullname="D. Crocker">
<organization/>
</author>
<date month="August" year="1982"/>
</front>
<seriesInfo>STD 11</seriesInfo>
<seriesInfo>RFC 822</seriesInfo>
</reference>
<reference anchor="_XREF_MIME">
<front>
<title abbrev="MIME (Multipurpose Internet Mail">MIME (Multipurpose Internet Mail Extensions) Part One:  Mechanisms for Specifying and Describing the Format of Internet Message Bodies,&quot;</title>
<author initials="N." surname="Borenstein" fullname="N. Borenstein">
<organization/>
</author>
<author initials="N." surname="Freed" fullname="N. Freed">
<organization/>
</author>
<date month="September" year="1993"/>
</front>
<seriesInfo>RFC 1521</seriesInfo>
</reference>
<reference anchor="_XREF_URL">
<front>
<title abbrev="Berners-Lee">Berners-Lee, T., Masinter, L., and McCahill, M., &quot;Uniform Resource Locators (URL),&quot;</title>
<author>
<organization/>
</author>
<date month="December" year="1994"/>
</front>
</reference>
<reference anchor="_XREF_MULREL">
<front>
<title>The MIME Multipart/Related Content-type,&quot;</title>
<author initials="E." surname="Levinson" fullname="E. Levinson">
<organization/>
</author>
<date month="December" year="1995"/>
</front>
<seriesInfo>RFC 1874</seriesInfo>
</reference>
</references>
<!-- END INCLUDE REFERENCES ** DO NOT REMOVE -->
</back>
</rfc>
