Maildir format (was Re: [Nolug] mailutils)

From: Mark A. Hershberger <mah_at_everybody.org>
Date: Fri, 18 Jul 2003 13:51:35 -0500
Message-ID: <87wuefy8g8.fsf@mah.mcdermott.com>

Craig Jackson <craig.jackson@wild.net> writes:

> 4) I don't want to use Maildirs.

Except for this requirement, you could use Courier.

I use Courier's imapd and pop3d. They are the reason I switched to
maildir format.

Its totally worth it.

First of all, the mbox format is broken by design.

    - Only a single imapd can access an mbox format mailbox at a
      time. Only one process can write to the mailbox at a time.
    - Lines beginning with "From:" are munged.
    - All sorts of special precautions must be taken in case mail is
      delivered to the box while it is open.
    - Precautions must be taken for, say, NFS mounted mail.
    - Deleting a message requires copying the mbox twice.
    - locking

>From what I can see, the mbx format suffers from these same problems.
The maildir format doesn't have problems.

Second, the maildir format is friendlier to to Unix.

For instance, on of the most flexible constructs in Unix is:

    find [dir] -type f | xargs [command]

I use this on my maildirs all the time. Let's say I know I have old
email somewhere from an fred@example.com about a payment he is
sending me. With all the messages in one file. I have to load the
file up in less and search for each instance of his address.

With maildir format I can quickly zero in on only the messages from
fred@example.com:

    find maildir -type f | \
        xargs grep -l '^From:.*fred@example.com' | \
        xargs grep -il 'payment' | xargs less

This shows me only the messages in any of my folders from
fred@example.com containing the word "payment". (Using text indexer
would make this even better.)

Finally, having one message per file makes a lot of sense.

Bottom line: there is a distinct advantage to having every message is
a single file.

Also see: http://cr.yp.to/proto/maildir.html

Mark.

-- 
As long as you have mystery you have health; when you destroy mystery
you create morbidity.			     -- G.K. Chesterson
___________________
Nolug mailing list
nolug@nolug.org
Received on 07/18/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST