From 744018c967b114f389090a9105d9cafac57d818f Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 5 Jul 2022 10:17:42 +0200 Subject: Add some test emails from mail-parser --- tests/emails/rfc/000.eml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/emails/rfc/001.eml | 41 +++++++++++++++++++++++++++ tests/emails/rfc/002.eml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/emails/rfc/003.eml | 25 +++++++++++++++++ tests/emails/rfc/004.eml | 36 ++++++++++++++++++++++++ tests/emails/rfc/005.eml | 25 +++++++++++++++++ tests/emails/rfc/006.eml | 23 +++++++++++++++ tests/emails/rfc/007.eml | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ tests/emails/rfc/008.eml | 30 ++++++++++++++++++++ 9 files changed, 399 insertions(+) create mode 100644 tests/emails/rfc/000.eml create mode 100644 tests/emails/rfc/001.eml create mode 100644 tests/emails/rfc/002.eml create mode 100644 tests/emails/rfc/003.eml create mode 100644 tests/emails/rfc/004.eml create mode 100644 tests/emails/rfc/005.eml create mode 100644 tests/emails/rfc/006.eml create mode 100644 tests/emails/rfc/007.eml create mode 100644 tests/emails/rfc/008.eml (limited to 'tests/emails/rfc') diff --git a/tests/emails/rfc/000.eml b/tests/emails/rfc/000.eml new file mode 100644 index 0000000..44a1588 --- /dev/null +++ b/tests/emails/rfc/000.eml @@ -0,0 +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-- + diff --git a/tests/emails/rfc/001.eml b/tests/emails/rfc/001.eml new file mode 100644 index 0000000..8b4abc8 --- /dev/null +++ b/tests/emails/rfc/001.eml @@ -0,0 +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-- + + diff --git a/tests/emails/rfc/002.eml b/tests/emails/rfc/002.eml new file mode 100644 index 0000000..750134f --- /dev/null +++ b/tests/emails/rfc/002.eml @@ -0,0 +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-- + diff --git a/tests/emails/rfc/003.eml b/tests/emails/rfc/003.eml new file mode 100644 index 0000000..57ffadd --- /dev/null +++ b/tests/emails/rfc/003.eml @@ -0,0 +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-- + diff --git a/tests/emails/rfc/004.eml b/tests/emails/rfc/004.eml new file mode 100644 index 0000000..55aebc0 --- /dev/null +++ b/tests/emails/rfc/004.eml @@ -0,0 +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 ------ + diff --git a/tests/emails/rfc/005.eml b/tests/emails/rfc/005.eml new file mode 100644 index 0000000..b4fe65e --- /dev/null +++ b/tests/emails/rfc/005.eml @@ -0,0 +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. + diff --git a/tests/emails/rfc/006.eml b/tests/emails/rfc/006.eml new file mode 100644 index 0000000..f353adb --- /dev/null +++ b/tests/emails/rfc/006.eml @@ -0,0 +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-- + diff --git a/tests/emails/rfc/007.eml b/tests/emails/rfc/007.eml new file mode 100644 index 0000000..f70101d --- /dev/null +++ b/tests/emails/rfc/007.eml @@ -0,0 +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-- + diff --git a/tests/emails/rfc/008.eml b/tests/emails/rfc/008.eml new file mode 100644 index 0000000..c35e1c3 --- /dev/null +++ b/tests/emails/rfc/008.eml @@ -0,0 +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 +MjUgKzAxMDANCk1JTUUtVmVyc2lvbjogMS4wDQpDb250ZW50LVR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