Subject: RFC 8621 Section 4.1.4 test
Content-Type: multipart/mixed; boundary="1"

--1
Content-Type: text/plain
Content-Disposition: inline

A
--1  
Content-Type: multipart/mixed; boundary="2"

--2
Content-Type: multipart/alternative; boundary="3"

--3
Content-Type: multipart/mixed; boundary="4"

--4
Content-Type: text/plain
Content-Disposition: inline

B
--4  
Content-Type: image/jpeg
Content-Disposition: inline

C
--4  
Content-Type: text/plain
Content-Disposition: inline

D
--4--

--3 
Content-Type: multipart/related; boundary="5"

--5
Content-Type: text/html

<html>E</html>
--5  
Content-Type: image/jpeg

F
--5--  

--3-- 

--2   
Content-Type: image/jpeg
Content-Disposition: attachment

G
--2  
Content-Type: application/x-excel

H
--2  
Content-Type: message/rfc822

Subject: J

J
--2--

--1  
Content-Type: text/plain
Content-Disposition: inline

K
--1--

---- EXPECTED STRUCTURE ----
{
  "headers": {
    "values": {
      "subject": {
        "Text": "RFC 8621 Section 4.1.4 test"
      },
      "content_type": {
        "ContentType": {
          "c_type": "multipart",
          "c_subtype": "mixed",
          "attributes": {
            "boundary": "1"
          }
        }
      }
    },
    "offsets": [
      {
        "name": {
          "Rfc": "subject"
        },
        "start": 8,
        "end": 37
      },
      {
        "name": {
          "Rfc": "content_type"
        },
        "start": 50,
        "end": 81
      }
    ]
  },
  "html_body": [
    0,
    8,
    14
  ],
  "text_body": [
    0,
    4,
    5,
    6,
    14
  ],
  "attachments": [
    {
      "Inline": 5
    },
    {
      "Attachment": 9
    },
    {
      "Attachment": 10
    },
    {
      "Attachment": 11
    },
    {
      "Attachment": 13
    }
  ],
  "parts": [
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain"
              }
            },
            "content_disposition": {
              "ContentType": {
                "c_type": "inline"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 99,
              "end": 111
            },
            {
              "name": {
                "Rfc": "content_disposition"
              },
              "start": 131,
              "end": 139
            }
          ]
        },
        "contents": "A",
        "is_html": false
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "mixed",
              "attributes": {
                "boundary": "2"
              }
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 161,
            "end": 192
          }
        ]
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "alternative",
              "attributes": {
                "boundary": "3"
              }
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 210,
            "end": 247
          }
        ]
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "mixed",
              "attributes": {
                "boundary": "4"
              }
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 265,
            "end": 296
          }
        ]
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain"
              }
            },
            "content_disposition": {
              "ContentType": {
                "c_type": "inline"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 314,
              "end": 326
            },
            {
              "name": {
                "Rfc": "content_disposition"
              },
              "start": 346,
              "end": 354
            }
          ]
        },
        "contents": "B",
        "is_html": false
      }
    },
    {
      "Binary": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "image",
                "c_subtype": "jpeg"
              }
            },
            "content_disposition": {
              "ContentType": {
                "c_type": "inline"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 376,
              "end": 388
            },
            {
              "name": {
                "Rfc": "content_disposition"
              },
              "start": 408,
              "end": 416
            }
          ]
        },
        "contents": [
          67
        ]
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain"
              }
            },
            "content_disposition": {
              "ContentType": {
                "c_type": "inline"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 438,
              "end": 450
            },
            {
              "name": {
                "Rfc": "content_disposition"
              },
              "start": 470,
              "end": 478
            }
          ]
        },
        "contents": "D",
        "is_html": false
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "related",
              "attributes": {
                "boundary": "5"
              }
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 506,
            "end": 539
          }
        ]
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "html"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 557,
              "end": 568
            }
          ]
        },
        "contents": "<html>E</html>",
        "is_html": true
      }
    },
    {
      "Binary": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "image",
                "c_subtype": "jpeg"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 603,
              "end": 615
            }
          ]
        },
        "contents": [
          70
        ]
      }
    },
    {
      "Binary": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "image",
                "c_subtype": "jpeg"
              }
            },
            "content_disposition": {
              "ContentType": {
                "c_type": "attachment"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 655,
              "end": 667
            },
            {
              "name": {
                "Rfc": "content_disposition"
              },
              "start": 687,
              "end": 699
            }
          ]
        },
        "contents": [
          71
        ]
      }
    },
    {
      "Binary": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "application",
                "c_subtype": "x-excel"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 721,
              "end": 742
            }
          ]
        },
        "contents": [
          72
        ]
      }
    },
    {
      "Multipart": {
        "values": {
          "content_type": {
            "ContentType": {
              "c_type": "message",
              "c_subtype": "rfc822"
            }
          }
        },
        "offsets": [
          {
            "name": {
              "Rfc": "content_type"
            },
            "start": 764,
            "end": 780
          }
        ]
      }
    },
    {
      "Message": {
        "headers": {
          "values": {
            "subject": {
              "Text": "J"
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "subject"
              },
              "start": 789,
              "end": 792
            }
          ]
        },
        "html_body": [
          0
        ],
        "text_body": [
          0
        ],
        "parts": [
          {
            "Text": {
              "contents": "J",
              "is_html": false
            }
          }
        ],
        "structure": {
          "Part": 0
        },
        "offset_header": 781,
        "offset_body": 793,
        "offset_end": 798
      }
    },
    {
      "Text": {
        "headers": {
          "values": {
            "content_type": {
              "ContentType": {
                "c_type": "text",
                "c_subtype": "plain"
              }
            },
            "content_disposition": {
              "ContentType": {
                "c_type": "inline"
              }
            }
          },
          "offsets": [
            {
              "name": {
                "Rfc": "content_type"
              },
              "start": 821,
              "end": 833
            },
            {
              "name": {
                "Rfc": "content_disposition"
              },
              "start": 853,
              "end": 861
            }
          ]
        },
        "contents": "K",
        "is_html": false
      }
    }
  ],
  "structure": {
    "List": [
      {
        "Part": 0
      },
      {
        "MultiPart": [
          1,
          [
            {
              "MultiPart": [
                2,
                [
                  {
                    "MultiPart": [
                      3,
                      [
                        {
                          "Part": 4
                        },
                        {
                          "Part": 5
                        },
                        {
                          "Part": 6
                        }
                      ]
                    ]
                  },
                  {
                    "MultiPart": [
                      7,
                      [
                        {
                          "Part": 8
                        },
                        {
                          "Part": 9
                        }
                      ]
                    ]
                  }
                ]
              ]
            },
            {
              "Part": 10
            },
            {
              "Part": 11
            },
            {
              "Part": 12
            }
          ]
        ]
      },
      {
        "Part": 14
      }
    ]
  },
  "offset_header": 0,
  "offset_body": 82,
  "offset_end": 869
}