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_rfc": {
    "content_type": {
      "ContentType": {
        "c_type": "multipart",
        "c_subtype": "mixed",
        "attributes": {
          "boundary": "unique-boundary-1"
        }
      }
    },
    "mime_version": {
      "Text": "1.0"
    },
    "to": {
      "Address": {
        "name": "Ned Freed",
        "address": "ned@innosoft.com"
      }
    },
    "from": {
      "Address": {
        "name": "Nathaniel Borenstein",
        "address": "nsb@nsb.fv.com"
      }
    },
    "subject": {
      "Text": "A multipart example"
    },
    "date": {
      "DateTime": {
        "year": 1994,
        "month": 10,
        "day": 7,
        "hour": 16,
        "minute": 15,
        "second": 5,
        "tz_before_gmt": true,
        "tz_hour": 7,
        "tz_minute": 0
      }
    }
  },
  "headers_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": [
    3,
    4,
    5,
    6
  ],
  "parts": [
    {
      "Text": {
        "body": "... 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"
      }
    },
    {
      "Text": {
        "headers": {
          "content_type": {
            "ContentType": {
              "c_type": "text",
              "c_subtype": "plain",
              "attributes": {
                "charset": "US-ASCII"
              }
            }
          }
        },
        "body": "This could have been part of the previous part, but\nillustrates explicit versus implicit typing of body\nparts.\n"
      }
    },
    {
      "Multipart": {
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "parallel",
            "attributes": {
              "boundary": "unique-boundary-2"
            }
          }
        }
      }
    },
    {
      "Text": {
        "headers": {
          "content_transfer_encoding": {
            "Text": "base64"
          },
          "content_type": {
            "ContentType": {
              "c_type": "audio",
              "c_subtype": "basic"
            }
          }
        },
        "body": "... base64-encoded 8000 Hz single-channel\n    mu-law-format audio data goes here ...\n"
      }
    },
    {
      "Text": {
        "headers": {
          "content_transfer_encoding": {
            "Text": "base64"
          },
          "content_type": {
            "ContentType": {
              "c_type": "image",
              "c_subtype": "jpeg"
            }
          }
        },
        "body": "... base64-encoded image data goes here ...\n"
      }
    },
    {
      "Text": {
        "headers": {
          "content_type": {
            "ContentType": {
              "c_type": "text",
              "c_subtype": "enriched"
            }
          }
        },
        "body": "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"
      }
    },
    {
      "Message": {
        "headers": {
          "content_type": {
            "ContentType": {
              "c_type": "message",
              "c_subtype": "rfc822"
            }
          }
        },
        "body": {
          "headers_rfc": {
            "to": {
              "Address": {
                "name": "address in US-ASCII"
              }
            },
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain",
                "attributes": {
                  "charset": "ISO-8859-1"
                }
              }
            },
            "from": {
              "Address": {
                "name": "mailbox in US-ASCII"
              }
            },
            "content_transfer_encoding": {
              "Text": "Quoted-printable"
            },
            "subject": {
              "Text": "(subject in US-ASCII)"
            }
          },
          "headers_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": {
                "body": "... Additional text in ISO-8859-1 goes here ...\n"
              }
            }
          ],
          "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
}