EML — Three-Level Nesting (mixed > related > alternative)
The canonical rich-mail shape written out in full: a mixed container holding a related container holding an alternative pair, plus a CSV attachment at the outer level. A tree walker has to reach depth three to find the HTML body and still report exactly one attachment.
From: Meridian Ops <ops@meridiansupply.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: Packing slip NV-20714
Date: Thu, 12 Feb 2026 10:00:00 -0800
Message-ID: <p7-nest-three@brightside.example>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=_p7_nest_mixed"
--=_p7_nest_mixed
Content-Type: multipart/related; type="multipart/alternative"; boundary="=_p7_nest_related"
--=_p7_nest_related
Content-Type: multipart/alternative; boundary="=_p7_nest_alt"
--=_p7_nest_alt
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Packing slip NV-20714. Shelf B-12, two cartons.
--=_p7_nest_alt
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
<html><body><p>Packing slip <b>NV-20714</b>. Shelf B-12, two cartons.</p><i=
mg src=3D"cid:seal.p7@meridiansupply.example" width=3D"16" height=3D"16" al=
t=3D"seal"></body></html>
--=_p7_nest_alt--
--=_p7_nest_related
Content-Type: image/png; name="seal.png"
Content-Transfer-Encoding: base64
Content-ID: <seal.p7@meridiansupply.example>
Content-Disposition: inline; filename="seal.png"
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAFklEQVR42mPgm5tNEmIY1TCqYfhq
AABu9xYQCHe7pQAAAABJRU5ErkJggg==
--=_p7_nest_related--
--=_p7_nest_mixed
Content-Type: text/csv; charset="utf-8"; name="lines.csv"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="lines.csv"
c2t1LGRlc2NyaXB0aW9uLHF0eQ0KRlAtMjAwLEZpbHRlciBwYXBlcnMsMg0KTkctMDUwLE5pdHJp
bGUgZ2xvdmVzLDENCg==
--=_p7_nest_mixed--
Specifications
- Wave
- p7
- Seed
- 20260807
- Structure
- multipart/mixed > multipart/related > multipart/alternative
- Depth
- 3
- Leaf Parts
- 4
- Cid
- seal.p7@meridiansupply.example
- Line Endings
- CRLF (RFC 5322)
Testing contract
Expected to pass- Scenario
- Walk a three-level MIME tree to locate the displayable body and enumerate real attachments.
- Expected result
- The text/html leaf at depth three is chosen as the body, the seal PNG is an inline resource, and lines.csv is the single attachment.
What is a .eml file?
An EML file is a single email message stored in the RFC 822 / MIME format — plain-text headers (From, To, Subject, Date, Message-ID) followed by the body, which may be plain text, HTML, or a multipart structure with alternative bodies and file attachments encoded in base64.
How to use this file
Use an example EML to test email header parsing, MIME decoding, HTML-part handling, attachment extraction, and EML-to-other-format conversion.
How to use this file for testing
“EML — Three-Level Nesting (mixed > related > alternative)” is a deterministic Novus Examples fixture for Email parsing, Conversion testing. Standards-compliant RFC 822 messages — plain, multipart text+HTML, and with an attachment — plus an MBOX mailbox, for testing header parsing, MIME decoding, attachment extraction, and mailbox splitting.
Documented properties for this file: seed 20260807 · CRLF (RFC 5322) · multipart/mixed > multipart/related > multipart/alternative. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Email fixtures use fixed dates, message IDs, and MIME boundaries so runs are reproducible, and every address is fictional. Test header parsing, MIME decoding, attachment extraction, and EML/MBOX conversion against the documented structure.
Code examples
from email import policy
from email.parser import BytesParser
msg = BytesParser(policy=policy.default).parse(open("nested-three-levels.eml", "rb"))
print(msg["subject"], msg["from"])Related files
- emlEML — Attachment With No Filename At AllAn attachment with a bare Content-Disposition: attachment and no name in either header. A client has to invent a filename, and the extension it invents decides whether the saved file opens as a spreadsheet or as unknown binary.

- emlEML — Base64: Accented UTF-8 BodyA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: From-Line and Lone DotA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: ISO-8859-1 BodyA base64 text/plain message in iso-8859-1 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: Soft Line BreaksA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

- emlEML — Base64: Trailing WhitespaceA base64 text/plain message in utf-8 carrying the identical body to the quoted-printable twin beside it. Base64 is opaque to whitespace and line-start characters, so it is the reference side of the pair when a QP decoder is suspect.

Generated by generation/email_p7.py. Free for any use, no attribution required — license.