7.1. Main Body Part
When an e-mail message is composed or rendered to the user there is typically one main view that presents a (mostly textual) part of the message.¶
While the message itself may be constructed of several distinct MIME parts in a tree, the part that is rendered to the user is the "Main Body Part".¶
When rendering a message, one of the primary jobs of the receiving MUA is identifying which part (or parts) is the Main Body Part.
Typically, this is found by traversing the MIME tree of the message looking for a leaf node that has a primary content type of text
(e.g. text/plain
or text/html
) and is not Content-Disposition: attachment
.¶
MIME tree traversal follows the first child of every multipart
node, with the exception of multipart/alternative
.
When traversing a multipart/alternative
node, all children should be scanned, with preference given to the last child node with a MIME type that the MUA is capable of rendering directly.¶
A MUA MAY offer the user a mechanism to prefer a particular MIME type within multipart/alternative
instead of the last renderable child.
For example, a user may explicitly prefer a text/plain
alternative part over text/html
.¶
Note that due to uncertainty about the capabilities and configuration of the receiving MUA, the composing MUA SHOULD consider that multiple parts might be rendered as the Main Body Part when the message is ultimately viewed.¶
When composing a message, an originating MUA operating on behalf of an active user can identify which part (or parts) are the "main" parts: these are the parts the MUA generates from the user's editor. Tooling that automatically generates e-mail messages should also have a reasonable estimate of which part (or parts) are the "main" parts, as they can be programmatically identified by the message author.¶
For a filtering program that attempts to transform an outbound message without any special knowledge about which parts are Main Body Parts, it can identify the likely parts by following the same routine as a receiving MUA.¶