[svlug] mbox vs. maildir?

Rick Moen rick at linuxmafia.com
Tue Nov 17 18:25:22 PST 2015

Quoting Ivan Sergio Borgonovo (mail at webthatworks.it):

> For me:
> - I prefer to risk to burn in flames a single message than screw thousands

Yeah, I've worried about this, but it just hasn't happened.  (I also do
backups just in case of that and innumerable other types of bad

Suspect it requires hostile action by either dodgy file locking (e.g.,
NFS) or dodgy MUA or LDA software (e.g., something less solid than mutt
and procmail).

> - if you delete/edit messages after receiving them maildir is much 
> faster (eg tagging messages or deleting attachments...)

mutt's incredibly fast at edit/replace of messages in an existing large
mbox.  For delete, my reading cycle involves marking for deletion a
bunch of individual mails as I go along, then at some point mutt's '$" 
command for sync-mailbox = 'save changes to mailbox' mass-implements the

Working with my ~/inboxes/lists mbox file, currently standing at 24060
mailing list messages, doing a mutt sync-mailbox operation takes about
1.5 sec.  (That's on an antique PIII with very old SCSI drives.  After
updating to a modern box with primarily SSD storage, that will be a lot

Mind you, 24060 messages in a single mbox is probably well past time to
archive off the old ones into a separate mbox and starting a new one.
Or something like that.  I've archived off older mailing list mail
before, and probably will again at irregular intervals.

> Performance impact of opening thousands of files in spite of one is 
> mitigated by indexing.

Yes, certainly.  Good point.

> grep is not the right tool for searching into emails, especially if you 
> want to reply, extract attachment, add some boolean logic to your filters.

Extremely often, I _just_ want to find a message.  However, I certainly
agree that grep's entirely suboptimal.  That's why I love just being
able to use the '/' function in /usr/bin/less.  

If I then want to reply, extract, etc., it's then pretty easy to bring
up the right message in the applicable already-running instance of mutt.

I'm guessing you mean you use whatever search function is in your MUA.
(But then...:)

> IMAP is much better 99.9% of the times[0] and in the 0.1% left, grep 
> alone won't be enough.

Er, searching over IMAP?  OK, interesting.  Of course, since on my
personal box I avoid the need for IMAP at all, I wouldn't have tried
that.  I'd guess off the cuff that it'd be pretty slow.  (I see you
mention Solr as a remedy further on.  IMO, if you have to compensate for 
basic search sluggishness using a Java search engine, it's worth
considering a fundamentally different model, like reading mail on one's
MTA box rather than over IMAP.

(And sure, that has quirks many will find unacceptable.  Tradeoffs, we
have them, and they have us.)

> For mbox grepmail[1] is going to solve some of those problems but not all.

Looks useful, thanks.  I might try it some time, though in general I'm
perfectly satisfied with just doing the intuitive search in

I'm not at all trying to allege that said approach yields superior 
results necessarily; it's the result of my usual heuristic of tackling a
problem using standard Unix tools and then stopping the moment something
works well enough -- in the classic tradition of 'worse is better'.

More information about the svlug mailing list