From: Moderator-Address <moderator>
Content-Type: multipart/digest; boundary=1;


--1

From: someone-else <someone@else>
Subject: my opinion

This is my opinion
--1

From: another one <another@one>
Subject: i disagree

Not agreeing one bit!
--1

From: attachment <attachment@user>
Subject: funny hat
Content-Type: multipart/mixed; boundary=2

--2
Content-Type: text/plain
Content-Transfer-Encoding: binary

Lovely attachment for you
--2
Content-Type: application/octet-stream; disposition=attachment; name="test.txt"
Content-Transfer-Encoding: binary

Foobar
--2--
--1--
---- EXPECTED STRUCTURE ----{
  "html_body": [],
  "text_body": [],
  "attachments": [
    1,
    2,
    3
  ],
  "parts": [
    {
      "headers_rfc": {
        "from": {
          "Address": {
            "name": "Moderator-Address",
            "address": "moderator"
          }
        },
        "content_type": {
          "ContentType": {
            "c_type": "multipart",
            "c_subtype": "digest",
            "attributes": {
              "boundary": "1"
            }
          }
        }
      },
      "headers_raw": [
        [
          {
            "Rfc": "from"
          },
          {
            "start": 5,
            "end": 36
          }
        ],
        [
          {
            "Rfc": "content_type"
          },
          {
            "start": 49,
            "end": 80
          }
        ]
      ],
      "is_encoding_problem": false,
      "body": {
        "Multipart": [
          1,
          2,
          3
        ]
      },
      "offset_header": 0,
      "offset_body": 81,
      "offset_end": 570
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "message",
            "c_subtype": "rfc822",
            "attributes": null
          }
        }
      },
      "headers_raw": [],
      "is_encoding_problem": false,
      "body": {
        "Message": {
          "html_body": [
            0
          ],
          "text_body": [
            0
          ],
          "attachments": [],
          "parts": [
            {
              "headers_rfc": {
                "subject": {
                  "Text": "my opinion"
                },
                "from": {
                  "Address": {
                    "name": "someone-else",
                    "address": "someone@else"
                  }
                }
              },
              "is_encoding_problem": false,
              "body": {
                "Text": "This is my opinion"
              },
              "offset_header": 87,
              "offset_body": 142,
              "offset_end": 161
            }
          ]
        }
      },
      "offset_header": 86,
      "offset_body": 87,
      "offset_end": 161
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "message",
            "c_subtype": "rfc822",
            "attributes": null
          }
        }
      },
      "headers_raw": [],
      "is_encoding_problem": false,
      "body": {
        "Message": {
          "html_body": [
            0
          ],
          "text_body": [
            0
          ],
          "attachments": [],
          "parts": [
            {
              "headers_rfc": {
                "from": {
                  "Address": {
                    "name": "another one",
                    "address": "another@one"
                  }
                },
                "subject": {
                  "Text": "i disagree"
                }
              },
              "is_encoding_problem": false,
              "body": {
                "Text": "Not agreeing one bit!"
              },
              "offset_header": 166,
              "offset_body": 219,
              "offset_end": 241
            }
          ]
        }
      },
      "offset_header": 165,
      "offset_body": 166,
      "offset_end": 241
    },
    {
      "headers_rfc": {
        "content_type": {
          "ContentType": {
            "c_type": "message",
            "c_subtype": "rfc822",
            "attributes": null
          }
        }
      },
      "headers_raw": [],
      "is_encoding_problem": false,
      "body": {
        "Message": {
          "html_body": [
            1
          ],
          "text_body": [
            1
          ],
          "attachments": [
            2
          ],
          "parts": [
            {
              "headers_rfc": {
                "subject": {
                  "Text": "funny hat"
                },
                "content_type": {
                  "ContentType": {
                    "c_type": "multipart",
                    "c_subtype": "mixed",
                    "attributes": {
                      "boundary": "2"
                    }
                  }
                },
                "from": {
                  "Address": {
                    "name": "attachment",
                    "address": "attachment@user"
                  }
                }
              },
              "is_encoding_problem": false,
              "body": {
                "Multipart": [
                  1,
                  2
                ]
              },
              "offset_header": 246,
              "offset_body": 343,
              "offset_end": 565
            },
            {
              "headers_rfc": {
                "content_transfer_encoding": {
                  "Text": "binary"
                },
                "content_type": {
                  "ContentType": {
                    "c_type": "text",
                    "c_subtype": "plain",
                    "attributes": null
                  }
                }
              },
              "is_encoding_problem": false,
              "body": {
                "Text": "Lovely attachment for you"
              },
              "offset_header": 347,
              "offset_body": 407,
              "offset_end": 433
            },
            {
              "headers_rfc": {
                "content_type": {
                  "ContentType": {
                    "c_type": "application",
                    "c_subtype": "octet-stream",
                    "attributes": {
                      "disposition": "attachment",
                      "name": "test.txt"
                    }
                  }
                },
                "content_transfer_encoding": {
                  "Text": "binary"
                }
              },
              "is_encoding_problem": false,
              "body": {
                "Binary": [
                  70,
                  111,
                  111,
                  98,
                  97,
                  114
                ]
              },
              "offset_header": 437,
              "offset_body": 552,
              "offset_end": 559
            }
          ]
        }
      },
      "offset_header": 245,
      "offset_body": 246,
      "offset_end": 565
    }
  ]
}