Skip to content
OneKitly

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

Daniel Okonkwo — Front-end developer and tech writer at OneKitly

Web performance · File formats

Checked against 3 sources

View profile →
In short

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.

Advertisement

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.

Three messages, one of them quoting a line that starts with From
Line in the fileAnchored on «From » aloneAnchored on the whole shape
From expediteur@example.fr Mon Sep 7 14:02:09 2026separatorseparator
From here on it gets interesting.separator — message cut herebody text
>From Jean, hier soirkept, with the > still therebody text, > removed
Messages found3 — and one is truncated3, all complete
MBOX viewerList every message in an mbox export — sender, date and subject — without a mail client.Try the tool →
Advertisement

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 →
How-toSplitting a Mail Archive Into One File per MessageAn .mbox is one enormous file your operating system cannot search. Turn it into .eml files and every message becomes something your machine indexes, your mail client opens and you can delete one at a time.ExplainerAn Attachment Grows by a Third Inside the EmailMail carries files as text, three bytes written as four characters. A 10 MiB attachment occupies 13.68 MiB of the message, which is why a 25 MB limit really means about 18 MiB of files.ExplainerWhy Your Subject Line Arrives as =?UTF-8?B? and a String of LettersMail headers are allowed to carry ASCII only, so an accented subject is encoded before it travels. Two encodings are in use, both start with =?, and decoding them is the whole difference between a readable message and a wall of symbols.ExplainerEmail HTML Is Twenty Years Behind the Web, on PurposeNo stylesheet, no script, layout built from nested tables and styles written on every single tag. Knowing why explains what an exported HTML file will and will not look like.How-toOpening an .eml File Without Telling the SenderA saved message is a text file you can read anywhere. The catch is that opening it in something that loads remote images announces the moment you did — which is what a tracking pixel is for.ExplainerA Recurring Event Is One Line in the CSV, Not TwelveAn .ics file stores a weekly meeting once, with a rule attached. Export it to CSV and you get a single row for the whole series — which is the file being honest, not the converter losing rows.

Related tools

Sources

Spotted a mistake in this article?