Skip to content
Novus Examples
mbox1.9 KB

MBOX — Thread Plus Its Bounce, With mboxrd Escaping

Three messages in one mailbox: an original whose body contains both a bare "From " line and an already-escaped ">From " line, the reply that threads to it, and the multipart/report bounce that reply triggered. mboxrd escaping is what makes the round trip lossless.

Preview — first 50 linesmbox
From maya@brightside.example Wed Feb 18 09:00:00 2026
From: Maya Chen <maya@brightside.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: Standing order for Q1 (SAMPLE)
Date: Wed, 18 Feb 2026 09:00:00 -0800
Message-ID: <p7-mbox-root@brightside.example>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Sam,

The two lines below exercise mailbox escaping:
>From here on the quoted price is fixed.
>>From a forwarded copy, already escaped once.

Maya

From sam@meridiansupply.example Wed Feb 18 09:30:00 2026
From: Sam Rivera <sam@meridiansupply.example>
To: Maya Chen <maya@brightside.example>
Subject: Re: Standing order for Q1 (SAMPLE)
Date: Wed, 18 Feb 2026 09:30:00 -0800
Message-ID: <p7-mbox-reply@brightside.example>
In-Reply-To: <p7-mbox-root@brightside.example>
References: <p7-mbox-root@brightside.example>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Confirmed. Sending the invoice to dana@nonexistent.example as requested.

From MAILER-DAEMON@mx1.meridiansupply.example Wed Feb 18 09:31:00 2026
From: Mail Delivery Subsystem <MAILER-DAEMON@mx1.meridiansupply.example>
To: Sam Rivera <sam@meridiansupply.example>
Subject: Delivery Status Notification (failure) SAMPLE
Date: Wed, 18 Feb 2026 09:31:00 -0800
Message-ID: <p7-mbox-dsn@mx1.meridiansupply.example>
In-Reply-To: <p7-mbox-reply@brightside.example>
Auto-Submitted: auto-replied
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status; boundary="=_p7_mbox_dsn"

--=_p7_mbox_dsn
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit

Delivery to dana@nonexistent.example failed permanently.
--=_p7_mbox_dsn
Content-Type: message/delivery-status
60 lines total — download for the full file.

Specifications

Wave
p7
Seed
20260807
Messages
3
Escaping
mboxrd
Escaped Body Lines
2
Contains Multipart Report
true
Thread Depth
2
Line Endings
LF (Unix mailbox storage)

Testing contract

Expected to pass
Scenario
Split a mailbox whose message bodies contain lines that look like mbox separators, then thread the reply and attach its bounce.
Expected result
Exactly three messages are found — not five — the two escaped body lines unescape to "From " and ">From ", and the DSN is linked to the reply by In-Reply-To.

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 — Thread Plus Its Bounce, With mboxrd Escaping” is a deterministic Novus Examples fixture for Email parsing, Error handling, 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 · 3 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-thread-with-bounce.mbox"):
    print(msg["subject"])

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