[plug] Maildir vs mbox

Craig Ringer craig at postnewspapers.com.au
Thu Apr 1 15:35:17 WST 2004

On Thu, 2004-04-01 at 14:59, Ben Jensz wrote:

> I didn't like Cyrus last time I looked, so didn't really pursue it much 
> at all.

Fair enough. The documentation is somewhere between bad and absent, and
half of the useful stuff is on the wiki not in the distribution - so the
docs are enough to put off anyone. Then you get to authentication ...
*shudders in remembered horror*. I still have a PDF of the auth methods
map I did, which you can see here:w
Horrifying, eh? I know the diagram is bad, it was a very early version
to make sure I had everything there - it isn't very clear. Still - it
shows the complexity of the auth system.

That said, once you understand it it's a snap, and works wonderfully.
The IMAPd is reliable, fast, and efficient - I could easily forget it
was there.

> >The MTA does direct delivery? I thought most "serious" mail systems took
> >message delivery over LMTP rather than letting the MTA do the delivery
> >directly into the mail spools.
> >
> Okay, you've just gone over my head a little bit.  Reasons why it 
> should/shouldn't?

For direct delivery: 
  - simplicity
  - deliveries work even if LMTP delivery agent unreachable
  - works with even ultra-simple IMAP/pop services, as no special LMTP
    delivery agent is required.
  - No need for special mail server config for LMTP delivery
For LMTP delivery: 
  - All mail can be owned by the daemon and kept in a separate spool.
  - MTA doesn't need to understand mail format, only LMTP protocol
  - IMAP/POP service more easily keep indexes of mailboxes for 
    faster listing, etc
  - MTA and IMAP/POP service can be on different machines

There's another issue, too. Ideally you'd want to keep your mail spools
in a private, non-user-accessible location. This avoids "I cleaned up my
home folder and now my email is empty" syndrome. It also makes separate
back up schedules easier. For example, a _full_ mail spool backup goes
onto each nightly tape here, allowing me to more easily recover the mail
system _quickly_ if I need to. You can assign separate storage more
easily - for example, use reiserfs on a separate partition or LV for
your mail. This is great for backups - LVM snapshot your mail spools
without affecting anything else. You can also keep separate quotas for
mail more easily (though if all mail is owned by the daemon, you'd need
to use it's own quota system not the system quotas).

Personally, I strongly prefer the 'separate mail spool owned and managed
by the IMAP/POP service' approach myself.

> Comes with Fedora.. general comments about it seem to be that its secure.

Aha - that helps explain why some ISPs seem interested.

> I had heard of people having corruption issues with mbox, but had really 
> put it off as a non-issue in my mind as in the 4 and a half years since 
> we've had a Linux based mail server (it was NT4 / Exchange when I 
> started here), we haven't had any corruption issues at all.

It depends a lot on the particular server software etc that's in use,
but MBOX is more likely to be severely damaged if there is corruption.

> I was intending on using ext3 (and the machine is already setup on 
> ext3)... any potential issues with Maildirs?

Speed only, AFAIK. My homedirs are ext3 (no reason to change them) but
the IMAPd spool lives on a private reiserfs LV.

Craig Ringer

More information about the plug mailing list