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() {
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);
}

View File

@ -1,35 +1,35 @@
From: "Doug Sauder" <doug@example.com>
To: "Joe Blow" <jblow@example.com>,
=?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= <schmuergen@example.com>
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: <NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com>
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" <doug@example.com>
To: "Joe Blow" <jblow@example.com>,
=?utf-7?B?SitBUHctcmdlbiBTY2htK0FQdy1yZ2Vu?= <schmuergen@example.com>
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: <NDBBIAKOPKHFGPLCODIGMEKCCHAA.doug@example.com>
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

View File

@ -1,73 +1,73 @@
MIME-Version: 1.0
From: Nathaniel Borenstein <nsb@nsb.fv.com>
To: Ned Freed <ned@innosoft.com>
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 <bold><italic>enriched.</italic></bold>
<smaller>as defined in RFC 1896</smaller>
Isn't it
<bigger><bigger>cool?</bigger></bigger>
--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 <nsb@nsb.fv.com>
To: Ned Freed <ned@innosoft.com>
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 <bold><italic>enriched.</italic></bold>
<smaller>as defined in RFC 1896</smaller>
Isn't it
<bigger><bigger>cool?</bigger></bigger>
--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--

View File

@ -1,41 +1,41 @@
From: Whomever
To: Someone
Date: Whenever
Subject: whatever
MIME-Version: 1.0
Message-ID: <id1@host.com>
Content-Type: multipart/alternative; boundary=42
Content-ID: <id001@guppylake.bellcore.com>
--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: <id42@guppylake.bellcore.com>
--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: <id42@guppylake.bellcore.com>
--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: <id42@guppylake.bellcore.com>
get RFC-MIME.DOC
--42--
From: Whomever
To: Someone
Date: Whenever
Subject: whatever
MIME-Version: 1.0
Message-ID: <id1@host.com>
Content-Type: multipart/alternative; boundary=42
Content-ID: <id001@guppylake.bellcore.com>
--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: <id42@guppylake.bellcore.com>
--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: <id42@guppylake.bellcore.com>
--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: <id42@guppylake.bellcore.com>
get RFC-MIME.DOC
--42--

View File

@ -1,73 +1,73 @@
From: Al Gore <vice-president@whitehouse.gov>
To: White House Transportation Coordinator
<transport@whitehouse.gov>
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: <president@whitehouse.gov>
Received: from mailhost.whitehouse.gov ([192.168.51.200])
by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453
for <vice-president@heartbeat.whitehouse.gov>;
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 <president@whitehouse.gov>
To: A1 (The Enforcer) Gore <vice-president@whitehouse.gov>
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 <vice-president@whitehouse.gov>
To: White House Transportation Coordinator
<transport@whitehouse.gov>
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: <president@whitehouse.gov>
Received: from mailhost.whitehouse.gov ([192.168.51.200])
by heartbeat.whitehouse.gov (8.8.8/8.8.8) with ESMTP id SAA22453
for <vice-president@heartbeat.whitehouse.gov>;
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 <president@whitehouse.gov>
To: A1 (The Enforcer) Gore <vice-president@whitehouse.gov>
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--

View File

@ -1,25 +1,25 @@
From: Nathaniel Borenstein <nsb@bellcore.com>
To: Ned Freed <ned@innosoft.com>
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 <nsb@bellcore.com>
To: Ned Freed <ned@innosoft.com>
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--

View File

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

View File

@ -1,25 +1,25 @@
From: Nathaniel Borenstein <nsb@bellcore.com>
To: Ned Freed <ned@innosoft.com>
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 <nsb@bellcore.com>
To: Ned Freed <ned@innosoft.com>
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.

View File

@ -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
<h1>This is the HTML Section!</h1>
<p>This is what displays in most modern email clients</p>
--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
<h1>This is the HTML Section!</h1>
<p>This is what displays in most modern email clients</p>
--boundary-string--

View File

@ -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
<html>E</html>
--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
<html>E</html>
--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--

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

@ -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
<html><head><title>Search me</title></head><body><p>Don't find me here</p></body></html>
--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
<html><head><title>Search me</title></head><body><p>Don't find me here</p></body></html>
--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--

View File

@ -1,34 +1,34 @@
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--
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--

View File

@ -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
<p>Hello world</p>
--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
<p>Hello world</p>
--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

View File

@ -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: <c6cceebc-1dcf-11eb-be8c-f7ca132cbfea@example.org>
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: <c6cceebc-1dcf-11eb-be8c-f7ca132cbfea@example.org>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: base64
dGhpcyBpcyB0aGUgZmlyc3QgcGFydCBvZiB0aGUgbWVzc2FnZQo=
--1--

View File

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

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)