What is the MBOX file format?
A file with the .mbox extension is an email mailbox that stores a list of messages for a given recipient in sequential order. .mbox is a plain-text format - each message starts with a From separator line (the word From followed by a space, the sender address, and a timestamp), and messages are concatenated one after another in a single file. The format was informally described in RFC 4155 (2005), which codified conventions that had existed for decades without a formal standard.
.mbox files (short for MailBOX) trace their origins to simple Unix mail clients in the 1970s. macOS, which is based on Unix, adopted the format for its earliest built-in mail client. The format has several known disadvantages:
- No built-in message encryption - any user with access to the
.mboxfile can read its contents. - Sequential reads from a single file become slow and error-prone for large collections of messages.
- File locking must be employed to prevent corruption when multiple processes access the mailbox simultaneously.
- Deleting a message requires rewriting the entire file.
The original .mbox format became the basis for four closely related variants: mboxo, mboxrd, mboxcl, and mboxcl2 - each handling the From line-quoting problem differently. These variants are not fully compatible with each other. Compared to newer formats such as .eml or .emlx, .mbox offers simpler tooling but weaker scalability. .mbox files can be opened in any text editor, though manually editing them is not recommended, as it can introduce parse errors in mail clients.
Security & safety
RISK: MEDIUMThe mbox file is plain text and inert, but it contains real emails - so it carries the usual email risks once opened in a client: malicious attachments, phishing links, and tracking pixels. Open an untrusted mbox in a client that sandboxes content (Thunderbird/ Apple Mail) rather than blindly extracting attachments. Because an mbox can hold years of mail, treat it as sensitive personal data: a Gmail Takeout .mbox is your entire mailbox in one readable file. Avoid uploading confidential mbox files to online converters; use a local tool. The several mbox variants (mboxo/mboxrd/cl/cl2) can cause messages to split incorrectly if a body line starts with 'From ' - a data-integrity, not security, caveat.
Format details
in a nutshellPrograms that open MBOX files
Technical details
deep spec| Format type | Plain-text container concatenating multiple email messages in a single file |
| Message separator | `From ` line at the start of each message (the word From, a space, sender address, and a UTC timestamp) |
| File structure | All messages stored sequentially in one flat file; no internal index or directory |
| From-line quoting | Body lines beginning with `From ` must be escaped (typically prefixed with `>`) to avoid being mistaken for message boundaries; the exact method differs across mbox variants |
| Sub-format variants | mboxo, mboxrd, mboxcl, and mboxcl2 - four incompatible dialects differing in how they quote `From ` lines and record Content-Length |
| MIME type | application/mbox |
| Encoding | US-ASCII or UTF-8 plain text; binary attachments are MIME-encoded (typically Base64) inside each message |
| Locking | Requires external file locking (dotlock, flock, or fcntl) to prevent concurrent-write corruption; no built-in locking mechanism |
| Deletion | Messages are soft-deleted via a `Status: D` header; permanent removal requires compacting - rewriting the entire file |
| Search performance | Linear O(n) scan required; no built-in index - large mailboxes rely on external indexes such as notmuch or a mail client header cache |
| Compression | No built-in compression; commonly archived as gzip-compressed `.mbox.gz` files for long-term storage |
| Multi-user access | Single-writer model; simultaneous multi-process access requires OS-level locking and risks data corruption without it |
| Portability | Cross-platform plain text - readable on any OS without proprietary software or special drivers |
| Magic bytes | None - identification relies on finding a `From ` separator line at the very start of the file |
| Typical file size | Unbounded; a single `.mbox` file can contain thousands of messages and grow to several gigabytes in large mail archives |
| Released | 1970s (Unix mail); informally documented as RFC 4155 (2005) |
| Open standard | Yes · royalty-free |
| Specification | www.rfc-editor.org |
MBOX conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about MBOX files.