Multipart MIME Email Structures

A conformant email client is minimally required to support the “mixed” and “digest” subtypes. Other commonly used subtypes are “alternative”, “message”, “related”, “report”, “signed”, “encrypted”. Note that many of these subparts can be nested.

The example patterns below are emails composed on the listed email clients filtered with of the courier reformime utility. This makes the structure more human-readable.

$ cat test.eml | reformime -i | egrep 'content-|section'
Pattern Outlook 2010 OSX Mail v4.6 Android Gmail v4.2.1 Android Email v4.1 iOS Mail
plain text
section: 1
content-type: text/plain
content-transfer-encoding: 7bit
content-language: en-us
      
section: 1
content-type: text/plain
content-transfer-encoding: 7bit
      
section: 1
content-type: text/plain
content-transfer-encoding: base64
      
section: 1
content-type: text/plain
content-transfer-encoding: 7bit
      
rich text
section: 1
content-type: multipart/alternative
content-transfer-encoding: 8bit
content-language: en-us
section: 1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.2
content-type: text/html
content-transfer-encoding: quoted-printable
	
section: 1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.2
content-type: text/html
content-transfer-encoding: 7bit
      
section: 1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.1
content-type: text/plain
content-transfer-encoding: 8bit
section: 1.2
content-type: text/html
content-transfer-encoding: 8bit

      
attachment
section: 1
content-type: multipart/related
content-transfer-encoding: 8bit
content-language: en-us
section: 1.1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.1.2
content-type: text/html
content-transfer-encoding: quoted-printable
section: 1.2
content-type: image/jpeg
content-name: image001.jpg
content-transfer-encoding: base64
content-id: <image001.jpg@01CDF571.231AA230>
      
section: 1
content-type: multipart/mixed
content-transfer-encoding: 8bit
section: 1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.2
content-type: image/jpg
content-name: tiny_image.jpg
content-transfer-encoding: base64
content-disposition: inline
content-disposition-filename: tiny_image.jpg
	
section: 1
content-type: multipart/mixed
content-transfer-encoding: 8bit
section: 1.1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.1.1
content-type: text/plain
content-transfer-encoding: 8bit
section: 1.1.2
content-type: text/html
content-transfer-encoding: 8bit
section: 1.2
content-type: image/jpeg
content-name: IMG_20130106_203051.jpg
content-transfer-encoding: base64
content-disposition: attachment
content-disposition-filename: IMG_20130106_203051.jpg
      
section: 1
content-type: multipart/mixed
content-transfer-encoding: 8bit
section: 1.1
content-type: text/plain
content-transfer-encoding: base64
section: 1.2
content-type: image/jpeg
content-name: 12 - 1
content-transfer-encoding: base64
content-disposition: attachment
content-disposition-filename: 12 - 1
      
multiple forwarded messages
section: 1
content-type: multipart/mixed
content-transfer-encoding: 8bit
content-language: en-us
section: 1.1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.1.2
content-type: text/html
content-transfer-encoding: quoted-printable
section: 1.2
content-type: message/rfc822
content-transfer-encoding: 7bit
content-disposition: attachment
section: 1.2.1
content-type: text/plain
content-transfer-encoding: 7bit
content-language: en-us
section: 1.3
content-type: message/rfc822
content-transfer-encoding: 7bit
content-disposition: attachment
section: 1.3.1
content-type: text/plain
content-transfer-encoding: 7bit
content-language: en-us
      
section: 1
content-type: multipart/mixed
content-transfer-encoding: 8bit
section: 1.1
content-type: message/rfc822
content-name: Welcome
content-transfer-encoding: 7bit
content-disposition: attachment
content-disposition-filename: Welcome
section: 1.1.1
content-type: multipart/mixed
content-transfer-encoding: 8bit
section: 1.1.1.1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.1.1.1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.1.1.1.2
content-type: text/html
content-transfer-encoding: 7bit
section: 1.1.1.2
content-type: text/html
content-transfer-encoding: 7bit
section: 1.2
content-type: message/rfc822
content-name: free trial
content-transfer-encoding: 7bit
content-disposition: attachment
content-disposition-filename: free trial
section: 1.2.1
content-type: multipart/mixed
content-transfer-encoding: 8bit
section: 1.2.1.1
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.2.1.1.1
content-type: text/plain
content-transfer-encoding: 7bit
section: 1.2.1.1.2
content-type: text/html
content-transfer-encoding: 7bit
section: 1.2.1.2
content-type: multipart/alternative
content-transfer-encoding: 8bit
section: 1.2.1.2.1
content-type: text/plain
content-transfer-encoding: 7bit
content-id: <4fe888e9a7b3_318df1213836448@domU-12-31-39-05-28-B1.mail>
section: 1.2.1.2.2
content-type: text/html
content-transfer-encoding: 7bit
content-id: <4fe888e9b5a1_318df121383652f@domU-12-31-39-05-28-B1.mail>