Re: [Exim] maildir Vs. mbox

Top Page
Delete this message
Reply to this message
Author: Vadim Vygonets
Date:  
To: exim-users
Subject: Re: [Exim] maildir Vs. mbox
Quoth Richard G. Duvall on Fri, Oct 22, 1999:
> Reading what somebody said on this list, it is easier on the system to
> store each message in a seperate file (maildir), because it doesn't have
> to be moving files around to temporary files, or eating up memory to open
> them. However, I was reading the pine notes in the pine distribution, and
> it said that mbox was better, because it doesn't have a bunch of files to
> thrash around.


As usual, both are true. Mbox keeps all your mail in one file.
When you want to read mail, you should parse the mailbox and then
seek to the correct location. When you want to delete mail, you
just delete a portion of the file, which results in part of the
mailbox moved "back", i.e., written again. Which is painful if
you have a large mailbox.

Maildir keeps every mail in its own file. If you want to parse
the maildir and display From: and Subject: headers, for example,
you must open and read lots of files. Which is painful if you
have lots of messages in your maildir. Also, you waste inodes
and lots of disk space (think blocks). If you want to delete a
message, you just unlink(2) the file, which is fast.

For small mailboxes, it's not an issue.

> Does anybody have a clue which is better?


Yes. None of them.

> Which is better for exim and pop3 combination?


If all your users do to read their mail is pop it to their
workstation and then store it there, traditional UNIX mbox is
probably more suitable.

> Granted that maildir won't
> work with pine, but I am not concerned with that at the moment. Pine can
> check pop3 anyway.


If you have local users who work with pine, first, don't tell
them to use pop3 -- it's, excuse me, idiotic. They can use
.forward files to pipe their e-mail to whatever program they want
(or to sort it with the Exim filter) to store it to whatever
mailbox format they want. Or they could use IMAP, for which
maildir is probably better, but of they have small enough
mailboxes, it's not a big issue.

BTW, mutt is optimized for writing mailboxes back on disk.
Unlike pine and most other mailers who rewrite all of the mailbox
each time a small change should be written, mutt only writes the
end of the mailbox. So if you're dealing with several recent
messages (which is what usually happens), writing the mailbox
back doesn't take much time.

Vadik.

-- 
Strange Fruit.  A brilliant way to describe
somebody hanging from a tree...
    -- Marcus Miller