Compacting
X-Mozilla-StatusThe operation that actually removes deleted messages from an mbox file. Until it runs, a deleted message is only marked as deleted — it is still in the file, and still readable.
Thunderbird and other mbox-based clients do not rewrite a whole mailbox every time you delete a message; that would be far too slow. Instead they set a flag in the message's headers — X-Mozilla-Status and X-Mozilla-Status2 — marking it deleted, and move on. The bytes stay exactly where they were. Compacting is the separate step that rewrites the file without the flagged messages and reclaims the space.
This explains a common surprise: a folder that shows four thousand messages occupying nine gigabytes on disk. The difference is deleted mail that has never been compacted away. It also explains why a mailbox copied out of a profile can show messages the owner believes were deleted long ago — an external reader has no reason to honour a flag Thunderbird invented.
Before splitting, copying or handing over a mailbox, it is worth deciding deliberately which behaviour you want: compact first if those messages should not travel with the file, or skip it knowingly if they are part of what you mean to preserve. Either way, count the messages afterwards so you know what you actually have.
Related terms
A plain-text file format that stores multiple email messages concatenated together, each beginning with a "From " separator line. It is the format Google Takeout produces when you export your Gmail archive.
The process of detecting and removing duplicate email messages from an archive, typically by comparing Message-ID values, to avoid redundancy when merging multiple MBOX files.
A parsing technique that reads a file incrementally in small chunks rather than loading the entire file into memory at once, enabling tools to open and index very large MBOX files — tens or hundreds of gigabytes — with low memory usage.