MIME-Version: 1.0
From: Nathaniel Borenstein <nsb@nsb.fv.com>
To: Ned Freed <ned@innosoft.com>
Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT)
Subject: A multipart example
Content-Type: multipart/mixed;
            boundary=unique-boundary-1

This is the preamble area of a multipart message.
Mail readers that understand multipart format
should ignore this preamble.

If you are reading this text, you might want to
consider changing to a mail reader that understands
how to properly display multipart messages.

--unique-boundary-1

... Some text appears here ...

[Note that the blank between the boundary and the start
of the text in this part means no header fields were
given and this is text in the US-ASCII character set.
It could have been done with explicit typing as in the
next part.]

--unique-boundary-1
Content-type: text/plain; charset=US-ASCII

This could have been part of the previous part, but
illustrates explicit versus implicit typing of body
parts.

--unique-boundary-1
Content-Type: multipart/parallel; boundary=unique-boundary-2

--unique-boundary-2
Content-Type: audio/basic
Content-Transfer-Encoding: base64

... base64-encoded 8000 Hz single-channel
    mu-law-format audio data goes here ...

--unique-boundary-2
Content-Type: image/jpeg
Content-Transfer-Encoding: base64

... base64-encoded image data goes here ...

--unique-boundary-2--

--unique-boundary-1
Content-type: text/enriched

This is <bold><italic>enriched.</italic></bold>
<smaller>as defined in RFC 1896</smaller>

Isn't it
<bigger><bigger>cool?</bigger></bigger>

--unique-boundary-1
Content-Type: message/rfc822

From: (mailbox in US-ASCII)
To: (address in US-ASCII)
Subject: (subject in US-ASCII)
Content-Type: Text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: Quoted-printable

... Additional text in ISO-8859-1 goes here ...

--unique-boundary-1--

---- EXPECTED STRUCTURE ----
{
  "headers": {
    "values": {
      "date": {
        "DateTime": {
          "year": 1994,
          "month": 10,
          "day": 7,
          "hour": 16,
          "minute": 15,
          "second": 5,
          "tz_before_gmt": true,
          "tz_hour": 7,
          "tz_minute": 0
        }
      },
      "to": {
        "Address": {
          "name": "Ned Freed",
          "address": "ned@innosoft.com"
        }
      },
      "mime_version": {
        "Text": "1.0"
      },
      "subject": {
        "Text": "A multipart example"
      },
      "content_type": {
        "ContentType": {
          "c_type": "multipart",
          "c_subtype": "mixed",
          "attributes": {
            "boundary": "unique-boundary-1"
          }
        }
      },
      "from": {
        "Address": {
          "name": "Nathaniel Borenstein",
          "address": "nsb@nsb.fv.com"
        }
      }
    },
    "offsets": [
      {
        "name": {
          "Rfc": "mime_version"
        },
        "start": 13,
        "end": 18
      },
      {
        "name": {
          "Rfc": "from"
        },
        "start": 23,
        "end": 62
      },
      {
        "name": {
          "Rfc": "to"
        },
        "start": 65,
        "end": 95
      },
      {
        "name": {
          "Rfc": "date"
        },
        "start": 100,
        "end": 139
      },
      {
        "name": {
          "Rfc": "subject"
        },
        "start": 147,
        "end": 168
      },
      {
        "name": {
          "Rfc": "content_type"
        },
        "start": 181,
        "end": 238
      }
    ]
  },
  "html_body": [
    0,
    1
  ],
  "text_body": [
    0,
    1
  ],
  "attachments": [
    {
      "Attachment": 3
    },
    {
      "Attachment": 4
    },
    {
      "Attachment": 5
    },
    {
      "Attachment": 7
    }
  ],
  "parts": [
    {
      "Text": {
        "contents": "... Some text appears here ...\n\n[Note that the blank between the boundary and the start\nof the text in this part means no header fields were\ngiven and this is text in the US-ASCII character set.\nIt could have been done with explicit typing as in the\nnext part.]\n",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "US-ASCII"
                }
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 827,
              "end": 857
            }
          ]
        },
        "contents": "This could have been part of the previous part, but\nillustrates explicit versus implicit typing of body\nparts.\n",
        "is_html": false
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "parallel",
              "attributes": {
                "boundary": "unique-boundary-2"
              }
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 1003,
            "end": 1051
          }
        ]
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "audio",
                "c_subtype": "basic"
              }
            },
            "content_transfer_encoding": {
              "Text": "base64"
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 1085,
              "end": 1098
            },
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 1124,
              "end": 1132
            }
          ]
        },
        "contents": "... base64-encoded 8000 Hz single-channel\n    mu-law-format audio data goes here ...\n",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "image",
                "c_subtype": "jpeg"
              }
            },
            "content_transfer_encoding": {
              "Text": "base64"
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 1252,
              "end": 1264
            },
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 1290,
              "end": 1298
            }
          ]
        },
        "contents": "... base64-encoded image data goes here ...\n",
        "is_html": false
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "enriched"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 1400,
              "end": 1415
            }
          ]
        },
        "contents": "This is <bold><italic>enriched.</italic></bold>\n<smaller>as defined in RFC 1896</smaller>\n\nIsn't it\n<bigger><bigger>cool?</bigger></bigger>\n",
        "is_html": false
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "message",
              "c_subtype": "rfc822"
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 1590,
            "end": 1606
          }
        ]
      }
    },
    {
      "Message": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "ISO-8859-1"
                }
              }
            },
            "from": {
              "Address": {
                "name": "mailbox in US-ASCII"
              }
            },
            "to": {
              "Address": {
                "name": "address in US-ASCII"
              }
            },
            "content_transfer_encoding": {
              "Text": "Quoted-printable"
            },
            "subject": {
              "Text": "(subject in US-ASCII)"
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "from"
              },
              "start": 1612,
              "end": 1635
            },
            {
              "name": {
                "Rfc": "to"
              },
              "start": 1638,
              "end": 1661
            },
            {
              "name": {
                "Rfc": "subject"
              },
              "start": 1669,
              "end": 1692
            },
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 1705,
              "end": 1737
            },
            {
              "name": {
                "Rfc": "content_transfer_encoding"
              },
              "start": 1763,
              "end": 1781
            }
          ]
        },
        "html_body": [
          0
        ],
        "text_body": [
          0
        ],
        "parts": [
          {
            "Text": {
              "contents": "... Additional text in ISO-8859-1 goes here ...\n",
              "is_html": false
            }
          }
        ],
        "structure": {
          "Part": 0
        },
        "offset_header": 1607,
        "offset_body": 1782,
        "offset_end": 1850
      }
    }
  ],
  "structure": {
    "List": [
      {
        "Part": 0
      },
      {
        "Part": 1
      },
      {
        "MultiPart": [
          2,
          [
            {
              "Part": 3
            },
            {
              "Part": 4
            }
          ]
        ]
      },
      {
        "Part": 5
      },
      {
        "Part": 6
      }
    ]
  },
  "offset_header": 0,
  "offset_body": 239,
  "offset_end": 1852
}