Test files › Email › mailbox.mbox

Sample MBOX file (mailbox)

An mbox archive of three messages, the format Gmail Takeout, Thunderbird and Apple Mail all export. Includes a body line beginning with "From " that has been escaped to ">From ".

↓ Download mailbox.mbox
Filenamemailbox.mbox
FormatMBOX
Size1.1 KB (1,090 bytes)
MIME typeapplication/mbox
SHA-25685ff4064c9efec3a74d56ef8d3abc2d064f32dd9402bde713e1ff70a216f54da
What this file catchesmbox splitting. A parser that splits on every line starting with "From " will corrupt the third message; one that never unescapes ">From " will silently alter the body text.

Handle it in code

Each snippet below was run against this exact file with Python 3.14.4 and Node 24.15.0 when this page was built, and the output shown is what it printed.

Python

The standard mailbox module reads mbox files message by message, handling the "From " separator lines for you.

import mailbox

box = mailbox.mbox("mailbox.mbox", create=False)
for i, msg in enumerate(box, 1):
    print(f"{i}. {msg['From']} | {msg['Subject']}")
print(len(box), "messages")
box.close()

Run against this file, it prints: 1. Ava Stone <ava.stone@example.test> | Quarterly report 2. Liam Vargas <liam.vargas@example.test> | Re: Quarterly report 3. Ava Stone <ava.stone@example.test> | Tricky body 3 messages

Related guides and tools

Sample EML and MSG email filesReserved domains for test emailCharacter encodingsCheck a file's real typeVerify its SHA-256

Download & verify

curl -fsSL -o "mailbox.mbox" "https://files.hexaqa.com/email/mailbox.mbox"
curl -fsSL "https://files.hexaqa.com/email/mailbox.mbox" | sha256sum # expect: 85ff4064c9efec3a74d56ef8d3abc2d064f32dd9402bde713e1ff70a216f54da

More email test files

forwarded-nested.emlhtml-multipart.emlinline-image-cid.emllong-folded-headers.emlmissing-required-headers.emloutlook-message.msgplain-text.emlquoted-printable.eml

← All Email files