RFC 2387
The MIME Multipart/Related Content-type
The MIME Multipart/Related Content-type โจ
okay bestie, let's get into RFC 2387 ๐ฆ It's called "The MIME Multipart/Related Content-type," written by E. Levinson in August 1998. It's a Standards Track document, which means it's an actual Internet standards protocol ๐ It obsoletes RFC 2112, so 2112 is retired and this one is the new official version. It's part of the Network Working Group series, and the title block also gives you the author, date, and status, so you know exactly what you're looking at ๐
Status of This Memo
okay so this document specifies an Internet standards track protocol for the Internet community ๐ธ It also asks for discussion and suggestions for improvements, so the community is literally invited to weigh in ๐ซถ If you want the current standardization state and status of this protocol, check the current edition of the "Internet Official Protocol Standards" (STD 1). And the distribution of this memo is unlimited, so anyone can read it ๐
Copyright Notice
Copyright (C) The Internet Society (1998). All Rights Reserved. ๐
Abstract
the Multipart/Related content-type gives us one common way to represent objects that are made up of related MIME body parts ๐ง This document defines Multipart/Related and shows examples of how it gets used โจ
1. Introduction โจ
okay so several MIME applications need multiple body parts that only make sense when you look at them together ๐ Think MIME-PEM, MIME-Macintosh, and some other proposals ๐ The old way to handle these compound objects was to define a brand-new multipart subtype for every single object. That's a lot of subtypes, bestie ๐ญ MIME is all about having one mechanism for the same goal across different purposes, so this document describes one single mechanism for these aggregate or compound objects ๐
Multipart/Related is the MIME representation for compound objects ๐ The object is categorized by a "type" parameter. There are additional parameters too: one points to a specific starting body part (the root), and others carry auxiliary information that might be needed when you unpack or process the object ๐ฅ
Multipart/Related MIME entities can contain Content-Disposition headers, which give suggestions for how a body part should be stored and displayed ๐ But Multipart/Related processing takes precedence over Content-Disposition, and section 4 explains how the two interact ๐
Who handles displaying or processing a Multipart/Related's constituent entities? The application that handles the compound object ๐ฆ That's its job, not the protocol's ๐
2. Multipart/Related Registration Information
okay so 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
the Multipart/Related media type is meant for compound objects made of several inter-related body parts ๐ธ For a Multipart/Related object, you can't get proper display by showing each constituent body part on its own, bestie ๐ The content-type of the Multipart/Related object is specified by the type parameter. The "start" parameter, if it's given, points (through a content-ID) to the body part that contains the object root. If there's no start parameter, 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 usually show up as links inside the object's components that reference the other components. In a single operating environment, those links are often file names. Inside a MIME message, those links may be represented using content-IDs or the value of some other "Content-" headers ๐
3.1. The Type Parameter
the type parameter must be specified, 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 at the enclosed body part at all ๐ฆ If the value of the type parameter and the root body part's content-type differ, the User Agent's behavior is undefined ๐
3.2. The Start Parameter
the start parameter, if it's 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, so it's kind of the main character ๐
3.3. The Start-Info Parameter
start-info lets you give an application extra information ๐ It contains either a string or points (through a content-ID) to another MIME entity in the message. A typical use would be extra command line parameters, or a MIME entity with auxiliary information for processing the compound object ๐ฅ
applications that use Multipart/Related must specify how start-info gets interpreted. User Agents shall provide the parameter's value 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
okay here's the grammar ๐ค
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 "<"
note that parameter values will usually need quoting ๐ซถ Msg-id contains the special characters "<", ">", "@", and maybe other special characters. If msg-id contains quoted-strings, those quote marks must be escaped. Similarly, the type parameter contains the special character "/" so keep that in mind too ๐
4. Handling Content-Disposition Headers
okay so 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 presentation information. [DISP] also allows an optional storage (file) name ๐ธ Content-Disposition headers could 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 may find the Content-Disposition information useful ๐
With Multipart/Related, though, the application processing the compound object decides the presentation style for all the contained parts ๐ In that context, the Content-Disposition header information is redundant or even misleading ๐ญ So User Agents that understand Multipart/Related shall ignore the disposition type within a Multipart/Related body part ๐
it might be possible for a User Agent that handles both Multipart/Related and Content-Disposition headers to pass the invoked application the Content-Disposition header's optional filename parameter, as a parameter to the Multipart/Related ๐ How that info gets used depends on the specific application, and it should be specified when describing how the corresponding compound object gets handled. Those descriptions would fit well 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 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" ๐
here's an example that 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
okay the Text/X-Okie is an invented markup language that lets you include images with text ๐จ The cool thing in this example is that it includes two extra body parts, both pictures ๐ธ The encapsulated document refers to them internally through each picture's body part content-ID. Using "cid:", like this example does, might be useful for a bunch of different compound objects ๐ It's not part of the Multipart/Related specification though, so don't mix those up ๐
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 ๐ธ For example:
--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 information ๐
that's part 1 of 2 bestie ๐ more coming up in part 2 ๐
6. User Agent Requirements ๐
okay so, user agents that don't recognize Multipart/Related SHALL, in accordance with [MIME], treat the whole entity as Multipart/Mixed ๐ซถ. MIME User Agents that do recognize Multipart/Related entities but can't process the given type SHOULD give the user the option of suppressing the entire Multipart/Related body part SHALL be ๐ .
Existing MIME-capable mail user agents (MUAs) already handle the existing media types in a super straightforward way โจ. For discrete media types (like text, image, etc.), the body of the entity can go straight to a display process. The existing composite subtypes can basically be broken down into one or more discrete types. Multipart/Related is different though ๐ญ. You can't just reduce its processing to handling each entity on its own. It's a whole web of parts that depend on each other, and that's what makes it iconic ๐ฆ.
The following sections talk about what information the processing application needs ๐.
It's possible that an application-specific "receiving agent" will tweak the entities for display before the actual application process runs ๐ง. Okie, from above, is a great example of this. It might need a receiving agent to parse the document and swap the originator's file names for local file names ๐ธ. Other applications might just need a table showing which local file names match the originator's ๐. The receiving agent takes responsibility for all of this processing ๐.
6.1 Data Requirements
MIME-capable mail user agents (MUAs) are REQUIRED to provide the application with:
- (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.
6.2 Storing Multipart/Related Entities
The Multipart/Related media type will be used for objects that have internal linkages between their body parts ๐. When the objects get stored, those linkages may need processing by the application or its receiving agent ๐.
6.3 Recursion
MIME is recursive, which is very main character energy ๐. So you have 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 ๐งโโ๏ธ.
6.4 Configuration Considerations
It's suggested that MUAs which use configuration mechanisms (see [CFG] for an example) refer to Multipart/Related as Multipart/Related/<type>, were <type> is the value of the "type" parameter ๐.
7. Security Considerations ๐
Security considerations relevant to Multipart/Related are identical to those of the underlying content-type. So whatever risks come with the content-type you're wrapping, those are the ones you're dealing with, no cap ๐.
8. Acknowledgments ๐ซถ
This proposal came out of conversations the author had with lots of people ๐ฌ. In particular, Harald A. Alvestrand, James Clark, Charles Goldfarb, Gary Houston, Ned Freed, Ray Moody, and Don Stinchfield gave both encouragement and seriously invaluable help ๐. The author, however, takes full responsibility for any errors in this document ๐.
9. References ๐
- [822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822, August 1982.
- [CID] Levinson, E., and J. Clark, "Message/External-Body Content-ID Access Type", RFC 1873, December 1995, Levinson, E., "Message/External-Body Content-ID Access Type", Work in Progress.
- [CFG] Borenstein, N., "A User Agent Configuration Mechanism For Multimedia Mail Format Information", RFC 1524, September 1993.
- [DISP] Troost, R., and S. Dorner, "Communicating Presentation Information in Internet Messages: The Content-Disposition Header", RFC 1806, June 1995.
- [MIME] Borenstein, N., and Freed, N., "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.
9. Author's Address ๐ฎ
Edward Levinson 47 Clive Street Metuchen, NJ 08840-1060 USA
Phone: +1 908 494 1606 EMail: XIson@cnj.digex.com
10. Changes from previous draft (RFC 2112) ๐ธ
Corrected cid URLs to conform to RFC 2111. The angle brackets were removed โจ.
11. Full Copyright Statement โ๏ธ
Copyright (C) The Internet Society (1998). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns ๐.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐ฆ
๐ฆ where this page comes from
- ietf: rfc2387 1998-08
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms