-
- - - - - - - - -
-
|
-
-
- |
-
-
|
-
-
|
-
-
|
-
-
|
-
-
- |
-
-
|
-
-
|
-
-
- |
-
-
|
-
-
|
-
-
|
-
-
- |
-
-
|
-
-
|
-
-
|
-
-
|
-
|
-
-
-
-
-
-
- |
-
|
-
-
-
-
-
-
- |
-
| - - - - - - | -
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
|
-
-
-
-
-
-
-
|
-
Don't find me here
+ +--3 +Content-Type: text/plain +Content-Transfer-Encoding: binary + +Search me, and Find me here +--3-- + +--2 +Content-Type: signature/plain; charset=us-ascii + +Signed by undersigned +--2-- + +--1-- +---- EXPECTED STRUCTURE ---- +{ + "header": { + "mime_version": "1.0", + "subject": "Hide and seek", + "content_type": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "1" + } + } + }, + "html_body": [ + { + "header": { + "content_type": { + "c_type": "text", + "c_subtype": "html", + "attributes": { + "charset": "us-ascii" + } + } + }, + "contents": "Don't find me here
\n" + } + ], + "text_body": [ + { + "header": { + "content_transfer_encoding": "binary", + "content_type": { + "c_type": "text", + "c_subtype": "plain" + } + }, + "contents": "Search me, and Find me here" + } + ], + "attachments": [ + { + "Binary": { + "header": { + "content_type": { + "c_type": "signature", + "c_subtype": "plain", + "attributes": { + "charset": "us-ascii" + } + } + }, + "contents": [ + 83, + 105, + 103, + 110, + 101, + 100, + 32, + 98, + 121, + 32, + 117, + 110, + 100, + 101, + 114, + 115, + 105, + 103, + 110, + 101, + 100 + ] + } + } + ] +} \ No newline at end of file diff --git a/tests/thirdparty/007.txt b/tests/thirdparty/007.txt new file mode 100644 index 0000000..7fce7f7 --- /dev/null +++ b/tests/thirdparty/007.txt @@ -0,0 +1,162 @@ +From: Moderator-AddressHello world
+ +--sub1 +Content-Type: multipart/alternative; boundary="sub2" + +--sub2 +Content-Type: multipart/alternative; boundary="sub3" + +--sub3 + +sub3 text +--sub3 + +sub3 text2 +--sub3-- + +sub2 text +--sub2 + +sub2 text2 +--sub2-- +--sub1-- +Sub MIME epilogue + +--foo bar +Content-Type: text/plain + +Another part +--foo bar-- +Root MIME epilogue + + +---- EXPECTED STRUCTURE ---- +{ + "header": { + "date": { + "year": 2007, + "month": 3, + "day": 24, + "hour": 23, + "minute": 0, + "second": 0, + "tz_before_gmt": false, + "tz_hour": 2, + "tz_minute": 0 + }, + "from": { + "Address": { + "address": "user@domain.org" + } + }, + "mime_version": "1.0", + "content_type": { + "c_type": "multipart", + "c_subtype": "mixed", + "attributes": { + "boundary": "foo bar" + } + }, + "others": { + "From user@domain Fri Feb 22 17": [ + "06:23 2008" + ] + } + }, + "html_body": [ + { + "contents": "Another part" + } + ], + "text_body": [ + { + "header": { + "content_type": { + "c_type": "text", + "c_subtype": "plain" + } + }, + "contents": "Another part" + } + ], + "attachments": [ + { + "Text": { + "header": { + "content_type": { + "c_type": "text", + "c_subtype": "x-myown", + "attributes": { + "charset": "us-ascii" + } + } + }, + "contents": "hello\n" + } + }, + { + "Message": { + "header": { + "date": { + "year": 2012, + "month": 8, + "day": 12, + "hour": 12, + "minute": 34, + "second": 56, + "tz_before_gmt": false, + "tz_hour": 3, + "tz_minute": 0 + }, + "from": { + "Address": { + "address": "sub@domain.org" + } + }, + "subject": "submsg", + "content_type": { + "c_type": "multipart", + "c_subtype": "alternative", + "attributes": { + "boundary": "sub1" + } + } + }, + "html_body": [ + { + "header": { + "content_type": { + "c_type": "text", + "c_subtype": "html" + } + }, + "contents": "Hello world
\n" + }, + { + "contents": "sub3 text" + }, + { + "contents": "sub3 text2" + } + ], + "text_body": [ + { + "contents": "sub3 text" + }, + { + "contents": "sub3 text2" + }, + { + "contents": "sub2 text2" + } + ] + } + } + ] +} \ No newline at end of file diff --git a/tests/thirdparty/009.txt b/tests/thirdparty/009.txt new file mode 100644 index 0000000..2570882 --- /dev/null +++ b/tests/thirdparty/009.txt @@ -0,0 +1,312 @@ +Subject: In parts +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary=1 + +--1 +Content-Type: text/plain +Content-Transfer-Encoding: binary + +Hi, this is the fancy thing I was talking about! +--1 +Content-Type: Message/Partial; number=1; total=5; id="heks68ewe@example.org" + +X-Weird-Header-1: Bar +X-Weird-Header-2: Hello +Message-ID: