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 ----
{
  "headers": {
    "from": {
      "Address": {
        "name": "Moderator-Address",
        "address": "moderator"
      }
    },
    "content_type": {
      "ContentType": {
        "c_type": "multipart",
        "c_subtype": "digest",
        "attributes": {
          "boundary": "1"
        }
      }
    }
  },
  "attachments": [
    {
      "Message": {
        "headers": {
          "subject": {
            "Text": "my opinion"
          },
          "from": {
            "Address": {
              "name": "someone-else",
              "address": "someone@else"
            }
          }
        },
        "html_body": [
          {
            "contents": "<html><body>This is my opinion</body></html>"
          }
        ],
        "text_body": [
          {
            "contents": "This is my opinion"
          }
        ]
      }
    },
    {
      "Message": {
        "headers": {
          "subject": {
            "Text": "i disagree"
          },
          "from": {
            "Address": {
              "name": "another one",
              "address": "another@one"
            }
          }
        },
        "html_body": [
          {
            "contents": "<html><body>Not agreeing one bit!</body></html>"
          }
        ],
        "text_body": [
          {
            "contents": "Not agreeing one bit!"
          }
        ]
      }
    },
    {
      "Message": {
        "headers": {
          "subject": {
            "Text": "funny hat"
          },
          "from": {
            "Address": {
              "name": "attachment",
              "address": "attachment@user"
            }
          },
          "content_type": {
            "ContentType": {
              "c_type": "multipart",
              "c_subtype": "mixed",
              "attributes": {
                "boundary": "2"
              }
            }
          }
        },
        "html_body": [
          {
            "contents": "<html><body>Lovely attachment for you</body></html>"
          }
        ],
        "text_body": [
          {
            "headers": {
              "content_type": {
                "ContentType": {
                  "c_type": "text",
                  "c_subtype": "plain"
                }
              },
              "content_transfer_encoding": {
                "Text": "binary"
              }
            },
            "contents": "Lovely attachment for you"
          }
        ],
        "attachments": [
          {
            "Binary": {
              "headers": {
                "content_transfer_encoding": {
                  "Text": "binary"
                },
                "content_type": {
                  "ContentType": {
                    "c_type": "application",
                    "c_subtype": "octet-stream",
                    "attributes": {
                      "name": "test.txt",
                      "disposition": "attachment"
                    }
                  }
                }
              },
              "contents": [
                70,
                111,
                111,
                98,
                97,
                114
              ]
            }
          }
        ]
      }
    }
  ]
}