Use CRLF as line ending in test files

This commit is contained in:
Quentin 2022-07-08 10:23:07 +02:00
parent aa6580e0c3
commit 9675cdb545
Signed by: quentin
GPG key ID: E9602264D639FF68
23 changed files with 744 additions and 728 deletions

View file

@ -851,7 +851,7 @@ mod tests {
for pref in prefixes.iter() { for pref in prefixes.iter() {
println!("{}", pref); println!("{}", pref);
let txt = fs::read(format!("{}.eml", 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 message = Message::parse(&txt).unwrap();
let mut resp = Vec::new(); let mut resp = Vec::new();
@ -864,6 +864,7 @@ mod tests {
let exp_str = String::from_utf8_lossy(exp_no_parenthesis).to_lowercase(); let exp_str = String::from_utf8_lossy(exp_no_parenthesis).to_lowercase();
println!("aerogramme: {}\ndovecot: {}", resp_str, exp_str); println!("aerogramme: {}\ndovecot: {}", resp_str, exp_str);
//println!("\n\n {} \n\n", String::from_utf8_lossy(&resp));
assert_eq!(resp_str, exp_str); assert_eq!(resp_str, exp_str);
} }

View file

@ -1,35 +1,35 @@
From: "Doug Sauder" <doug@example.com> From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>, To: "Joe Blow" <jblow@example.com>,
=?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= <schmuergen@example.com> =?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= <schmuergen@example.com>
Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?= Subject: =?utf-7?Q?Die_Hasen_und_die_Fr+APY-sche_=28Microsoft_Outlook_00=29?=
Date: Wed, 17 May 2000 19:18:39 -0400 Date: Wed, 17 May 2000 19:18:39 -0400
Message-ID: <NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com> Message-ID: <NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com>
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: text/plain; Content-Type: text/plain;
charset="utf-7" charset="utf-7"
Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable
X-Priority: 3 (Normal) X-Priority: 3 (Normal)
X-MSMail-Priority: Normal X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Die Hasen und die Fr+APY-sche Die Hasen und die Fr+APY-sche
Die Hasen klagten einst +APw-ber ihre mi+AN8-liche Lage+ADs- +ACI-wir = 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 = leben+ACI-, sprach ein Redner, +ACI-in steter Furcht vor Menschen und =
Tieren, eine Beute der Hunde, der Adler, ja fast aller Raubtiere+ACE- = 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 = Unsere stete Angst ist +AOQ-rger als der Tod selbst. Auf, la+AN8-t uns =
ein f+APw-r allemal sterben.+ACI-=20 ein f+APw-r allemal sterben.+ACI-=20
In einem nahen Teich wollten sie sich nun ers+AOQ-ufen+ADs- sie eilten = 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 = ihm zu+ADs- allein das au+AN8-erordentliche Get+APY-se und ihre =
wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer = wunderbare Gestalt erschreckte eine Menge Fr+APY-sche, die am Ufer =
sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20 sa+AN8-en, so sehr, da+AN8- sie aufs schnellste untertauchten.=20
+ACI-Halt+ACI-, rief nun eben dieser Sprecher, +ACI-wir wollen das = +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 = 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 = ihr seht, einige Tiere, welche also wohl noch ungl+APw-cklicher sein =
m+APw-ssen als wir.+ACI-=20 m+APw-ssen als wir.+ACI-=20

View file

@ -1,73 +1,73 @@
MIME-Version: 1.0 MIME-Version: 1.0
From: Nathaniel Borenstein <nsb@nsb.fv.com> From: Nathaniel Borenstein <nsb@nsb.fv.com>
To: Ned Freed <ned@innosoft.com> To: Ned Freed <ned@innosoft.com>
Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT) Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT)
Subject: A multipart example Subject: A multipart example
Content-Type: multipart/mixed; Content-Type: multipart/mixed;
boundary=unique-boundary-1 boundary=unique-boundary-1
This is the preamble area of a multipart message. This is the preamble area of a multipart message.
Mail readers that understand multipart format Mail readers that understand multipart format
should ignore this preamble. should ignore this preamble.
If you are reading this text, you might want to If you are reading this text, you might want to
consider changing to a mail reader that understands consider changing to a mail reader that understands
how to properly display multipart messages. how to properly display multipart messages.
--unique-boundary-1 --unique-boundary-1
... Some text appears here ... ... Some text appears here ...
[Note that the blank between the boundary and the start [Note that the blank between the boundary and the start
of the text in this part means no header fields were of the text in this part means no header fields were
given and this is text in the US-ASCII character set. given and this is text in the US-ASCII character set.
It could have been done with explicit typing as in the It could have been done with explicit typing as in the
next part.] next part.]
--unique-boundary-1 --unique-boundary-1
Content-type: text/plain; charset=US-ASCII Content-type: text/plain; charset=US-ASCII
This could have been part of the previous part, but This could have been part of the previous part, but
illustrates explicit versus implicit typing of body illustrates explicit versus implicit typing of body
parts. parts.
--unique-boundary-1 --unique-boundary-1
Content-Type: multipart/parallel; boundary=unique-boundary-2 Content-Type: multipart/parallel; boundary=unique-boundary-2
--unique-boundary-2 --unique-boundary-2
Content-Type: audio/basic Content-Type: audio/basic
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
... base64-encoded 8000 Hz single-channel ... base64-encoded 8000 Hz single-channel
mu-law-format audio data goes here ... mu-law-format audio data goes here ...
--unique-boundary-2 --unique-boundary-2
Content-Type: image/jpeg Content-Type: image/jpeg
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
... base64-encoded image data goes here ... ... base64-encoded image data goes here ...
--unique-boundary-2-- --unique-boundary-2--
--unique-boundary-1 --unique-boundary-1
Content-type: text/enriched Content-type: text/enriched
This is <bold><italic>enriched.</italic></bold> This is <bold><italic>enriched.</italic></bold>
<smaller>as defined in RFC 1896</smaller> <smaller>as defined in RFC 1896</smaller>
Isn't it Isn't it
<bigger><bigger>cool?</bigger></bigger> <bigger><bigger>cool?</bigger></bigger>
--unique-boundary-1 --unique-boundary-1
Content-Type: message/rfc822 Content-Type: message/rfc822
From: (mailbox in US-ASCII) From: (mailbox in US-ASCII)
To: (address in US-ASCII) To: (address in US-ASCII)
Subject: (subject in US-ASCII) Subject: (subject in US-ASCII)
Content-Type: Text/plain; charset=ISO-8859-1 Content-Type: Text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: Quoted-printable Content-Transfer-Encoding: Quoted-printable
... Additional text in ISO-8859-1 goes here ... ... Additional text in ISO-8859-1 goes here ...
--unique-boundary-1-- --unique-boundary-1--

View file

@ -1,41 +1,41 @@
From: Whomever From: Whomever
To: Someone To: Someone
Date: Whenever Date: Whenever
Subject: whatever Subject: whatever
MIME-Version: 1.0 MIME-Version: 1.0
Message-ID: <id1@host.com> Message-ID: <id1@host.com>
Content-Type: multipart/alternative; boundary=42 Content-Type: multipart/alternative; boundary=42
Content-ID: <id001@guppylake.bellcore.com> Content-ID: <id001@guppylake.bellcore.com>
--42 --42
Content-Type: message/external-body; name="BodyFormats.ps"; Content-Type: message/external-body; name="BodyFormats.ps";
site="thumper.bellcore.com"; mode="image"; site="thumper.bellcore.com"; mode="image";
access-type=ANON-FTP; directory="pub"; access-type=ANON-FTP; directory="pub";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com> Content-ID: <id42@guppylake.bellcore.com>
--42 --42
Content-Type: message/external-body; access-type=local-file; Content-Type: message/external-body; access-type=local-file;
name="/u/nsb/writing/rfcs/RFC-MIME.ps"; name="/u/nsb/writing/rfcs/RFC-MIME.ps";
site="thumper.bellcore.com"; site="thumper.bellcore.com";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com> Content-ID: <id42@guppylake.bellcore.com>
--42 --42
Content-Type: message/external-body; Content-Type: message/external-body;
access-type=mail-server access-type=mail-server
server="listserv@bogus.bitnet"; server="listserv@bogus.bitnet";
expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)" expiration="Fri, 14 Jun 1991 19:13:14 -0400 (EDT)"
Content-type: application/postscript Content-type: application/postscript
Content-ID: <id42@guppylake.bellcore.com> Content-ID: <id42@guppylake.bellcore.com>
get RFC-MIME.DOC get RFC-MIME.DOC
--42-- --42--

View file

@ -1,73 +1,73 @@
From: Al Gore <vice-president@whitehouse.gov> From: Al Gore <vice-president@whitehouse.gov>
To: White House Transportation Coordinator To: White House Transportation Coordinator
<transport@whitehouse.gov> <transport@whitehouse.gov>
Subject: [Fwd: Map of Argentina with Description] Subject: [Fwd: Map of Argentina with Description]
Content-Type: multipart/mixed; Content-Type: multipart/mixed;
boundary="D7F------------D7FD5A0B8AB9C65CCDBFA872" boundary="D7F------------D7FD5A0B8AB9C65CCDBFA872"
This is a multi-part message in MIME format. This is a multi-part message in MIME format.
--D7F------------D7FD5A0B8AB9C65CCDBFA872 --D7F------------D7FD5A0B8AB9C65CCDBFA872
Content-Type: text/plain; charset=us-ascii Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit
Fred, Fred,
Fire up Air Force One! We're going South! Fire up Air Force One! We're going South!
Thanks, Thanks,
Al Al
--D7F------------D7FD5A0B8AB9C65CCDBFA872 --D7F------------D7FD5A0B8AB9C65CCDBFA872
Content-Type: message/rfc822 Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit
Content-Disposition: inline Content-Disposition: inline
Return-Path: <president@whitehouse.gov> Return-Path: <president@whitehouse.gov>
Received: from mailhost.whitehouse.gov ([192.168.51.200]) Received: from mailhost.whitehouse.gov ([192.168.51.200])
by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453 by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453
for <vice-president@heartbeat.whitehouse.gov>; for <vice-president@heartbeat.whitehouse.gov>;
Mon, 13 Aug 1998 l8:14:23 +1000 Mon, 13 Aug 1998 l8:14:23 +1000
Received: from the_big_box.whitehouse.gov ([192.168.51.50]) 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 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 for vice-president@whitehouse.gov; Mon, 13 Aug 1998 17:42:41 +1000
Date: Mon, 13 Aug 1998 17:42:41 +1000 Date: Mon, 13 Aug 1998 17:42:41 +1000
Message-Id: <199804130742.RAA20366@mai1host.whitehouse.gov> Message-Id: <199804130742.RAA20366@mai1host.whitehouse.gov>
From: Bill Clinton <president@whitehouse.gov> From: Bill Clinton <president@whitehouse.gov>
To: A1 (The Enforcer) Gore <vice-president@whitehouse.gov> To: A1 (The Enforcer) Gore <vice-president@whitehouse.gov>
Subject: Map of Argentina with Description Subject: Map of Argentina with Description
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/mixed; Content-Type: multipart/mixed;
boundary="DC8------------DC8638F443D87A7F0726DEF7" boundary="DC8------------DC8638F443D87A7F0726DEF7"
This is a multi-part message in MIME format. This is a multi-part message in MIME format.
--DC8------------DC8638F443D87A7F0726DEF7 --DC8------------DC8638F443D87A7F0726DEF7
Content-Type: text/plain; charset=us-ascii Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit
Hi A1, Hi A1,
I finally figured out this MIME thing. Pretty cool. I'll send you I finally figured out this MIME thing. Pretty cool. I'll send you
some sax music in .au files next week! some sax music in .au files next week!
Anyway, the attached image is really too small to get a good look at Anyway, the attached image is really too small to get a good look at
Argentina. Try this for a much better map: Argentina. Try this for a much better map:
http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm http://www.1one1yp1anet.com/dest/sam/graphics/map-arg.htm
Then again, shouldn't the CIA have something like that? Then again, shouldn't the CIA have something like that?
Bill Bill
--DC8------------DC8638F443D87A7F0726DEF7 --DC8------------DC8638F443D87A7F0726DEF7
Content-Type: image/gif; name="map_of_Argentina.gif" Content-Type: image/gif; name="map_of_Argentina.gif"
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Disposition: inline; fi1ename="map_of_Argentina.gif" Content-Disposition: inline; fi1ename="map_of_Argentina.gif"
R01GOD1hJQA1AKIAAP/////78P/omn19fQAAAAAAAAAAAAAAACwAAAAAJQA1AAAD7Qi63P5w R01GOD1hJQA1AKIAAP/////78P/omn19fQAAAAAAAAAAAAAAACwAAAAAJQA1AAAD7Qi63P5w
wEmjBCLrnQnhYCgM1wh+pkgqqeC9XrutmBm7hAK3tP31gFcAiFKVQrGFR6kscnonTe7FAAad wEmjBCLrnQnhYCgM1wh+pkgqqeC9XrutmBm7hAK3tP31gFcAiFKVQrGFR6kscnonTe7FAAad
GugmRu3CmiBt57fsVq3Y0VFKnpYdxPC6M7Ze4crnnHum4oN6LFJ1bn5NXTN7OF5fQkN5WYow GugmRu3CmiBt57fsVq3Y0VFKnpYdxPC6M7Ze4crnnHum4oN6LFJ1bn5NXTN7OF5fQkN5WYow
BEN2dkGQGWJtSzqGTICJgnQuTJN/WJsojad9qXMuhIWdjXKjY4tenjo6tjVssk2gaWq3uGNX BEN2dkGQGWJtSzqGTICJgnQuTJN/WJsojad9qXMuhIWdjXKjY4tenjo6tjVssk2gaWq3uGNX
U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz U6ZGxseyk8SasGw3J9GRzdTQky1iHNvcPNNI4TLeKdfMvy0vMqLrItvuxfDW8ubjueDtJufz
7itICBxISKDBgwgTKjyYAAA7 7itICBxISKDBgwgTKjyYAAA7
--DC8------------DC8638F443D87A7F0726DEF7-- --DC8------------DC8638F443D87A7F0726DEF7--
--D7F------------D7FD5A0B8AB9C65CCDBFA872-- --D7F------------D7FD5A0B8AB9C65CCDBFA872--

View file

@ -1,25 +1,25 @@
From: Nathaniel Borenstein <nsb@bellcore.com> From: Nathaniel Borenstein <nsb@bellcore.com>
To: Ned Freed <ned@innosoft.com> To: Ned Freed <ned@innosoft.com>
Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST) Date: Mon, 22 Mar 1993 09:41:09 -0800 (PST)
Subject: Formatted text mail Subject: Formatted text mail
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/alternative; boundary=boundary42 Content-Type: multipart/alternative; boundary=boundary42
--boundary42 --boundary42
Content-Type: text/plain; charset=us-ascii Content-Type: text/plain; charset=us-ascii
... plain text version of message goes here ... ... plain text version of message goes here ...
--boundary42 --boundary42
Content-Type: text/enriched Content-Type: text/enriched
... RFC 1896 text/enriched version of same message ... RFC 1896 text/enriched version of same message
goes here ... goes here ...
--boundary42 --boundary42
Content-Type: application/x-whatever Content-Type: application/x-whatever
... fanciest version of same message goes here ... ... fanciest version of same message goes here ...
--boundary42-- --boundary42--

View file

@ -1,36 +1,36 @@
From: Moderator-Address From: Moderator-Address
To: Recipient-List To: Recipient-List
Date: Mon, 22 Mar 1994 13:34:51 +0000 Date: Mon, 22 Mar 1994 13:34:51 +0000
Subject: Internet Digest, volume 42 Subject: Internet Digest, volume 42
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/mixed; Content-Type: multipart/mixed;
boundary="---- main boundary ----" boundary="---- main boundary ----"
------ main boundary ---- ------ main boundary ----
...Introductory text or table of contents... ...Introductory text or table of contents...
------ main boundary ---- ------ main boundary ----
Content-Type: multipart/digest; Content-Type: multipart/digest;
boundary="---- next message ----" boundary="---- next message ----"
------ next message ---- ------ next message ----
From: someone-else From: someone-else
Date: Fri, 26 Mar 1993 11:13:32 +0200 Date: Fri, 26 Mar 1993 11:13:32 +0200
Subject: my opinion Subject: my opinion
...body goes here ... ...body goes here ...
------ next message ---- ------ next message ----
From: someone-else-again From: someone-else-again
Date: Fri, 26 Mar 1993 10:07:13 -0500 Date: Fri, 26 Mar 1993 10:07:13 -0500
Subject: my different opinion Subject: my different opinion
... another body goes here ... ... another body goes here ...
------ next message ------ ------ next message ------
------ main boundary ------ ------ main boundary ------

View file

@ -1,25 +1,25 @@
From: Nathaniel Borenstein <nsb@bellcore.com> From: Nathaniel Borenstein <nsb@bellcore.com>
To: Ned Freed <ned@innosoft.com> To: Ned Freed <ned@innosoft.com>
Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST) Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)
Subject: Sample message Subject: Sample message
MIME-Version: 1.0 MIME-Version: 1.0
Content-type: multipart/mixed; boundary="simple boundary" Content-type: multipart/mixed; boundary="simple boundary"
This is the preamble. It is to be ignored, though it This is the preamble. It is to be ignored, though it
is a handy place for composition agents to include an is a handy place for composition agents to include an
explanatory note to non-MIME conformant readers. explanatory note to non-MIME conformant readers.
--simple boundary --simple boundary
This is implicitly typed plain US-ASCII text. This is implicitly typed plain US-ASCII text.
It does NOT end with a linebreak. It does NOT end with a linebreak.
--simple boundary --simple boundary
Content-type: text/plain; charset=us-ascii Content-type: text/plain; charset=us-ascii
This is explicitly typed plain US-ASCII text. This is explicitly typed plain US-ASCII text.
It DOES end with a linebreak. It DOES end with a linebreak.
--simple boundary-- --simple boundary--
This is the epilogue. It is also to be ignored. This is the epilogue. It is also to be ignored.

View file

@ -1,23 +1,23 @@
From: sender@example.com From: sender@example.com
To: recipient@example.com To: recipient@example.com
Subject: Multipart Email Example Subject: Multipart Email Example
Content-Type: multipart/alternative; boundary="boundary-string" Content-Type: multipart/alternative; boundary="boundary-string"
--boundary-string --boundary-string
Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline Content-Disposition: inline
Plain text email goes here! Plain text email goes here!
This is the fallback if email client does not support HTML This is the fallback if email client does not support HTML
--boundary-string --boundary-string
Content-Type: text/html; charset="utf-8" Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline Content-Disposition: inline
<h1>This is the HTML Section!</h1> <h1>This is the HTML Section!</h1>
<p>This is what displays in most modern email clients</p> <p>This is what displays in most modern email clients</p>
--boundary-string-- --boundary-string--

View file

@ -1,73 +1,73 @@
Subject: RFC 8621 Section 4.1.4 test Subject: RFC 8621 Section 4.1.4 test
Content-Type: multipart/mixed; boundary="1" Content-Type: multipart/mixed; boundary="1"
--1 --1
Content-Type: text/plain Content-Type: text/plain
Content-Disposition: inline Content-Disposition: inline
A A
--1 --1
Content-Type: multipart/mixed; boundary="2" Content-Type: multipart/mixed; boundary="2"
--2 --2
Content-Type: multipart/alternative; boundary="3" Content-Type: multipart/alternative; boundary="3"
--3 --3
Content-Type: multipart/mixed; boundary="4" Content-Type: multipart/mixed; boundary="4"
--4 --4
Content-Type: text/plain Content-Type: text/plain
Content-Disposition: inline Content-Disposition: inline
B B
--4 --4
Content-Type: image/jpeg Content-Type: image/jpeg
Content-Disposition: inline Content-Disposition: inline
C C
--4 --4
Content-Type: text/plain Content-Type: text/plain
Content-Disposition: inline Content-Disposition: inline
D D
--4-- --4--
--3 --3
Content-Type: multipart/related; boundary="5" Content-Type: multipart/related; boundary="5"
--5 --5
Content-Type: text/html Content-Type: text/html
<html>E</html> <html>E</html>
--5 --5
Content-Type: image/jpeg Content-Type: image/jpeg
F F
--5-- --5--
--3-- --3--
--2 --2
Content-Type: image/jpeg Content-Type: image/jpeg
Content-Disposition: attachment Content-Disposition: attachment
G G
--2 --2
Content-Type: application/x-excel Content-Type: application/x-excel
H H
--2 --2
Content-Type: message/rfc822 Content-Type: message/rfc822
Subject: J Subject: J
J J
--2-- --2--
--1 --1
Content-Type: text/plain Content-Type: text/plain
Content-Disposition: inline Content-Disposition: inline
K K
--1-- --1--

View file

@ -1,30 +1,30 @@
Content-Type: multipart/mixed; Content-Type: multipart/mixed;
boundary=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb boundary=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Content-Type: text/plain; charset=utf-8 Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit
This is a message with a base64 encoded attached email This is a message with a base64 encoded attached email
--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
Content-Disposition: attachment; filename="attached_email.eml" Content-Disposition: attachment; filename="attached_email.eml"
Content-Type: message/rfc822 Content-Type: message/rfc822
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
VG86ICJlbWFpbE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zIGFuIDxiPkhUTUw8L2I+IHRlc3QgbWVz
c2FnZQ0KICA8L2JvZHk+DQo8L2h0bWw+DQoNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh c2FnZQ0KICA8L2JvZHk+DQo8L2h0bWw+DQoNCi0tYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh
YWFhYWFhYWFhYWFhYS0tDQo= YWFhYWFhYWFhYWFhYS0tDQo=
--bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb-- --bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb--

View file

@ -1,20 +1,20 @@
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/alternative; Content-Type: multipart/alternative;
boundary="bound" 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--

View file

@ -1,25 +1,25 @@
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/alternative; Content-Type: multipart/alternative;
boundary="bound" 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--

View file

@ -1,20 +1,20 @@
Content-Type: multipart/mixed; boundary=foo Content-Type: multipart/mixed; boundary=foo
--foo --foo
Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8 Content-Type: text/plain; charset=utf-8
p=C3=A4iv=C3=A4=C3=A4 p=C3=A4iv=C3=A4=C3=A4
--foo --foo
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=utf-8 Content-Type: text/plain; charset=utf-8
ecO2dMOkIHZhYW4uCg== ignored ecO2dMOkIHZhYW4uCg== ignored
--foo --foo
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=utf-8 Content-Type: text/plain; charset=utf-8
?garbage ?garbage
--foo-- --foo--

View file

@ -1,35 +1,35 @@
Content-Type: multipart/mixed; boundary="1" Content-Type: multipart/mixed; boundary="1"
MIME-Version: 1.0 MIME-Version: 1.0
--1 --1
Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii Content-Type: text/plain; charset=us-ascii
Move black king to queen's bishop Move black king to queen's bishop
--1 --1
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move ♚ to ♛'s ♝ Move ♚ to ♛'s ♝
--1 --1
Content-Transfer-Encoding: 8bit Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move ♚ to ♛'s ♝ Move ♚ to ♛'s ♝
--1 --1
Content-Transfer-Encoding: quoted-printable Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move =E2=99=9A to =E2=99=9B's =E2=99=9D Move =E2=99=9A to =E2=99=9B's =E2=99=9D
--1 --1
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg== TW92ZSDimZogdG8g4pmbJ3Mg4pmdCg==
--1-- --1--

View file

@ -1,41 +1,41 @@
Content-Type: multipart/mixed; boundary="1" Content-Type: multipart/mixed; boundary="1"
MIME-Version: 1.0 MIME-Version: 1.0
--1 --1
Content-Transfer-Encoding: 6bit Content-Transfer-Encoding: 6bit
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move black king to queen's bishop Move black king to queen's bishop
--1 --1
Content-Transfer-Encoding: 7bits Content-Transfer-Encoding: 7bits
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move ♚ to ♛'s ♝ Move ♚ to ♛'s ♝
--1 --1
Content-Transfer-Encoding: 8 bit Content-Transfer-Encoding: 8 bit
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move ♚ to ♛'s ♝ Move ♚ to ♛'s ♝
--1 --1
Content-Transfer-Encoding: 7-bit Content-Transfer-Encoding: 7-bit
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move ♚ to ♛'s ♝ Move ♚ to ♛'s ♝
--1 --1
Content-Transfer-Encoding: 8-bit Content-Transfer-Encoding: 8-bit
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move ♚ to ♛'s ♝ Move ♚ to ♛'s ♝
--1 --1
Content-Transfer-Encoding: Content-Transfer-Encoding:
Content-Type: text/plain; charset=UTF-8 Content-Type: text/plain; charset=UTF-8
Move =E2=99=9A to =E2=99=9B's =E2=99=9D Move =E2=99=9A to =E2=99=9B's =E2=99=9D
--1-- --1--

Binary file not shown.

View file

@ -1,30 +1,30 @@
Subject: Hide and seek Subject: Hide and seek
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=1 Content-Type: multipart/mixed; boundary=1
--1 --1
Content-Type: multipart/signed; protocol="signature/plain"; migalc="pen+paper"; boundary=2 Content-Type: multipart/signed; protocol="signature/plain"; migalc="pen+paper"; boundary=2
X-Signature-Type: penmanship X-Signature-Type: penmanship
--2 --2
Content-Type: multipart/alternative; boundary=3 Content-Type: multipart/alternative; boundary=3
--3 --3
Content-Type: text/html; charset=us-ascii Content-Type: text/html; charset=us-ascii
<html><head><title>Search me</title></head><body><p>Don't find me here</p></body></html> <html><head><title>Search me</title></head><body><p>Don't find me here</p></body></html>
--3 --3
Content-Type: text/plain Content-Type: text/plain
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
Search me, and Find me here Search me, and Find me here
--3-- --3--
--2 --2
Content-Type: signature/plain; charset=us-ascii Content-Type: signature/plain; charset=us-ascii
Signed by undersigned Signed by undersigned
--2-- --2--
--1-- --1--

View file

@ -1,34 +1,34 @@
From: Moderator-Address <moderator> From: Moderator-Address <moderator>
Content-Type: multipart/digest; boundary=1; Content-Type: multipart/digest; boundary=1;
--1 --1
From: someone-else <someone@else> From: someone-else <someone@else>
Subject: my opinion Subject: my opinion
This is my opinion This is my opinion
--1 --1
From: another one <another@one> From: another one <another@one>
Subject: i disagree Subject: i disagree
Not agreeing one bit! Not agreeing one bit!
--1 --1
From: attachment <attachment@user> From: attachment <attachment@user>
Subject: funny hat Subject: funny hat
Content-Type: multipart/mixed; boundary=2 Content-Type: multipart/mixed; boundary=2
--2 --2
Content-Type: text/plain Content-Type: text/plain
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
Lovely attachment for you Lovely attachment for you
--2 --2
Content-Type: application/octet-stream; disposition=attachment; name="test.txt" Content-Type: application/octet-stream; disposition=attachment; name="test.txt"
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
Foobar Foobar
--2-- --2--
--1-- --1--

View file

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

View file

@ -1,21 +1,21 @@
Subject: In parts Subject: In parts
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=1 Content-Type: multipart/mixed; boundary=1
--1 --1
Content-Type: text/plain Content-Type: text/plain
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
Hi, this is the fancy thing I was talking about! Hi, this is the fancy thing I was talking about!
--1 --1
Content-Type: Message/Partial; number=1; total=5; id="heks68ewe@example.org" Content-Type: Message/Partial; number=1; total=5; id="heks68ewe@example.org"
X-Weird-Header-1: Bar X-Weird-Header-1: Bar
X-Weird-Header-2: Hello X-Weird-Header-2: Hello
Message-ID: <c6cceebc-1dcf-11eb-be8c-f7ca132cbfea@example.org> Message-ID: <c6cceebc-1dcf-11eb-be8c-f7ca132cbfea@example.org>
Content-Type: text/plain; charset="us-ascii" Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: base64 Content-Transfer-Encoding: base64
dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo= dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo=
--1-- --1--

View file

@ -1,12 +1,12 @@
Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv?= Subject: =?UTF-8?B?44GT44KT44Gr44Gh44Gv?=
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=1; comment="" Content-Type: multipart/mixed; boundary=1; comment=""
comment="人権の無視及" comment="人権の無視及"
--1 --1
Content-Type: text/plain Content-Type: text/plain
Content-Transfer-Encoding: binary Content-Transfer-Encoding: binary
Content-Language: ja Content-Language: ja
人権の無視及 人権の無視及
--1-- --1--

15
tests/unix2dos.py Executable file
View file

@ -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)