mirror of
https://github.com/stalwartlabs/mail-parser.git
synced 2026-11-30 00:01:25 +00:00
162 lines
3.3 KiB
Plaintext
162 lines
3.3 KiB
Plaintext
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 ----
|
|
{
|
|
"header": {
|
|
"from": {
|
|
"Address": {
|
|
"name": "Moderator-Address",
|
|
"address": "moderator"
|
|
}
|
|
},
|
|
"content_type": {
|
|
"c_type": "multipart",
|
|
"c_subtype": "digest",
|
|
"attributes": {
|
|
"boundary": "1"
|
|
}
|
|
}
|
|
},
|
|
"attachments": [
|
|
{
|
|
"Message": {
|
|
"header": {
|
|
"from": {
|
|
"Address": {
|
|
"name": "someone-else",
|
|
"address": "someone@else"
|
|
}
|
|
},
|
|
"subject": "my opinion"
|
|
},
|
|
"html_body": [
|
|
{
|
|
"contents": "<html><body>This is my opinion</body></html>"
|
|
}
|
|
],
|
|
"text_body": [
|
|
{
|
|
"contents": "This is my opinion"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"Message": {
|
|
"header": {
|
|
"from": {
|
|
"Address": {
|
|
"name": "another one",
|
|
"address": "another@one"
|
|
}
|
|
},
|
|
"subject": "i disagree"
|
|
},
|
|
"html_body": [
|
|
{
|
|
"contents": "<html><body>Not agreeing one bit!</body></html>"
|
|
}
|
|
],
|
|
"text_body": [
|
|
{
|
|
"contents": "Not agreeing one bit!"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"Message": {
|
|
"header": {
|
|
"from": {
|
|
"Address": {
|
|
"name": "attachment",
|
|
"address": "attachment@user"
|
|
}
|
|
},
|
|
"subject": "funny hat",
|
|
"content_type": {
|
|
"c_type": "multipart",
|
|
"c_subtype": "mixed",
|
|
"attributes": {
|
|
"boundary": "2"
|
|
}
|
|
}
|
|
},
|
|
"html_body": [
|
|
{
|
|
"contents": "<html><body>Lovely attachment for you</body></html>"
|
|
}
|
|
],
|
|
"text_body": [
|
|
{
|
|
"header": {
|
|
"content_transfer_encoding": "binary",
|
|
"content_type": {
|
|
"c_type": "text",
|
|
"c_subtype": "plain"
|
|
}
|
|
},
|
|
"contents": "Lovely attachment for you"
|
|
}
|
|
],
|
|
"attachments": [
|
|
{
|
|
"Binary": {
|
|
"header": {
|
|
"content_transfer_encoding": "binary",
|
|
"content_type": {
|
|
"c_type": "application",
|
|
"c_subtype": "octet-stream",
|
|
"attributes": {
|
|
"name": "test.txt",
|
|
"disposition": "attachment"
|
|
}
|
|
}
|
|
},
|
|
"contents": [
|
|
70,
|
|
111,
|
|
111,
|
|
98,
|
|
97,
|
|
114
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
} |