Dotmail file format

Dotmail is a simple, portable way to store multiple internet mail messages in a single file. I invented it, as a replacement for mbox format.

Here is the dotmail specification.

Here are a pair of small C programs that demonstrate dotmail:
files_to_dotmail.c
dotmail_to_files.c

Why invent dotmail?

Why invent dotmail, when there are other replacements for mbox?

There's maildir, which works fine, but it's more than just storage for a set of messages. It also does random access, concurrent access, and spooling of incoming messages, and it only works on Unix systems. It's too different from mbox to be a direct replacement in all cases.

Some programs put messages in a database, and that works too, but again it's quite different from mbox: complex, non-portable, and sometimes proprietary.

For some uses, putting multiple messages in a single text file is a good approach. It's simple, portable, and easy to implement. It works well for import/export, file transfer, and archives. It can be done in any filesystem, or on a device with no filesystem. And it can be used as a live stream of messages, passed through a Unix pipe, rather than stored in a file.

We need something that's similar to mbox, except that it's well defined, there's only one version of it, and it works. And it has to be distinctively different from mbox, easily identifiable by software.

That's the purpose of dotmail format: to be equivalent to mbox, to be an easy direct replacement anywhere mbox is used. Dotmail does correctly, and easily, what mbox has never quite gotten right, and never will.

Software that uses dotmail

softwarefirst version
with dotmail
web site
GNU mailutils3.7https://mailutils.org