RFC 2392

Content-ID and Message-ID Uniform Resource Locators

๐Ÿ“… published August 1998, from ietf

Content-ID and Message-ID Uniform Resource Locators ๐Ÿ’–

Okay bestie, this one is RFC 2392 from the Network Working Group ๐ŸŽ€. Edward Levinson (E. Levinson) wrote it in August 1998. It's a Standards Track doc, and it obsoletes RFC 2111 โœจ. It doesn't list any updates.


Status of this Memo ๐Ÿงš

This document is an Internet standards track protocol for the Internet community, and it's asking for discussion and suggestions for improvements ๐Ÿซถ. For the current standardization state and status, check the current edition of the "Internet Official Protocol Standards" (STD 1) ๐Ÿ“–. Distribution of this memo is unlimited ๐Ÿฆ‹.

Copyright (C) The Internet Society (1998). All Rights Reserved ๐Ÿ’œ.

Abstract ๐ŸŒธ

The "cid:" and "mid:" URL schemes let you reference messages and their body parts ๐Ÿ’…. Picture a single multipart message where one HTML body part has embedded references to other parts of that same message. Iconic ๐Ÿ”ฅ.

Changes from (RFC 2111) โœจ

Okay so the example on page 3 about converting cid URLs to Content-IDs got clarified ๐Ÿ’…. It now uses a cid URL instead of an mid ๐ŸŽ€.

The example messages also got fixed up so the Content-ID has the correct form, with angle brackets ๐Ÿ™ˆ. A Message-ID header got added to the second example too ๐ŸŒท.


1. Introduction ๐Ÿ’–

So [MIME] in email is how we send web pages and their images together ๐Ÿ“จ. The HTML needs a way to point at those images or other data inside the same message, and that's exactly what the Content-ID Uniform Resource Locator, "cid:", is for ๐Ÿซถ.

Net News readers have a similar thing going on, since they use Message-IDs to link related messages together ๐Ÿงต. The Message-ID URL gives us the "mid:" scheme so you can refer to those messages as a "resource" โœจ.

Basically, "mid" (Message-ID) and "cid" (Content-ID) give you identifiers for messages and their body parts ๐Ÿ’œ. The "mid" scheme uses (a part of) an email message's message-id to point at one specific message ๐Ÿฆ‹. The "cid" scheme points at a specific body part of a message, and it's mostly meant for other body parts in the same message as the one doing the referencing ๐ŸŽ€. And "mid" can also point at a specific body part inside a designated message, by including the content-ID's address ๐Ÿ“.

Quick terminology note: "body part" and "MIME entity" mean the same thing ๐ŸŒˆ. They both refer to the headers and body of a MIME message, whether that's the whole message or one of the body parts inside a Multipart message ๐Ÿงš.


2. The MID and CID URL Schemes ๐ŸŽ€

RFC 1738 [URL] set aside the "mid" and "cid" schemes for Message-ID and Content-ID, respectively ๐Ÿ’…. This memo defines the syntax for those URLs ๐Ÿฆ‹. They use the same syntactic pieces, so they're covered together ๐Ÿ’–.

The URLs take this form:

content-id    = url-addr-spec

message-id    = url-addr-spec

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

cid-url       = "cid" ":" content-id

mid-url       = "mid" ":" message-id [ "/" content-id ]

Notes: In Internet mail messages, the addr-spec in a Content-ID [MIME] or Message-ID [822] header is wrapped in angle brackets, <> ๐ŸŽ€. The addr-spec in a Message-ID or Content-ID might have characters that aren't allowed in a URL ๐Ÿ˜ญ. So any such character, including "/" (which is reserved in the "mid" scheme), has to be hex-encoded using the %hh escape mechanism in [URL] ๐Ÿ’€.

A "mid" URL with only a "message-id" refers to a whole message ๐Ÿ’œ. Add the "content-id" on the end and it points at a body part inside the message, same as a "cid" URL does ๐ŸŒธ. A MIME body part's Content-ID is required to be globally unique ๐Ÿ”ฅ. But lots of systems that store messages don't index body parts on their own, apart from the message they're in ๐Ÿ™ˆ. The long form of the "mid" URL was built to carry that missing context so it works with those systems ๐Ÿงš.

An implementation that conforms to this spec is required to support the "mid" long form (message-id/content-id) ๐Ÿ’…. Conforming implementations can choose to, but don't have to, use the fact that a content-id is unique and read a "cid" URL as pointing at any body part in the message store ๐Ÿฆ‹.

Sometimes, in limited situations (like inside multipart/alternate), one message can have several body parts with the same Content-ID ๐ŸŒˆ. That happens when the same data can be reached through different methods, for example ๐Ÿ“. In those cases, conforming implementations are required to follow the rules of the containing MIME entity (like multipart/alternate) to pick the body part the Content-ID refers to ๐Ÿ’–.

Converting a "cid" URL into a Content-ID message header [MIME] is pretty simple. You drop the "cid:" prefix, turn the % encoded characters back into their US-ASCII equivalents, and wrap what's left in an angle bracket pair, < and > โœจ. For example, cid:foo4%25foo1@bar.net becomes:

Content-ID: <foo4%25foo1@bar.net>

Going the other way, converting URL special characters into their % encodings gets you back to the original cid ๐Ÿ”„.

A "mid" URL gets converted into a Message-ID, or a Message-ID/Content-ID pair, in a similar way ๐Ÿซถ.

Both message-id and content-id are required to be globally unique ๐Ÿ”. That means no two different messages ever share the same Message-ID addr-spec, and no two different body parts ever share the same Content-ID addr-spec ๐Ÿ’œ. A popular trick a lot of message systems use is a time and date stamp plus the local host's domain name, like 950124.162336@XIson.com ๐Ÿ•ฐ๏ธโœจ.

Some Examples ๐Ÿฆ‹

This first message has an HTML body part that references an image in another body part ๐ŸŒท. Both body parts sit inside a Multipart/Related MIME entity ๐ŸŒˆ. The HTML IMG tag has a cidurl that points at the image ๐Ÿ“ธ.

From: foo1@bar.net
To: foo2@bar.net
Subject: A simple example
Mime-Version: 1.0
Content-Type: multipart/related; boundary="boundary-example-1";
              type=Text/HTML

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

to the other body part, for example through a statement such as:
<IMG SRC="cid:foo4*foo1@bar.net" ALT="IETF logo">

--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--

This second message points at another message, which hopefully is still in the recipient's message store ๐Ÿคž.

From: bar@none.com
To: phooey@all.com
Subject: Here's how to do it
Message-ID: <970701.32784@VIers.none.com>
Content-type: text/html; charset=usascii

<A HREF= "mid:960830.1639@XIson.com/partA.960830.1639@XIson.com">
previous message</A>, shows how the approach you propose can be
used to accomplish ...

3. Security Considerations ๐Ÿšจ

Okay, this part is serious bestie ๐Ÿ˜ญ. The URLs defined here are just an addressing or referencing mechanism ๐Ÿ”. Their values don't reveal any more about the originator's environment than the Message-ID and Content-ID values already do ๐Ÿซฃ. If anyone is worried about that kind of disclosure, the originator of a message using mid and cid URLs has to take precautions so confidential information doesn't leak ๐Ÿ”. Those precautions should already be in place for existing mail use of Message-ID and Content-ID ๐Ÿ’….


4. References ๐Ÿ“š

[822]     Crocker, D., "Standard for the Format of ARPA Internet Text
          Messages", August 1982, STD 11, RFC 822, August 1982.

[MIME]    Borenstein, N., and N. Freed, "Multipurpose Internet Mail
          Extensions (MIME) Part One: Format of Internet Message
          Bodies", RFC 2045, November 1996.

[URL]     Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform
          Resource Locators (URL)", RFC 1738, December 1994.

[MULREL]  Levinson, E., "The MIME Multipart/Related Content-type",
          RFC 2387, August 1998.

5. Acknowledgments ๐Ÿซถ

The original idea behind "mid" and "cid" URLs was part of Tim Berners-Lee's original vision for the World Wide Web ๐ŸŒ. The ideas and design got a lot better thanks to discussions with Harald Alvestrand, Dan Connolly, Roy Fielding, Larry Masinter, Jacob Palme, and others in the MHTML working group ๐Ÿ’œ.

6. Author's Address ๐Ÿ“ฎ

Edward Levinson
47 Clive Street
Metuchen, NJ  08840-1060
USA

Phone: +1 908 549 3716
EMail: XIson@cnj.digex.net

Copyright (C) The Internet Society (1998). All Rights Reserved ๐ŸŒˆ.

You're allowed to copy this document and give copies to others ๐Ÿฆ‹. You can also make derivative works that comment on or explain it, or help with implementing it, and publish and distribute those however you want, in whole or in part, with no restrictions ๐ŸŽ€. The one catch is that the copyright notice and this paragraph have to stay on every copy and derivative work ๐Ÿ™.

The document itself can't be modified in any way, though ๐Ÿ™…โ€โ™€๏ธ. That includes removing the copyright notice or references to the Internet Society or other Internet organizations ๐Ÿ˜ค. The exception is developing Internet standards, where you follow the copyright procedures in the Internet Standards process, or translating it into languages other than English ๐ŸŒ.

These limited permissions are perpetual and won't be revoked by the Internet Society or its successors or assigns ๐Ÿ’œ.

The document and the information in it are provided "AS IS", and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED ๐Ÿ’€. That includes, but isn't limited to, any warranty that using the information won't infringe any rights, and any implied warranties of merchantability or fitness for a particular purpose ๐Ÿซ .

๐Ÿ“ฆ where this page comes from