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 ----{
  "html_body": [
    1,
    9,
    14
  ],
  "text_body": [
    1,
    5,
    6,
    7,
    14
  ],
  "attachments": [
    6,
    10,
    11,
    12,
    13
  ],
  "parts": [
    {
      "headers_rfc": {
        "subject": {
          "Text": "RFC 8621 Section 4.1.4 test"
        },
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "mixed",
            "attributes": {
              "boundary": "1"
            }
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "subject"
          },
          {
            "start": 8,
            "end": 37
          }
        ],
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 50,
            "end": 81
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          1,
          2,
          14
        ]
      },
      "offset_header": 0,
      "offset_body": 82,
      "offset_end": 870
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "text",
            "c_subtype": "plain",
            "attributes": null
          }
        },
        "content_disposition": {
          "ContentType": {
            "c_type": "inline",
            "c_subtype": null,
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 99,
            "end": 111
          }
        ],
        [
          {
            "Rfc": "content_disposition"
          },
          {
            "start": 131,
            "end": 139
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Text": "A"
      },
      "offset_header": 86,
      "offset_body": 140,
      "offset_end": 142
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "mixed",
            "attributes": {
              "boundary": "2"
            }
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 161,
            "end": 192
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          3,
          11,
          12,
          13
        ]
      },
      "offset_header": 148,
      "offset_body": 193,
      "offset_end": 801
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "alternative",
            "attributes": {
              "boundary": "3"
            }
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 210,
            "end": 247
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          4,
          8
        ]
      },
      "offset_header": 197,
      "offset_body": 248,
      "offset_end": 634
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "mixed",
            "attributes": {
              "boundary": "4"
            }
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 265,
            "end": 296
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          5,
          6,
          7
        ]
      },
      "offset_header": 252,
      "offset_body": 297,
      "offset_end": 487
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "text",
            "c_subtype": "plain",
            "attributes": null
          }
        },
        "content_disposition": {
          "ContentType": {
            "c_type": "inline",
            "c_subtype": null,
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 314,
            "end": 326
          }
        ],
        [
          {
            "Rfc": "content_disposition"
          },
          {
            "start": 346,
            "end": 354
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Text": "B"
      },
      "offset_header": 301,
      "offset_body": 355,
      "offset_end": 357
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "image",
            "c_subtype": "jpeg",
            "attributes": null
          }
        },
        "content_disposition": {
          "ContentType": {
            "c_type": "inline",
            "c_subtype": null,
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 376,
            "end": 388
          }
        ],
        [
          {
            "Rfc": "content_disposition"
          },
          {
            "start": 408,
            "end": 416
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "InlineBinary": [
          67
        ]
      },
      "offset_header": 363,
      "offset_body": 417,
      "offset_end": 419
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "text",
            "c_subtype": "plain",
            "attributes": null
          }
        },
        "content_disposition": {
          "ContentType": {
            "c_type": "inline",
            "c_subtype": null,
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 438,
            "end": 450
          }
        ],
        [
          {
            "Rfc": "content_disposition"
          },
          {
            "start": 470,
            "end": 478
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Text": "D"
      },
      "offset_header": 425,
      "offset_body": 479,
      "offset_end": 481
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "related",
            "attributes": {
              "boundary": "5"
            }
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 506,
            "end": 539
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          9,
          10
        ]
      },
      "offset_header": 493,
      "offset_body": 540,
      "offset_end": 626
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "text",
            "c_subtype": "html",
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 557,
            "end": 568
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Html": "<html>E</html>"
      },
      "offset_header": 544,
      "offset_body": 569,
      "offset_end": 584
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "image",
            "c_subtype": "jpeg",
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 603,
            "end": 615
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Binary": [
          70
        ]
      },
      "offset_header": 590,
      "offset_body": 616,
      "offset_end": 618
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "image",
            "c_subtype": "jpeg",
            "attributes": null
          }
        },
        "content_disposition": {
          "ContentType": {
            "c_type": "attachment",
            "c_subtype": null,
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 655,
            "end": 667
          }
        ],
        [
          {
            "Rfc": "content_disposition"
          },
          {
            "start": 687,
            "end": 699
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Binary": [
          71
        ]
      },
      "offset_header": 642,
      "offset_body": 700,
      "offset_end": 702
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "application",
            "c_subtype": "x-excel",
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 721,
            "end": 742
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Binary": [
          72
        ]
      },
      "offset_header": 708,
      "offset_body": 743,
      "offset_end": 745
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "message",
            "c_subtype": "rfc822",
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 764,
            "end": 780
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Message": {
          "html_body": [
            0
          ],
          "text_body": [
            0
          ],
          "attachments": [],
          "parts": [
            {
              "headers_rfc": {
                "subject": {
                  "Text": "J"
                }
              },
              "is_encoding_problem": false,
              "body": {
                "Text": "J"
              },
              "offset_header": 781,
              "offset_body": 793,
              "offset_end": 795
            }
          ]
        }
      },
      "offset_header": 751,
      "offset_body": 781,
      "offset_end": 795
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "text",
            "c_subtype": "plain",
            "attributes": null
          }
        },
        "content_disposition": {
          "ContentType": {
            "c_type": "inline",
            "c_subtype": null,
            "attributes": null
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 821,
            "end": 833
          }
        ],
        [
          {
            "Rfc": "content_disposition"
          },
          {
            "start": 853,
            "end": 861
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Text": "K"
      },
      "offset_header": 808,
      "offset_body": 862,
      "offset_end": 864
    }
  ]
}