Josef “Jeff” Sipek

mbox vs. maildir

Over the past two weeks, I decided to try converting some of the mboxes I have for mailing lists to maildirs. Last time I tried to do it, I noticed an unacceptable delay when I started mutt. Not when I tried to load the largest maildir. That made me give up.

For fun (or was it profit? ;) ), I decided to try again. And again, I saw that delay. This time around, I ran strace on mutt, and I found out that my custom .muttrc was making mutt believe that every file in the maildir was an mbox. Fixing up my .muttrc made the delay go away. Now, I have start up times that are the same as with purely mbox setup, but opening up these maildirs takes up WAY less time. I’m talking fraction of second instead of 5-10 seconds.

I’m considering converting all but the spam box to maildir. I really don’t need thousands of extra inodes which I’ll never use anyway, but at the same time, I don’t mind having one gigantic file full of the spam messages (I keep them because I don’t manually check that no good messages got misclassified by spamassassin). I am going to probably tell XFS to reserve some diskspace for it, to prevent lots of fragmentation from the constant open-write-close syscall cycle.


  1. /usr/bin/mail -E exits with 0 because it doesn't know about /var/mail/${USER}/new when one is using maildir, which means that it incorrectly reports "You have new mail." even when that is not the case. How did you deal with that?

    Comment by UNIX admin — August 28, 2016 @ 11:38

  2. I didn't. I kept /var/mail/* along (as mbox), but it never gets used since I set up a procmail rule to default to ~/Mail/INBOX (which is a maildir). Yes, this means that I never get the "You have new mail." message unless something went wrong and something got delivered to /var/mail.

    Comment by JeffPC — September 12, 2016 @ 13:36

Atom feed for comments on this post.

Leave a comment

Powered by blahgd