An .mbox Is Messages Glued End to End, and the Glue Is a Line
Published 9/7/2026 · 4 min read · File tools
Daniel Okonkwo — Front-end developer and tech writer at OneKitly
Web performance · File formats
Checked against 3 sources
An mbox is the oldest way of keeping mail on disk and still the format almost every service exports to: messages written one after another in a single text file, each preceded by a line that starts with From followed by a sender and a date. There is no index, no length field and no escape character — the separator is recognised by looking like one, which is the weakness. A body line beginning From at column zero looks exactly like a separator, and readers that anchor on those five characters alone will cut the message there. The failure is silent: the orphaned tail has no headers, so it is discarded, the message count still looks right and the message is simply missing its ending. The fix, in this viewer and in every careful implementation, is to require the whole shape — From, a sender, then a date — and to undo the greater-than sign that senders prepend to such lines, so that a quoted From comes back as it was written.
One file, thousands of messages, separated by a line beginning From. The format has one famous weakness, and it is the reason a message can lose its ending without anything reporting an error.
Why an export gives you one enormous file
Ask Gmail, Thunderbird or most other services for your mail and what comes back is one .mbox per folder, often several gigabytes, which no ordinary text editor will open and no mail client will show you a table of contents for. That is not laziness on their part: a single append-only text file is the cheapest thing to write, the easiest to copy and the hardest to corrupt, which is why the format has outlived the machines it was invented on. What it does not do is let you get at one message without reading the file to that point.
The practical consequence is that you want to split it before doing anything else. Turning the mbox into individual .eml files gives you one file per message, named and dated, that any search tool on your machine can index and any mail client can open — and it makes the archive something you can keep a subset of rather than all-or-nothing.
The greater-than sign nobody explains
Because the separator cannot be escaped, the convention became to disarm the problem when writing instead: a body line that really begins with From is stored as >From. Read the file naively and that greater-than sign stays in the text, which is why archived mail sometimes contains lines like >From my point of view that nobody typed. A line that already began with a greater-than sign gains another, so a quoted quotation can arrive as >>From. Undoing one level on the way in restores the message; undoing none leaves a small, permanent corruption in every archive you keep.
| Line in the file | Anchored on «From » alone | Anchored on the whole shape |
|---|---|---|
| From expediteur@example.fr Mon Sep 7 14:02:09 2026 | separator | separator |
| From here on it gets interesting. | separator — message cut here | body text |
| >From Jean, hier soir | kept, with the > still there | body text, > removed |
| Messages found | 3 — and one is truncated | 3, all complete |
Frequently asked questions
- How do I get an .mbox out of my mail account?
- Through the data export the service is obliged to offer. Gmail exports through Google Takeout, choosing Mail; Thunderbird and Apple Mail export a folder directly; most other providers have an equivalent under account settings or privacy. What you get is one file per folder, so a full account can be several files and several tens of gigabytes.
- Can my browser handle a file of several gigabytes?
- It depends on your machine's memory, since the file is read locally rather than uploaded. A few hundred megabytes is comfortable on most computers; several gigabytes may not be. If a very large archive stalls, split it first with a desktop tool, or export one folder at a time from the service rather than the whole account — a per-folder export is smaller and easier to work with anyway.
- How can I tell whether an old archive was truncated?
- Look for messages that stop mid-sentence, and for lines beginning with a stray greater-than sign in front of the word From. Both are fingerprints of a reader that anchored on the five characters alone. The message count will not tell you: that is exactly what makes the failure hard to notice, because a truncated message is still counted as one message.
Articles you may find interesting
All guides →Related tools
Sources
Spotted a mistake in this article?