From 9675cdb545a139984a2d765397f3a5e26472a49e Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 8 Jul 2022 10:23:07 +0200 Subject: [PATCH] Use CRLF as line ending in test files --- src/imap/mailbox_view.rs | 3 +- tests/emails/legacy/001.eml | 70 +++++++-------- tests/emails/rfc/000.eml | 146 ++++++++++++++++---------------- tests/emails/rfc/001.eml | 82 +++++++++--------- tests/emails/rfc/002.eml | 146 ++++++++++++++++---------------- tests/emails/rfc/003.eml | 50 +++++------ tests/emails/rfc/004.eml | 72 ++++++++-------- tests/emails/rfc/005.eml | 50 +++++------ tests/emails/rfc/006.eml | 46 +++++----- tests/emails/rfc/007.eml | 146 ++++++++++++++++---------------- tests/emails/rfc/008.eml | 60 ++++++------- tests/emails/thirdparty/000.eml | 38 ++++----- tests/emails/thirdparty/001.eml | 48 +++++------ tests/emails/thirdparty/002.eml | 40 ++++----- tests/emails/thirdparty/003.eml | 70 +++++++-------- tests/emails/thirdparty/004.eml | 82 +++++++++--------- tests/emails/thirdparty/005.eml | Bin 611 -> 644 bytes tests/emails/thirdparty/006.eml | 60 ++++++------- tests/emails/thirdparty/007.eml | 68 +++++++-------- tests/emails/thirdparty/008.eml | 114 ++++++++++++------------- tests/emails/thirdparty/009.eml | 42 ++++----- tests/emails/thirdparty/010.eml | 24 +++--- tests/unix2dos.py | 15 ++++ 23 files changed, 744 insertions(+), 728 deletions(-) create mode 100755 tests/unix2dos.py diff --git a/src/imap/mailbox_view.rs b/src/imap/mailbox_view.rs index 29fb98a..bffcd9b 100644 --- a/src/imap/mailbox_view.rs +++ b/src/imap/mailbox_view.rs @@ -851,7 +851,7 @@ mod tests { for pref in prefixes.iter() { println!("{}", pref); let txt = fs::read(format!("{}.eml", pref))?; - let exp = fs::read(format!("{}.body", pref))?; + let exp = fs::read(format!("{}.dovecot.body", pref))?; let message = Message::parse(&txt).unwrap(); let mut resp = Vec::new(); @@ -864,6 +864,7 @@ mod tests { let exp_str = String::from_utf8_lossy(exp_no_parenthesis).to_lowercase(); println!("aerogramme: {}\ndovecot: {}", resp_str, exp_str); + //println!("\n\n {} \n\n", String::from_utf8_lossy(&resp)); assert_eq!(resp_str, exp_str); } diff --git a/tests/emails/legacy/001.eml b/tests/emails/legacy/001.eml index 1ca6368..b64ae80 100644 --- a/tests/emails/legacy/001.eml +++ b/tests/emails/legacy/001.eml @@ -1,35 +1,35 @@ -From: "Doug Sauder" -To: "Joe Blow" , - =?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= -Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?= -Date: Wed, 17 May 2000 19:18:39 -0400 -Message-ID: -MIME-Version: 1.0 -Content-Type: text/plain; - charset="utf-7" -Content-Transfer-Encoding: quoted-printable -X-Priority: 3 (Normal) -X-MSMail-Priority: Normal -X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) -Importance: Normal -X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 - -Die Hasen und die Fr+APY-sche - -Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir = -leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und = -Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- = -Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns = -ein f+APw-r allemal sterben.+ACI-=20 - -In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten = -ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre = -wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer = -sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20 - -+ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das = -Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie = -ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein = -m+APw-ssen als wir.+ACI-=20 - - +From: "Doug Sauder" +To: "Joe Blow" , + =?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= +Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?= +Date: Wed, 17 May 2000 19:18:39 -0400 +Message-ID: +MIME-Version: 1.0 +Content-Type: text/plain; + charset="utf-7" +Content-Transfer-Encoding: quoted-printable +X-Priority: 3 (Normal) +X-MSMail-Priority: Normal +X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) +Importance: Normal +X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 + +Die Hasen und die Fr+APY-sche + +Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir = +leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und = +Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- = +Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns = +ein f+APw-r allemal sterben.+ACI-=20 + +In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten = +ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre = +wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer = +sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20 + ++ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das = +Ers+AOQ-ufen noch ein wenig aufschieben, denn auch uns f+APw-rchten, wie = +ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein = +m+APw-ssen als wir.+ACI-=20 + + diff --git a/tests/emails/rfc/000.eml b/tests/emails/rfc/000.eml index 44a1588..2ab9eda 100644 --- a/tests/emails/rfc/000.eml +++ b/tests/emails/rfc/000.eml @@ -1,73 +1,73 @@ -MIME-Version: 1.0 -From: Nathaniel Borenstein -To: Ned Freed -Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) -Subject: A multipart example -Content-Type: multipart/mixed; - boundary=unique-boundary-1 - -This is the preamble area of a multipart message. -Mail readers that understand multipart format -should ignore this preamble. - -If you are reading this text, you might want to -consider changing to a mail reader that understands -how to properly display multipart messages. - ---unique-boundary-1 - -... Some text appears here ... - -[Note that the blank between the boundary and the start -of the text in this part means no header fields were -given and this is text in the US-ASCII character set. -It could have been done with explicit typing as in the -next part.] - ---unique-boundary-1 -Content-type: text/plain; charset=US-ASCII - -This could have been part of the previous part, but -illustrates explicit versus implicit typing of body -parts. - ---unique-boundary-1 -Content-Type: multipart/parallel; boundary=unique-boundary-2 - ---unique-boundary-2 -Content-Type: audio/basic -Content-Transfer-Encoding: base64 - -... base64-encoded 8000 Hz single-channel - mu-law-format audio data goes here ... - ---unique-boundary-2 -Content-Type: image/jpeg -Content-Transfer-Encoding: base64 - -... base64-encoded image data goes here ... - ---unique-boundary-2-- - ---unique-boundary-1 -Content-type: text/enriched - -This is enriched. -as defined in RFC 1896 - -Isn't it -cool? - ---unique-boundary-1 -Content-Type: message/rfc822 - -From: (mailbox in US-ASCII) -To: (address in US-ASCII) -Subject: (subject in US-ASCII) -Content-Type: Text/plain; charset=ISO-8859-1 -Content-Transfer-Encoding: Quoted-printable - -... Additional text in ISO-8859-1 goes here ... - ---unique-boundary-1-- - +MIME-Version: 1.0 +From: Nathaniel Borenstein +To: Ned Freed +Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) +Subject: A multipart example +Content-Type: multipart/mixed; + boundary=unique-boundary-1 + +This is the preamble area of a multipart message. +Mail readers that understand multipart format +should ignore this preamble. + +If you are reading this text, you might want to +consider changing to a mail reader that understands +how to properly display multipart messages. + +--unique-boundary-1 + +... Some text appears here ... + +[Note that the blank between the boundary and the start +of the text in this part means no header fields were +given and this is text in the US-ASCII character set. +It could have been done with explicit typing as in the +next part.] + +--unique-boundary-1 +Content-type: text/plain; charset=US-ASCII + +This could have been part of the previous part, but +illustrates explicit versus implicit typing of body +parts. + +--unique-boundary-1 +Content-Type: multipart/parallel; boundary=unique-boundary-2 + +--unique-boundary-2 +Content-Type: audio/basic +Content-Transfer-Encoding: base64 + +... base64-encoded 8000 Hz single-channel + mu-law-format audio data goes here ... + +--unique-boundary-2 +Content-Type: image/jpeg +Content-Transfer-Encoding: base64 + +... base64-encoded image data goes here ... + +--unique-boundary-2-- + +--unique-boundary-1 +Content-type: text/enriched + +This is enriched. +as defined in RFC 1896 + +Isn't it +cool? + +--unique-boundary-1 +Content-Type: message/rfc822 + +From: (mailbox in US-ASCII) +To: (address in US-ASCII) +Subject: (subject in US-ASCII) +Content-Type: Text/plain; charset=ISO-8859-1 +Content-Transfer-Encoding: Quoted-printable + +... Additional text in ISO-8859-1 goes here ... + +--unique-boundary-1-- + diff --git a/tests/emails/rfc/001.eml b/tests/emails/rfc/001.eml index 8b4abc8..41de580 100644 --- a/tests/emails/rfc/001.eml +++ b/tests/emails/rfc/001.eml @@ -1,41 +1,41 @@ -From: Whomever -To: Someone -Date: Whenever -Subject: whatever -MIME-Version: 1.0 -Message-ID: -Content-Type: multipart/alternative; boundary=42 -Content-ID: - ---42 -Content-Type: message/external-body; name="BodyFormats.ps"; - site="thumper.bellcore.com"; mode="image"; - access-type=ANON-FTP; directory="pub"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - -Content-type: application/postscript -Content-ID: - ---42 -Content-Type: message/external-body; access-type=local-file; - name="/u/nsb/writing/rfcs/RFC-MIME.ps"; - site="thumper.bellcore.com"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - -Content-type: application/postscript -Content-ID: - ---42 -Content-Type: message/external-body; - access-type=mail-server - server="listserv@bogus.bitnet"; - expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" - -Content-type: application/postscript -Content-ID: - -get RFC-MIME.DOC - ---42-- - - +From: Whomever +To: Someone +Date: Whenever +Subject: whatever +MIME-Version: 1.0 +Message-ID: +Content-Type: multipart/alternative; boundary=42 +Content-ID: + +--42 +Content-Type: message/external-body; name="BodyFormats.ps"; + site="thumper.bellcore.com"; mode="image"; + access-type=ANON-FTP; directory="pub"; + expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" + +Content-type: application/postscript +Content-ID: + +--42 +Content-Type: message/external-body; access-type=local-file; + name="/u/nsb/writing/rfcs/RFC-MIME.ps"; + site="thumper.bellcore.com"; + expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" + +Content-type: application/postscript +Content-ID: + +--42 +Content-Type: message/external-body; + access-type=mail-server + server="listserv@bogus.bitnet"; + expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" + +Content-type: application/postscript +Content-ID: + +get RFC-MIME.DOC + +--42-- + + diff --git a/tests/emails/rfc/002.eml b/tests/emails/rfc/002.eml index 750134f..1c2f5c4 100644 --- a/tests/emails/rfc/002.eml +++ b/tests/emails/rfc/002.eml @@ -1,73 +1,73 @@ -From: Al Gore -To: White House Transportation Coordinator - -Subject: [Fwd: Map of Argentina with Description] -Content-Type: multipart/mixed; - boundary="D7F------------D7FD5A0B8AB9C65CCDBFA872" - -This is a multi-part message in MIME format. ---D7F------------D7FD5A0B8AB9C65CCDBFA872 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Fred, - -Fire up Air Force One! We're going South! - -Thanks, -Al ---D7F------------D7FD5A0B8AB9C65CCDBFA872 -Content-Type: message/rfc822 -Content-Transfer-Encoding: 7bit -Content-Disposition: inline - -Return-Path: -Received: from mailhost.whitehouse.gov ([192.168.51.200]) - by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453 - for ; - Mon, 13 Aug 1998 l8:14:23 +1000 -Received: from the_big_box.whitehouse.gov ([192.168.51.50]) - by mailhost.whitehouse.gov (8.8.8/8.8.7) with ESMTP id RAA20366 - for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000 -Date: Mon, 13 Aug 1998 17:42:41 +1000 -Message-Id: <199804130742.RAA20366@mai1host.whitehouse.gov> -From: Bill Clinton -To: A1 (The Enforcer) Gore -Subject: Map of Argentina with Description -MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="DC8------------DC8638F443D87A7F0726DEF7" - -This is a multi-part message in MIME format. ---DC8------------DC8638F443D87A7F0726DEF7 -Content-Type: text/plain; charset=us-ascii -Content-Transfer-Encoding: 7bit - -Hi A1, - -I finally figured out this MIME thing. Pretty cool. I'll send you -some sax music in .au files next week! - -Anyway, the attached image is really too small to get a good look at -Argentina. Try this for a much better map: - - http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm - -Then again, shouldn't the CIA have something like that? - -Bill ---DC8------------DC8638F443D87A7F0726DEF7 -Content-Type: image/gif; name="map_of_Argentina.gif" -Content-Transfer-Encoding: base64 -Content-Disposition: inline; fi1ename="map_of_Argentina.gif" - -R01GOD1hJQA1AKIAAP/////78P/omn19fQAAAAAAAAAAAAAAACwAAAAAJQA1AAAD7Qi63P5w -wEmjBCLrnQnhYCgM1wh+pkgqqeC9XrutmBm7hAK3tP31gFcAiFKVQrGFR6kscnonTe7FAAad -GugmRu3CmiBt57fsVq3Y0VFKnpYdxPC6M7Ze4crnnHum4oN6LFJ1bn5NXTN7OF5fQkN5WYow -BEN2dkGQGWJtSzqGTICJgnQuTJN/WJsojad9qXMuhIWdjXKjY4tenjo6tjVssk2gaWq3uGNX -U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz -7itICBxISKDBgwgTKjyYAAA7 ---DC8------------DC8638F443D87A7F0726DEF7-- - ---D7F------------D7FD5A0B8AB9C65CCDBFA872-- - +From: Al Gore +To: White House Transportation Coordinator + +Subject: [Fwd: Map of Argentina with Description] +Content-Type: multipart/mixed; + boundary="D7F------------D7FD5A0B8AB9C65CCDBFA872" + +This is a multi-part message in MIME format. +--D7F------------D7FD5A0B8AB9C65CCDBFA872 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +Fred, + +Fire up Air Force One! We're going South! + +Thanks, +Al +--D7F------------D7FD5A0B8AB9C65CCDBFA872 +Content-Type: message/rfc822 +Content-Transfer-Encoding: 7bit +Content-Disposition: inline + +Return-Path: +Received: from mailhost.whitehouse.gov ([192.168.51.200]) + by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453 + for ; + Mon, 13 Aug 1998 l8:14:23 +1000 +Received: from the_big_box.whitehouse.gov ([192.168.51.50]) + by mailhost.whitehouse.gov (8.8.8/8.8.7) with ESMTP id RAA20366 + for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000 +Date: Mon, 13 Aug 1998 17:42:41 +1000 +Message-Id: <199804130742.RAA20366@mai1host.whitehouse.gov> +From: Bill Clinton +To: A1 (The Enforcer) Gore +Subject: Map of Argentina with Description +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="DC8------------DC8638F443D87A7F0726DEF7" + +This is a multi-part message in MIME format. +--DC8------------DC8638F443D87A7F0726DEF7 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit + +Hi A1, + +I finally figured out this MIME thing. Pretty cool. I'll send you +some sax music in .au files next week! + +Anyway, the attached image is really too small to get a good look at +Argentina. Try this for a much better map: + + http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm + +Then again, shouldn't the CIA have something like that? + +Bill +--DC8------------DC8638F443D87A7F0726DEF7 +Content-Type: image/gif; name="map_of_Argentina.gif" +Content-Transfer-Encoding: base64 +Content-Disposition: inline; fi1ename="map_of_Argentina.gif" + +R01GOD1hJQA1AKIAAP/////78P/omn19fQAAAAAAAAAAAAAAACwAAAAAJQA1AAAD7Qi63P5w +wEmjBCLrnQnhYCgM1wh+pkgqqeC9XrutmBm7hAK3tP31gFcAiFKVQrGFR6kscnonTe7FAAad +GugmRu3CmiBt57fsVq3Y0VFKnpYdxPC6M7Ze4crnnHum4oN6LFJ1bn5NXTN7OF5fQkN5WYow +BEN2dkGQGWJtSzqGTICJgnQuTJN/WJsojad9qXMuhIWdjXKjY4tenjo6tjVssk2gaWq3uGNX +U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz +7itICBxISKDBgwgTKjyYAAA7 +--DC8------------DC8638F443D87A7F0726DEF7-- + +--D7F------------D7FD5A0B8AB9C65CCDBFA872-- + diff --git a/tests/emails/rfc/003.eml b/tests/emails/rfc/003.eml index 57ffadd..3b0b945 100644 --- a/tests/emails/rfc/003.eml +++ b/tests/emails/rfc/003.eml @@ -1,25 +1,25 @@ -From: Nathaniel Borenstein -To: Ned Freed -Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) -Subject: Formatted text mail -MIME-Version: 1.0 -Content-Type: multipart/alternative; boundary=boundary42 - ---boundary42 -Content-Type: text/plain; charset=us-ascii - -... plain text version of message goes here ... - ---boundary42 -Content-Type: text/enriched - -... RFC 1896 text/enriched version of same message - goes here ... - ---boundary42 -Content-Type: application/x-whatever - -... fanciest version of same message goes here ... - ---boundary42-- - +From: Nathaniel Borenstein +To: Ned Freed +Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) +Subject: Formatted text mail +MIME-Version: 1.0 +Content-Type: multipart/alternative; boundary=boundary42 + +--boundary42 +Content-Type: text/plain; charset=us-ascii + +... plain text version of message goes here ... + +--boundary42 +Content-Type: text/enriched + +... RFC 1896 text/enriched version of same message + goes here ... + +--boundary42 +Content-Type: application/x-whatever + +... fanciest version of same message goes here ... + +--boundary42-- + diff --git a/tests/emails/rfc/004.eml b/tests/emails/rfc/004.eml index 55aebc0..fd114d4 100644 --- a/tests/emails/rfc/004.eml +++ b/tests/emails/rfc/004.eml @@ -1,36 +1,36 @@ -From: Moderator-Address -To: Recipient-List -Date: Mon, 22 Mar 1994 13:34:51 +0000 -Subject: Internet Digest, volume 42 -MIME-Version: 1.0 -Content-Type: multipart/mixed; - boundary="---- main boundary ----" - ------- main boundary ---- - -...Introductory text or table of contents... - ------- main boundary ---- -Content-Type: multipart/digest; - boundary="---- next message ----" - ------- next message ---- - -From: someone-else -Date: Fri, 26 Mar 1993 11:13:32 +0200 -Subject: my opinion - -...body goes here ... - ------- next message ---- - -From: someone-else-again -Date: Fri, 26 Mar 1993 10:07:13 -0500 -Subject: my different opinion - -... another body goes here ... - ------- next message ------ - ------- main boundary ------ - +From: Moderator-Address +To: Recipient-List +Date: Mon, 22 Mar 1994 13:34:51 +0000 +Subject: Internet Digest, volume 42 +MIME-Version: 1.0 +Content-Type: multipart/mixed; + boundary="---- main boundary ----" + +------ main boundary ---- + +...Introductory text or table of contents... + +------ main boundary ---- +Content-Type: multipart/digest; + boundary="---- next message ----" + +------ next message ---- + +From: someone-else +Date: Fri, 26 Mar 1993 11:13:32 +0200 +Subject: my opinion + +...body goes here ... + +------ next message ---- + +From: someone-else-again +Date: Fri, 26 Mar 1993 10:07:13 -0500 +Subject: my different opinion + +... another body goes here ... + +------ next message ------ + +------ main boundary ------ + diff --git a/tests/emails/rfc/005.eml b/tests/emails/rfc/005.eml index b4fe65e..f8a1a8a 100644 --- a/tests/emails/rfc/005.eml +++ b/tests/emails/rfc/005.eml @@ -1,25 +1,25 @@ -From: Nathaniel Borenstein -To: Ned Freed -Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) -Subject: Sample message -MIME-Version: 1.0 -Content-type: multipart/mixed; boundary="simple boundary" - -This is the preamble. It is to be ignored, though it -is a handy place for composition agents to include an -explanatory note to non-MIME conformant readers. - ---simple boundary - -This is implicitly typed plain US-ASCII text. -It does NOT end with a linebreak. ---simple boundary -Content-type: text/plain; charset=us-ascii - -This is explicitly typed plain US-ASCII text. -It DOES end with a linebreak. - ---simple boundary-- - -This is the epilogue. It is also to be ignored. - +From: Nathaniel Borenstein +To: Ned Freed +Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) +Subject: Sample message +MIME-Version: 1.0 +Content-type: multipart/mixed; boundary="simple boundary" + +This is the preamble. It is to be ignored, though it +is a handy place for composition agents to include an +explanatory note to non-MIME conformant readers. + +--simple boundary + +This is implicitly typed plain US-ASCII text. +It does NOT end with a linebreak. +--simple boundary +Content-type: text/plain; charset=us-ascii + +This is explicitly typed plain US-ASCII text. +It DOES end with a linebreak. + +--simple boundary-- + +This is the epilogue. It is also to be ignored. + diff --git a/tests/emails/rfc/006.eml b/tests/emails/rfc/006.eml index f353adb..853e663 100644 --- a/tests/emails/rfc/006.eml +++ b/tests/emails/rfc/006.eml @@ -1,23 +1,23 @@ -From: sender@example.com -To: recipient@example.com -Subject: Multipart Email Example -Content-Type: multipart/alternative; boundary="boundary-string" - ---boundary-string -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -Plain text email goes here! -This is the fallback if email client does not support HTML - ---boundary-string -Content-Type: text/html; charset="utf-8" -Content-Transfer-Encoding: quoted-printable -Content-Disposition: inline - -

This is the HTML Section!

-

This is what displays in most modern email clients

- ---boundary-string-- - +From: sender@example.com +To: recipient@example.com +Subject: Multipart Email Example +Content-Type: multipart/alternative; boundary="boundary-string" + +--boundary-string +Content-Type: text/plain; charset="utf-8" +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline + +Plain text email goes here! +This is the fallback if email client does not support HTML + +--boundary-string +Content-Type: text/html; charset="utf-8" +Content-Transfer-Encoding: quoted-printable +Content-Disposition: inline + +

This is the HTML Section!

+

This is what displays in most modern email clients

+ +--boundary-string-- + diff --git a/tests/emails/rfc/007.eml b/tests/emails/rfc/007.eml index f70101d..1790c00 100644 --- a/tests/emails/rfc/007.eml +++ b/tests/emails/rfc/007.eml @@ -1,73 +1,73 @@ -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 - -E ---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-- - +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 + +E +--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-- + diff --git a/tests/emails/rfc/008.eml b/tests/emails/rfc/008.eml index c35e1c3..2d774a9 100644 --- a/tests/emails/rfc/008.eml +++ b/tests/emails/rfc/008.eml @@ -1,30 +1,30 @@ -Content-Type: multipart/mixed; - boundary=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb - ---bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: 7bit - -This is a message with a base64 encoded attached email ---bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb -Content-Disposition: attachment; filename="attached_email.eml" -Content-Type: message/rfc822 -Content-Transfer-Encoding: base64 - -VG86ICJlbWFpbEBleGFtcGxlLmNvbSIgPGVtYWlsQGV4YW1wbGUuY29tPg0KRnJvbTogTmFtZSA8 -ZW1haWxAZXhhbXBsZS5jb20+DQpTdWJqZWN0OiBIVE1MIHRlc3QNCk1lc3NhZ2UtSUQ6IDxyYW5k -b20tbWVzc2FnZS1pZEBleGFtcGxlLmNvbT4NCkRhdGU6IFR1ZSwgMTQgRGVjIDIwMjEgMTE6NDg6 -MjUgKzAxMDANCk1JTUUtVmVyc2lvbjogMS4wDQpDb250ZW50LVR5cGU6IG11bHRpcGFydC9hbHRl -cm5hdGl2ZTsNCiBib3VuZGFyeT0iYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh -YWFhYSINCkNvbnRlbnQtTGFuZ3VhZ2U6IGVuLVVTDQoNClRoaXMgaXMgYSBtdWx0aS1wYXJ0IG1l -c3NhZ2UgaW4gTUlNRSBmb3JtYXQuDQotLWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh -YWFhYWFhYWENCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD11dGYtODsgZm9ybWF0 -PWZsb3dlZA0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdA0KDQpUaGlzIGlzIGFuICpI -VE1MKiB0ZXN0IG1lc3NhZ2UNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh -YWFhYQ0KQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtVHJh -bnNmZXItRW5jb2Rpbmc6IDdiaXQNCg0KPGh0bWw+DQogIDxoZWFkPg0KICAgIDxtZXRhIGh0dHAt -ZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04Ij4N -CiAgPC9oZWFkPg0KICA8Ym9keT4NCiAgICBUaGlzIGlzIGFuIDxiPkhUTUw8L2I+IHRlc3QgbWVz -c2FnZQ0KICA8L2JvZHk+DQo8L2h0bWw+DQoNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh -YWFhYWFhYWFhYWFhYS0tDQo= ---bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-- +Content-Type: multipart/mixed; + boundary=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb + +--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +Content-Type: text/plain; charset=utf-8 +Content-Transfer-Encoding: 7bit + +This is a message with a base64 encoded attached email +--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb +Content-Disposition: attachment; filename="attached_email.eml" +Content-Type: message/rfc822 +Content-Transfer-Encoding: base64 + +VG86ICJlbWFpbEBleGFtcGxlLmNvbSIgPGVtYWlsQGV4YW1wbGUuY29tPg0KRnJvbTogTmFtZSA8 +ZW1haWxAZXhhbXBsZS5jb20+DQpTdWJqZWN0OiBIVE1MIHRlc3QNCk1lc3NhZ2UtSUQ6IDxyYW5k +b20tbWVzc2FnZS1pZEBleGFtcGxlLmNvbT4NCkRhdGU6IFR1ZSwgMTQgRGVjIDIwMjEgMTE6NDg6 +MjUgKzAxMDANCk1JTUUtVmVyc2lvbjogMS4wDQpDb250ZW50LVR5cGU6IG11bHRpcGFydC9hbHRl +cm5hdGl2ZTsNCiBib3VuZGFyeT0iYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYSINCkNvbnRlbnQtTGFuZ3VhZ2U6IGVuLVVTDQoNClRoaXMgaXMgYSBtdWx0aS1wYXJ0IG1l +c3NhZ2UgaW4gTUlNRSBmb3JtYXQuDQotLWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYWFhYWENCkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpbjsgY2hhcnNldD11dGYtODsgZm9ybWF0 +PWZsb3dlZA0KQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZzogN2JpdA0KDQpUaGlzIGlzIGFuICpI +VE1MKiB0ZXN0IG1lc3NhZ2UNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYQ0KQ29udGVudC1UeXBlOiB0ZXh0L2h0bWw7IGNoYXJzZXQ9dXRmLTgNCkNvbnRlbnQtVHJh +bnNmZXItRW5jb2Rpbmc6IDdiaXQNCg0KPGh0bWw+DQogIDxoZWFkPg0KICAgIDxtZXRhIGh0dHAt +ZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04Ij4N +CiAgPC9oZWFkPg0KICA8Ym9keT4NCiAgICBUaGlzIGlzIGFuIDxiPkhUTUw8L2I+IHRlc3QgbWVz +c2FnZQ0KICA8L2JvZHk+DQo8L2h0bWw+DQoNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh +YWFhYWFhYWFhYWFhYS0tDQo= +--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-- diff --git a/tests/emails/thirdparty/000.eml b/tests/emails/thirdparty/000.eml index 6c0b9c4..7ce52f8 100644 --- a/tests/emails/thirdparty/000.eml +++ b/tests/emails/thirdparty/000.eml @@ -1,20 +1,20 @@ -MIME-Version: 1.0 -Content-Type: multipart/alternative; - boundary="bound" +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="bound" + +mime header + +--bound +Content-Transfer-Encoding: base64 +Content-Type: text/plain + +d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz +aWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk +Z2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE= +--bound +Content-Type: text/plain +Content-Transfer-Encoding: base64 + +ZWg= +--bound-- -mime header - ---bound -Content-Transfer-Encoding: base64 -Content-Type: text/plain - -d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz -aWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk -Z2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE= ---bound -Content-Type: text/plain -Content-Transfer-Encoding: base64 - -ZWg= ---bound-- - diff --git a/tests/emails/thirdparty/001.eml b/tests/emails/thirdparty/001.eml index cfefd97..645c31b 100644 --- a/tests/emails/thirdparty/001.eml +++ b/tests/emails/thirdparty/001.eml @@ -1,25 +1,25 @@ -MIME-Version: 1.0 -Content-Type: multipart/alternative; - boundary="bound" +MIME-Version: 1.0 +Content-Type: multipart/alternative; + boundary="bound" + +mime header + +--bound +Content-Transfer-Encoding: binary +Content-Type: text/plain + +d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz +aWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk +Z2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE= +--bound +Content-Type: text/plain +Content-Transfer-Encoding: binary + +ZWg= +--bound +Content-Type: text/plain + +hello world + +--bound-- -mime header - ---bound -Content-Transfer-Encoding: binary -Content-Type: text/plain - -d2UgaGF2ZQ1hIGxvdCAKb2YgAGJpbmFyeSBzdHVmZiBpbiBoZXJlCmIgYWRqaWcgc2FkamcgamFz -aWRnamlhZWhnYTN3aHQ4YTN3OGdoeGpjIGRzZ2FkIGhhc2RnaHNkIGdhc2QgZHNqZHNvZ2Egc2pk -Z2EwdzN0amhhd2pnc2VydG5pcTNuNW9xZXJqcXcycjg5cTIzaCBhd2hycWg4MzVyOGE= ---bound -Content-Type: text/plain -Content-Transfer-Encoding: binary - -ZWg= ---bound -Content-Type: text/plain - -hello world - ---bound-- - diff --git a/tests/emails/thirdparty/002.eml b/tests/emails/thirdparty/002.eml index 113bcc5..7c4a12f 100644 --- a/tests/emails/thirdparty/002.eml +++ b/tests/emails/thirdparty/002.eml @@ -1,20 +1,20 @@ -Content-Type: multipart/mixed; boundary=foo - ---foo -Content-Transfer-Encoding: quoted-printable -Content-Type: text/plain; charset=utf-8 - -p=C3=A4iv=C3=A4=C3=A4 - ---foo -Content-Transfer-Encoding: base64 -Content-Type: text/plain; charset=utf-8 - -ecO2dMOkIHZhYW4uCg== ignored ---foo -Content-Transfer-Encoding: base64 -Content-Type: text/plain; charset=utf-8 - -?garbage ---foo-- - +Content-Type: multipart/mixed; boundary=foo + +--foo +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; charset=utf-8 + +p=C3=A4iv=C3=A4=C3=A4 + +--foo +Content-Transfer-Encoding: base64 +Content-Type: text/plain; charset=utf-8 + +ecO2dMOkIHZhYW4uCg== ignored +--foo +Content-Transfer-Encoding: base64 +Content-Type: text/plain; charset=utf-8 + +?garbage +--foo-- + diff --git a/tests/emails/thirdparty/003.eml b/tests/emails/thirdparty/003.eml index 4d832fb..599eb57 100644 --- a/tests/emails/thirdparty/003.eml +++ b/tests/emails/thirdparty/003.eml @@ -1,35 +1,35 @@ -Content-Type: multipart/mixed; boundary="1" -MIME-Version: 1.0 - ---1 -Content-Transfer-Encoding: 7bit -Content-Type: text/plain; charset=us-ascii - -Move black king to queen's bishop - ---1 -Content-Transfer-Encoding: binary -Content-Type: text/plain; charset=UTF-8 - -Move ♚ to ♛'s ♝ - ---1 -Content-Transfer-Encoding: 8bit -Content-Type: text/plain; charset=UTF-8 - -Move ♚ to ♛'s ♝ - ---1 -Content-Transfer-Encoding: quoted-printable -Content-Type: text/plain; charset=UTF-8 - -Move =E2=99=9A to =E2=99=9B's =E2=99=9D - ---1 -Content-Transfer-Encoding: base64 -Content-Type: text/plain; charset=UTF-8 - -TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== - ---1-- - +Content-Type: multipart/mixed; boundary="1" +MIME-Version: 1.0 + +--1 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; charset=us-ascii + +Move black king to queen's bishop + +--1 +Content-Transfer-Encoding: binary +Content-Type: text/plain; charset=UTF-8 + +Move ♚ to ♛'s ♝ + +--1 +Content-Transfer-Encoding: 8bit +Content-Type: text/plain; charset=UTF-8 + +Move ♚ to ♛'s ♝ + +--1 +Content-Transfer-Encoding: quoted-printable +Content-Type: text/plain; charset=UTF-8 + +Move =E2=99=9A to =E2=99=9B's =E2=99=9D + +--1 +Content-Transfer-Encoding: base64 +Content-Type: text/plain; charset=UTF-8 + +TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== + +--1-- + diff --git a/tests/emails/thirdparty/004.eml b/tests/emails/thirdparty/004.eml index cf340a0..cce34f8 100644 --- a/tests/emails/thirdparty/004.eml +++ b/tests/emails/thirdparty/004.eml @@ -1,41 +1,41 @@ -Content-Type: multipart/mixed; boundary="1" -MIME-Version: 1.0 - ---1 -Content-Transfer-Encoding: 6bit -Content-Type: text/plain; charset=UTF-8 - -Move black king to queen's bishop - ---1 -Content-Transfer-Encoding: 7bits -Content-Type: text/plain; charset=UTF-8 - -Move ♚ to ♛'s ♝ - ---1 -Content-Transfer-Encoding: 8 bit -Content-Type: text/plain; charset=UTF-8 - -Move ♚ to ♛'s ♝ - ---1 -Content-Transfer-Encoding: 7-bit -Content-Type: text/plain; charset=UTF-8 - -Move ♚ to ♛'s ♝ - ---1 -Content-Transfer-Encoding: 8-bit -Content-Type: text/plain; charset=UTF-8 - -Move ♚ to ♛'s ♝ - ---1 -Content-Transfer-Encoding: -Content-Type: text/plain; charset=UTF-8 - -Move =E2=99=9A to =E2=99=9B's =E2=99=9D - ---1-- - +Content-Type: multipart/mixed; boundary="1" +MIME-Version: 1.0 + +--1 +Content-Transfer-Encoding: 6bit +Content-Type: text/plain; charset=UTF-8 + +Move black king to queen's bishop + +--1 +Content-Transfer-Encoding: 7bits +Content-Type: text/plain; charset=UTF-8 + +Move ♚ to ♛'s ♝ + +--1 +Content-Transfer-Encoding: 8 bit +Content-Type: text/plain; charset=UTF-8 + +Move ♚ to ♛'s ♝ + +--1 +Content-Transfer-Encoding: 7-bit +Content-Type: text/plain; charset=UTF-8 + +Move ♚ to ♛'s ♝ + +--1 +Content-Transfer-Encoding: 8-bit +Content-Type: text/plain; charset=UTF-8 + +Move ♚ to ♛'s ♝ + +--1 +Content-Transfer-Encoding: +Content-Type: text/plain; charset=UTF-8 + +Move =E2=99=9A to =E2=99=9B's =E2=99=9D + +--1-- + diff --git a/tests/emails/thirdparty/005.eml b/tests/emails/thirdparty/005.eml index 05fdc79be2fca4ab3782feaf8d0f20e703618e7c..5fbb0e1afbb72262964abe6bf5ca6499240e9130 100644 GIT binary patch delta 178 zcmaFN(!x4HTbh^4*VETkH!QWNI5R)bO2JUifR~GxOIO#Bcj9{4iSewAyb~{KvgV`$ zMJG;>q_mkq5`R@W5W2wPP%V>78PTLBA7s=7>6!eRQ4&cL%qnHc&=5CW U3y^71-(hD3&RAd8CuqFia>9c@Og$y|)8tWX1hBAU!Vt&=-Y#FSNCL!EWK z0=T&HQ?eWjeEf6EER0O@i(QIJeVsFm0&Q*49iS{48sesF!NrxCSC*KQnF4g4t}YiB E02g{Sy8r+H diff --git a/tests/emails/thirdparty/006.eml b/tests/emails/thirdparty/006.eml index 9293548..c83bf01 100644 --- a/tests/emails/thirdparty/006.eml +++ b/tests/emails/thirdparty/006.eml @@ -1,30 +1,30 @@ -Subject: Hide and seek -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary=1 - ---1 -Content-Type: multipart/signed; protocol="signature/plain"; migalc="pen+paper"; boundary=2 -X-Signature-Type: penmanship - ---2 -Content-Type: multipart/alternative; boundary=3 - ---3 -Content-Type: text/html; charset=us-ascii - -Search me

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-- +Subject: Hide and seek +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary=1 + +--1 +Content-Type: multipart/signed; protocol="signature/plain"; migalc="pen+paper"; boundary=2 +X-Signature-Type: penmanship + +--2 +Content-Type: multipart/alternative; boundary=3 + +--3 +Content-Type: text/html; charset=us-ascii + +Search me

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-- diff --git a/tests/emails/thirdparty/007.eml b/tests/emails/thirdparty/007.eml index abbb8e9..044614a 100644 --- a/tests/emails/thirdparty/007.eml +++ b/tests/emails/thirdparty/007.eml @@ -1,34 +1,34 @@ -From: Moderator-Address -Content-Type: multipart/digest; boundary=1; - - ---1 - -From: someone-else -Subject: my opinion - -This is my opinion ---1 - -From: another one -Subject: i disagree - -Not agreeing one bit! ---1 - -From: attachment -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-- +From: Moderator-Address +Content-Type: multipart/digest; boundary=1; + + +--1 + +From: someone-else +Subject: my opinion + +This is my opinion +--1 + +From: another one +Subject: i disagree + +Not agreeing one bit! +--1 + +From: attachment +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-- diff --git a/tests/emails/thirdparty/008.eml b/tests/emails/thirdparty/008.eml index dc26e96..244bf48 100644 --- a/tests/emails/thirdparty/008.eml +++ b/tests/emails/thirdparty/008.eml @@ -1,57 +1,57 @@ -From user@domain Fri Feb 22 17:06:23 2008 -From: user@domain.org -Date: Sat, 24 Mar 2007 23:00:00 +0200 -Mime-Version: 1.0 -Content-Type: multipart/mixed; boundary="foo bar" - -Root MIME prologue - ---foo bar -Content-Type: text/x-myown; charset=us-ascii - -hello - ---foo bar -Content-Type: message/rfc822 - -From: sub@domain.org -Date: Sun, 12 Aug 2012 12:34:56 +0300 -Subject: submsg -Content-Type: multipart/alternative; boundary="sub1" - -Sub MIME prologue ---sub1 -Content-Type: text/html - -

Hello 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 - - +From user@domain Fri Feb 22 17:06:23 2008 +From: user@domain.org +Date: Sat, 24 Mar 2007 23:00:00 +0200 +Mime-Version: 1.0 +Content-Type: multipart/mixed; boundary="foo bar" + +Root MIME prologue + +--foo bar +Content-Type: text/x-myown; charset=us-ascii + +hello + +--foo bar +Content-Type: message/rfc822 + +From: sub@domain.org +Date: Sun, 12 Aug 2012 12:34:56 +0300 +Subject: submsg +Content-Type: multipart/alternative; boundary="sub1" + +Sub MIME prologue +--sub1 +Content-Type: text/html + +

Hello 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 + + diff --git a/tests/emails/thirdparty/009.eml b/tests/emails/thirdparty/009.eml index 2b87d27..019c753 100644 --- a/tests/emails/thirdparty/009.eml +++ b/tests/emails/thirdparty/009.eml @@ -1,21 +1,21 @@ -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: -Content-Type: text/plain; charset="us-ascii" -Content-Transfer-Encoding: base64 - -dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= ---1-- - +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: +Content-Type: text/plain; charset="us-ascii" +Content-Transfer-Encoding: base64 + +dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= +--1-- + diff --git a/tests/emails/thirdparty/010.eml b/tests/emails/thirdparty/010.eml index 12bcdb2..3265caa 100644 --- a/tests/emails/thirdparty/010.eml +++ b/tests/emails/thirdparty/010.eml @@ -1,12 +1,12 @@ -Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv?= -MIME-Version: 1.0 -Content-Type: multipart/mixed; boundary=1; comment="" - comment="人権の無視及" - ---1 -Content-Type: text/plain -Content-Transfer-Encoding: binary -Content-Language: ja - -人権の無視及 ---1-- +Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv?= +MIME-Version: 1.0 +Content-Type: multipart/mixed; boundary=1; comment="" + comment="人権の無視及" + +--1 +Content-Type: text/plain +Content-Transfer-Encoding: binary +Content-Language: ja + +人権の無視及 +--1-- diff --git a/tests/unix2dos.py b/tests/unix2dos.py new file mode 100755 index 0000000..4e6c9cf --- /dev/null +++ b/tests/unix2dos.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python3 +import sys + +buf = "" +with open(sys.argv[1], 'r+b') as f: + buf = f.read() + +if buf.find(b'\r\n'): + print(f"{sys.argv[1]} is already a CRLF file") + sys.exit(1) + +buf = buf.replace(b'\n', b'\r\n') + +with open(sys.argv[1], 'w+b') as f: + f.write(buf)