RFC 2112
The MIME Multipart/Related Content-type
RFC 2112: The MIME Multipart/Related Content-type π
Okay bestie, look at this title block first π This doc is from the Network Working Group and it's Request for Comments: 2112. It was written by E. Levinson from XIson, Inc. β¨ It's a Standards Track doc, dated March 1997, and it obsoletes RFC 1872 π¦ It doesn't update anything else.
Status of this Memo β¨
This doc is an Internet standards track protocol for the Internet community, and it's basically asking for discussion and suggestions for improvements π«Ά For the current standardization state and status, check the "Internet Official Protocol Standards" (STD 1) π Distribution of this memo is unlimited, so share away π
Abstract π
The Multipart/Related content-type is the main character for representing objects that are made of related MIME body parts π This doc defines Multipart/Related and gives examples of how to use it β¨
1. Introduction π¦
Okay so a bunch of MIME stuff, like MIME-PEM, MIME-Macintosh, and other proposals, all need multiple body parts that only make sense when you look at them together π§ The old way of handling this was to make a new multipart subtype for every new object π But MIME is all about having one mechanism for lots of different purposes, so this doc gives us a single mechanism for these aggregate or compound objects π
Multipart/Related is how we represent compound objects in MIME π₯ The object gets labeled with a "type" parameter. There are extra parameters for pointing to a specific starting body part (the root) and for auxiliary info that might be needed when unpacking or processing the object πΈ
Multipart/Related MIME entities can have Content-Disposition headers that suggest how a body part should be stored and displayed π But Multipart/Related processing wins over Content-Disposition, and section 4 explains how they work together β¨
Whoever builds the compound object is also the one responsible for displaying or processing its parts π
2. Multipart/Related Registration Information π
This form is copied from RFC 1590, Appendix A π
To: IANA@isi.edu Subject: Registration of new Media Type content-
type/subtype
Media Type name: Multipart
Media subtype name: Related
Required parameters: Type, a media type/subtype.
Optional parameters: Start
Start-info
Encoding considerations: Multipart content-types cannot have
encodings.
Security considerations: Depends solely on the referenced type.
Published specification: RFC-REL (this document).
Person & email address to contact for further information:
Edward Levinson
47 Clive Street
Metuchen, NJ 08840-1060
+1 908 494 1606
XIson@cnj.digex.net
3. Intended usage π§
Multipart/Related is for compound objects that have several inter-related body parts π¦ You literally can't display a Multipart/Related object by showing each body part on its own, it's giving "the whole is more than the parts" π The content-type of the whole object is set by the type parameter. The "start" parameter (if you include it) uses a content-ID to point at the body part with the object root π If you don't include it, the default root is the first body part in the Multipart/Related body π
What makes a compound object different from other object types is how its body parts relate to each other π Those relationships are often links inside the components that point at the other components π«Ά Inside one operating environment those links are often file names, and in a MIME message they can be represented with content-IDs or the value of some other "Content-" headers β¨
3.1. The Type Parameter π
The type parameter is required, and its value is the MIME media type of the "root" body part π That lets a MIME user agent figure out the content-type without having to look inside the enclosed body part β¨ If the type parameter's value and the root body part's content-type are different, the User Agent's behavior is undefined π
3.2. The Start Parameter π¦
The start parameter (if given) is the content-ID of the compound object's "root" π If it's not there, the "root" is the first body part in the Multipart/Related entity πΈ The "root" is the element the applications process first π
3.3. The Start-Info Parameter π
The start-info parameter gives extra info to an application π§ It holds either a string, or a content-ID that points to another MIME entity in the message π A typical use would be extra command line parameters or a MIME entity with auxiliary info for processing the compound object π₯
Applications that use Multipart/Related must spell out how they interpret start-info β¨ User Agents shall pass the parameter's value along to the processing application π Processes can tell a start-info reference apart from a token or quoted-string by checking the first non-white-space character: a "<" means it's a reference π
3.4. Syntax π
related-param := [ ";" "start" "=" cid ]
[ ";" "start-info" "="
( cid-list / value ) ]
[ ";" "type" "=" type "/" subtype ]
; order independent
cid-list := cid cid-list
cid := msg-id ; c.f. [822]
value := token / quoted-string ; c.f. [MIME]
; value cannot begin with "<"
Parameter values usually need quoting, bestie π Msg-id has special characters like "<", ">", and "@", plus maybe others π«Ά If msg-id has quoted-strings in it, those quote marks must be escaped π The type parameter has a special character too, the "/" π¦
4. Handling Content-Disposition Headers π₯
Content-Disposition Headers [DISP] suggest presentation styles for MIME body parts β¨ [DISP] describes two presentation styles, called the disposition types INLINE and ATTACHMENT π Inside a multipart entity, these let the sender suggest how things should be presented πΈ [DISP] also allows an optional storage (file) name π§ Content-Disposition headers can show up in one or more body parts inside a Multipart/Related entity π
Using Content-Disposition headers alongside Multipart/Related gives presentation info to User Agents that don't recognize Multipart/Related π Those agents will treat the multipart as Multipart/Mixed, and they might find the Content-Disposition info useful π
With Multipart/Related, though, the application that processes the compound object decides the presentation style for all of the contained parts π In that case the Content-Disposition header info is redundant, or even misleading π So User Agents that understand Multipart/Related shall ignore the disposition type within a Multipart/Related body part π
A User Agent that handles both Multipart/Related and Content-Disposition headers could pass the invoked application the Content-Disposition header's optional filename parameter, as the Multipart/Related's filename π¦ How that info gets used depends on the specific application, and it should be specified when describing how the matching compound object is handled β¨ Those descriptions would fit in an RFC that registers that object's media type π
5. Examples π
5.1 Application/X-FixedRecord β¨
The X-FixedRecord content-type is made of one or more octet-streams plus a list of the lengths of each record π§ The root lists the record lengths of each record within the streams π«Ά The record length list (type Application/X-FixedRecord) is a set of INTEGERs written in ASCII format, one per line πΈ Each INTEGER gives the number of octets from the octet-stream body part that make up the next "record" π₯
The example below uses a single data block π
Content-Type: Multipart/Related; boundary=example-1
start="<950120.aaCC@XIson.com>";
type="Application/X-FixedRecord"
start-info="-o ps"
--example-1
Content-Type: Application/X-FixedRecord
Content-ID: <950120.aaCC@XIson.com>
25
10
34
10
25
21
26
10
--example-1
Content-Type: Application/octet-stream
Content-Description: The fixed length records
Content-Transfer-Encoding: base64
Content-ID: <950120.aaCB@XIson.com>
T2xkIE1hY0RvbmFsZCBoYWQgYSBmYXJtCkUgSS
BFIEkgTwpBbmQgb24gaGlzIGZhcm0gaGUgaGFk
IHNvbWUgZHVja3MKRSBJIEUgSSBPCldpdGggYS
BxdWFjayBxdWFjayBoZXJlLAphIHF1YWNrIHF1
YWNrIHRoZXJlLApldmVyeSB3aGVyZSBhIHF1YW
NrIHF1YWNrCkUgSSBFIEkgTwo=
--example-1--
5.2 Text/X-Okie π
Text/X-Okie is a made-up markup language that lets you include images with text π¦ The cool thing about this example is that it has two extra body parts, both pictures π The encapsulated document refers to them internally using each picture's body part content-ID π Using "cid:" like this might be handy for lots of compound objects π§ But it's not part of the Multipart/Related spec, so don't get it twisted π
Content-Type: Multipart/Related; boundary=example-2;
start="<950118.AEBH@XIson.com>"
type="Text/x-Okie"
--example-2
Content-Type: Text/x-Okie; charset=iso-8859-1;
declaration="<950118.AEB0@XIson.com>"
Content-ID: <950118.AEBH@XIson.com>
Content-Description: Document
{doc}
This picture was taken by an automatic camera mounted ...
{image file=cid:<950118.AECB@XIson.com>}
{para}
Now this is an enlargement of the area ...
{image file=cid:<950118:AFDH@XIson.com>}
{/doc}
--example-2
Content-Type: image/jpeg
Content-ID: <950118.AFDH@XIson.com>
Content-Transfer-Encoding: BASE64
Content-Description: Picture A
[encoded jpeg image]
--example-2
Content-Type: image/jpeg
Content-ID: <950118.AECB@XIson.com>
Content-Transfer-Encoding: BASE64
Content-Description: Picture B
[encoded jpeg image]
--example-2--
5.3 Content-Disposition πΈ
In the example above, each image body part could also have a Content-Disposition header β¨ Here's what that looks like π
...
--example-2
Content-Type: image/jpeg
Content-ID: <950118.AECB@XIson.com>
Content-Transfer-Encoding: BASE64
Content-Description: Picture B
Content-Disposition: INLINE
[encoded jpeg image]
--example-2--
User Agents that recognize Multipart/Related will ignore the Content-Disposition header's disposition type π Other User Agents will process the Multipart/Related as Multipart/Mixed, and they may make use of that header's info π«Ά
6. User Agent Requirements β¨
okay so bestie, this part is all about what user agents have to do, and the first thing is what happens when a client doesn't know Multipart/Related at all π. Those clients shall, following [MIME], treat the whole entity as Multipart/Mixed. π«Ά Then there's the in-between case: MIME User Agents that do recognize Multipart/Related but can't process the particular type should give the user the option of suppressing the entire Multipart/Related body part shall be. π The user gets the final say!!
Existing MIME-capable mail user agents (MUAs) already handle the existing media types in a super straightforward way β¨. For discrete media types (e.g. text, image, etc.), the body of the entity can go straight to a display process. The composite subtypes can basically be broken down into handling one or more discrete types. Multipart/Related is different though, because you can't just handle each entity on its own π. The processing is all about how the parts relate to each other, so it's a whole vibe.
Next up are the details the processing application needs to know πΈ.
It's possible that an application-specific "receiving agent" will tweak the entities for display before the actual application process gets them π¦. Okie, above, is an example of this: it may need a receiving agent to parse the document and swap in local file names for the originator's file names. Other applications might only need a table showing how local file names match up with the originator's. The receiving agent takes responsibility for all of that processing π.
6.1 Data Requirements
MIME-capable mail user agents (MUAs) are required to provide the application:
- (a) the bodies of the MIME entities and the entity Content-* headers,
- (b) the parameters of the Multipart/Related Content-type header, and
- (c) the correspondence between each body's local file name, that body's header data, and, if present, the body part's content-ID.
Basically the app needs all the receipts π§Ύπ.
6.2 Storing Multipart/Related Entities
Multipart/Related is the media type for objects with internal linkages between body parts π. When these objects get stored, those linkages may need processing by the application or its receiving agent. Keep that in mind, bestie π.
6.3 Recursion
MIME is recursive, so you've got to expect a Multipart/Related entity to contain other Multipart/Related entities πͺ. When a Multipart/Related entity is being processed for display or storage, any enclosed Multipart/Related entities shall be processed as though they were being stored. Nesting is no cap a whole mood ππ₯.
6.4 Configuration Considerations
It's suggested that MUAs using configuration mechanisms (see [CFG] for an example) refer to Multipart/Related as Multipart/Related/<type>, where <type> is the value of the "type" parameter π§. Cute and organized, periodt β¨.
7. Security considerations π
Security considerations relevant to Multipart/Related are identical to those of the underlying content-type. So no sneaky new threats here, but you still have to take the underlying content-type's security seriously, bestie π. Don't skip it!!
8. Acknowledgments π«Ά
This proposal came out of conversations the author had with many people π. In particular, Harald A. Alvestrand, James Clark, Charles Goldfarb, Gary Houston, Ned Freed, Ray Moody, and Don Stinchfield gave both encouragement and invaluable help π. The author, however, takes full responsibility for all errors contained in this document π.
9. References π
- [822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", August 1982, University of Delaware, RFC 822.
- [CID] E. Levinson, J. Clark, "Message/External-Body Content-ID Access Type", 12/26/1995, RFC 1873 Levinson, E., "Message/External-Body Content-ID Access Type", February 1997, RFC 2111.
- [CFG] Borenstein, N., "A User Agent Configuration Mechanism For Multimedia Mail Format Information", September 23, 1993, RFC 1524.
- [DISP] R. Troost, S. Dorner, "Communicating Presentation Information in Internet Messages: The Content-Disposition Header", June 7, 1995, RFC 1806.
- [MIME] Borenstein, N. and Freed, N., "MIME (Multipurpose Internet Mail Extensions): Mechanisms for Specifying and Describing the Format of Internet Message Bodies", June 1992, RFC 1341.
9. Author's Address π·
Edward Levinson
XIson, Inc.
47 Clive Street
Metuchen, NJ 08840-1060
USA
+1 908 549 3716
<XIson@cnj.digex.com>
That's the whole RFC, bestie! ππ Edward really brought the receipts, and you now know exactly how Multipart/Related works. Iconic, honestly πβ¨
π¦ where this page comes from
- ietf: rfc2112 1997-03
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms