There are better ways to store mail than mbox

Mail software that runs on Unix systems often stores multiple email messages in a single file, in an old file format named "mbox". Mbox has had a design flaw from the beginning, that damages some messages. Also, mbox is poorly defined and has many variants, so it's difficult for software to read correctly. When software is mixed, once in a while messages are lost.

Here is a full explanation of mbox.

The only solution is to stop using mbox, and store mail some other way.

Better ways

On Unix systems, the most popular other way is maildir. Maildir is a directory tree, with each message stored in a separate file. It was designed specifically to be a Unix user's incoming spool and inbox, and it does that well. It can also reasonably be used to store sets of messages for other purposes. Here's Wikipedia's description of maildir.

Unix also has the storage mechanism used by the mail reader MH. That also stores each message in a separate file, but is less complex than maildir, and does less -- it doesn't do incoming spooling or concurrent access. It works well for some uses that don't need all of maildir's function.

A new better way

Here is dotmail, a new way to store mail on any system, that stores multiple messages in a single file like mbox, but works much better.

And another thing

Don't let mbox leak out.