[svlug] mbox vs. maildir?

Rick Moen rick at linuxmafia.com
Tue Nov 17 15:46:09 PST 2015

Quoting Akkana Peck (akkana at shallowsky.com):

> All this (interesting and useful -- thanks, everyone!) discussion
> of procmail and dovecot and fetchmail is making me think about
> reorganizing how I deal with mail.
> I see that dovecot prefers to use maildir format, while I've
> always used mbox, except for one brief and unsuccessful attempt
> about a decade ago. It's probably time to rethink that.
> I'm curious: how many of you who use tools like dovecot and mutt
> use maildir, and how many use mbox? Did everybody but me switch to
> maildir long ago? Is forcing dovecot to use mbox asking for trouble?

Use-case matters, here.

Some people (like me) use strictly local mail spools, i.e., on my MTA
box.  Some have mail spools on NFS.  Some are accessing mail spools
remotely using IMAP or a similar remote access protocol.

The original justification for Maildir was mail spools on NFS
(corruption risk on account of locking problems) and MUA performance
reading even a local mailbox.  I don't have NFS in the picture, and mutt
is quite fast even on a large mbox[1] -- especially given that I leave
instances of mutt running 24x7 in GNU screen sessions, hence almost
never need to restart them.

Personally, I really like being able to find something in a mailbox just
by 'less'ing a single file, typing '/', and entering a search string -- 
as opposed to an elaborate 'find . -name "*" -exec grep expression {} \;' 

In my experience, mutt deals intelligently with the LDA or users
changing the mbox file it's reading and writing -- and procmail returns
the favour by intelligently dealing with mutt changing the mbox under
it.  I'm not sure this is the case with Maildir; see the section about
'locking' on Dovecot's page for details:

Other people, other scenarios, other concerns, other solutions, though.

Obviously, the cleaner structure of a Maildir tree has the drawback of
being spread across a colossal number of little tiny files.  An mbox
file can itself become a _single_ colossal file, which has its own
difficulties but gets mitigated by indexing, for reasonable values of 
'colossal'.  (When mboxes get too big, there are various coping

Note that there are other formats sometimes found, including 
a family of high-performance formats invented by the authors of Dovecot,
called 'dbox':


Other than that, I'm not your guy for advice, because I haven't
experimented with the sorts of setups you mention.  But with luck others
will speak up, too.

[1] Some coders, notably Prof. Bernstein of qmail fame(?) distinguish
several allegedly distinct flavours of mbox, which you'll find lovingly
detailed in the mind-numbing Wikipedia article on the topic.  I consider
these differences pretty much trivial scripting details.

Cheers,                                           WallJam7: Roses are red,
Rick Moen                                         WallJam7: violets are blue.
rick at linuxmafia.com                               WallJam7: All of my base
McQ! (4x80)                                       WallJam7: are belong to you.

More information about the svlug mailing list