MBOX — Four Charsets and Both Transfer Encodings
One mailbox whose four messages each use a different charset and alternate between quoted-printable and base64, with RFC 2047 subjects to match. The file itself is LF-stored while the encoded payloads decode to CRLF text — the split every importer has to handle.
From ops@meridiansupply.example Wed Feb 18 08:00:00 2026
From: Meridian Ops <ops@meridiansupply.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: =?UTF-8?B?Q2FmZSDigJQgY3LDqG1lIGJyw7tsw6llIHRhc3Rpbmcg4piVIChTQU1QTEUp?=
Date: Wed, 18 Feb 2026 08:00:00 -0800
Message-ID: <p7-mbox-utf8@brightside.example>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Tasting confirmed: cr=C3=A8me br=C3=BBl=C3=A9e, caf=C3=A9 filtre.
Prix : 4,50 =E2=82=AC (SAMPLE).
From ops@meridiansupply.example Wed Feb 18 08:05:00 2026
From: Meridian Ops <ops@meridiansupply.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: =?ISO-8859-1?Q?R=FCckfrage_zur_Bestellung_Nr=2E_4711_=28Gr=F6=DFe=3A_gro=DF=29?=
Date: Wed, 18 Feb 2026 08:05:00 -0800
Message-ID: <p7-mbox-latin1@brightside.example>
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: base64
Uvxja2ZyYWdlIHp1ciBCZXN0ZWxsdW5nIE5yLiA0NzExLg0KRGllIEdy9t9lIGRlciBLYXJ0b25z
IGlzdCB6dSBncm/fLg0K
From ops@meridiansupply.example Wed Feb 18 08:10:00 2026
From: Meridian Ops <ops@meridiansupply.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: =?Shift_JIS?B?grKSjZW2gsyKbZRGIFNBTVBMRQ==?=
Date: Wed, 18 Feb 2026 08:10:00 -0800
Message-ID: <p7-mbox-sjis@brightside.example>
MIME-Version: 1.0
Content-Type: text/plain; charset="shift_jis"
Content-Transfer-Encoding: base64
grKSjZW2gsyKbZRGIFNBTVBMRQ0KlHqRl4LNi+CXapP6gsWCt4FCDQo=
From ops@meridiansupply.example Wed Feb 18 08:15:00 2026
From: Meridian Ops <ops@meridiansupply.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: =?KOI8-R?B?8M/E1NfF0tbExc7JxSDawcvB2sEgU0FNUExF?=
Date: Wed, 18 Feb 2026 08:15:00 -0800
Message-ID: <p7-mbox-koi8@brightside.example>
MIME-Version: 1.0
Content-Type: text/plain; charset="koi8-r"
Content-Transfer-Encoding: quoted-printable
=F0=CF=C4=D4=D7=C5=D2=D6=C4=C5=CE=C9=C5 =DA=C1=CB=C1=DA=C1 SAMPLE.
=E4=CF=D3=D4=C1=D7=CB=C1 =D7 =D0=D1=D4=CE=C9=C3=D5.Specifications
- Wave
- p7
- Seed
- 20260807
- Messages
- 4
- Charsets
- UTF-8, ISO-8859-1, Shift_JIS, KOI8-R
- Transfer Encodings
- quoted-printable + base64
- Escaping
- mboxrd
- Line Endings
- LF (Unix mailbox storage)
- Note
- base64 payloads decode to CRLF text even though the mailbox is LF-stored
Testing contract
Expected to pass- Scenario
- Split an LF-stored mailbox into four messages and decode each body with its own declared charset and transfer encoding.
- Expected result
- Four messages parse; each subject and body decodes to its declared charset, and decoded bodies carry CRLF breaks despite the mailbox being LF-terminated.
What is a .mbox file?
An MBOX file is a mailbox that stores many email messages concatenated into one plain-text file, each message preceded by a 'From ' separator line. It is the classic Unix mailbox format used by many mail clients for export and archival.
How to use this file
Use an example MBOX to test mailbox splitting, message boundary detection, thread reconstruction, and import into a mail client or parser.
How to use this file for testing
“MBOX — Four Charsets and Both Transfer Encodings” is a deterministic Novus Examples fixture for Email parsing, Encoding detection, Internationalization. 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 · 4 messages · LF (Unix mailbox storage). 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
import mailbox
for msg in mailbox.mbox("p7-encodings.mbox"):
print(msg["subject"])Related files
- emlEML — Adjacent Encoded-Words (Separator Must Disappear)A Subject split mid-word across two adjacent encoded-words. RFC 2047 requires the linear whitespace between them to be discarded, so the correct result is one word; a decoder that keeps the space renders a split that reads as a typo.

- emlEML — Encoded-Word Longer Than the 75-Character LimitOne unbroken encoded-word of 148 characters, well past the 75-character ceiling RFC 2047 sets. Real senders emit these, and a decoder should still recover the whole word rather than truncating it at 75 or rejecting the header.

- emlEML — Encoded-Word Subject Folded Over Four LinesA Subject folded across four physical lines, one encoded-word per line, which is the shape RFC 2047 prescribes for long international headers. Because the fold whitespace is discarded on decode, each continuation word carries its own leading space inside the encoded-word — omit that and the subject decodes run-together.

- emlEML — Encoded-Words in Display Names and a FilenameEncoded-words used everywhere they turn up in practice: both display names, the Subject, and — against the spec but very common — inside the quoted filename parameter, where RFC 2231 is the conformant mechanism. A tolerant parser decodes all four.

- emlEML — RFC 2047 Subject Mixing Three CharsetsA single Subject built from three encoded-words in three charsets and two encodings. RFC 2047 allows this, and it is what happens when a subject is quoted through several mail systems, so each word has to be decoded on its own terms.

- emlEML — RFC 2047 Subject: ISO-8859-1 'B' EncodingThe ISO-8859-1 Subject again, base64-encoded instead of Q-encoded. Base64 hides the charset entirely, so this is the fixture that catches a decoder guessing the charset from the octets instead of reading the encoded-word's charset token.

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