I’ve been using the maildir format for my mail boxes for some years now. I’m really happy with this solution - no locking issues, and decent support in all applications I use.

(Well, evolution has been crashing with Maildir recently, but switching to using a local IMAP server resolved this just fine.)

But the biggest benefit of maildir is that it’s dead easy to write your own tools for it. I’ve written a small perl script that moves read mails that are not flagged into my archive after 30 days. Over the last few years, this archive (not containing large mailinglists such as debian-devel which are publicly archived) has grown a lot.

Now the benefits of maildir, a separate file for each mail, turn into drawbacks. For my archive, I don’t need to care about locking or random access. Actually I rarely access it ever. But since a file always occupies whole blocks, my mailarchive occupies 1.6 GB on my disk, with just 1.2 GB of data. An experience value is a compression ration of around -60% for bz2. So by switching from Maildir to mbox.gz I can probably free up 800 MB on my disk. (And I’ll move the older years onto my encrypted backup HD anyway)

Now I’m looking into scripting the conversion from Maildir to mbox.gz. I’m still a bit undecided on which tools to use…

[Update: python2.5 has support for mbox and maildir… Here’s maildir2mbox in 5 lines of python:

import sys, mailbox
md = mailbox.Maildir(sys.argv[1], None)
mb = mailbox.mbox(sys.argv[2])
for mail in md:
        mb.add(mailbox.mboxMessage(mail))

nice, uh? ;-) ]