[Top] [All Lists]

Re: Maildir support?

2003-12-11 02:30:06
Erik Berls writes:
On Wed, Dec 10, 2003 at 11:25:06PM -0600, Chad Walstrom wrote:
] Not an entirely bad idea. ;-)  I know it's been mentioned here before.
] There are some big logistical issues with this, however.  MH format uses
] the filesystem not only as a repository for email, but as a sorting
] mechanism as well.  Emails are actually renamed in sequence by the
] 'sort' program.  With Maildir format, your mail client must cache an
] index of references to the actual emails on the filesystem.  Both
] approaches have their strengths and weaknesses.

MailDir also makes user of nameing convention for sorting.
tokyo# ll new
total 16
-rw-------  1 v-worst  v-worst  5539 Dec 10 19:18 1071112710.18167_0.tokyo
-rw-------  1 v-worst  v-worst  8822 Dec 10 20:03 1071115425.18279_0.tokyo

Things get numbered as they come in.  Mail messages that come in at the
exact same time get the _0 incremented.

Except that in MH messages get renamed when a folder gets sorted,
whereas clients using a MailDir are meant to treat the filenames as
opaque except for the flags embedded in the filename which can be
modified according to a set of rules.

tokyo# ll cur
total 2
-rw-------  1 v-worst  v-worst  408 Jun 22 16:17 1056323803.664_1.tokyo:2,Sc

The additional issue is that MailDir changes the end of the filename to
represent certain flags.

The big issue is that the equivalent of the unseen seqence is done
via "new" versus "cur" directories for the messages.

There are probably several solutions to the renumbering issue.  The
trick is keeping things in sync with other mechanisms that might be
using the store.

The big issue I see is that rmming a message in a MailDir would change
the sequence numbers of all the messages with higher sequence numbers,
unless some external mapping of sequence number -> MailDir file is kept.

Such a sequence number approach defeats the whole "no need for locking"
advantage of MailDir... You could embed the sequence number in the flag,
except that MailDir specifies the flags must be in ASCII order (I think,
well some ordering anyway) meaking that impossible to do in the presence
of other MailDir clients.

I almost got motivated enough to try and add MailDir and mbox "support"
(as in treating them just like MH folders for MH commands) but the nmh
code scared me out of it :)


So I did some research. On the Web, of course. Big mistake...
        --Larry Wall

<Prev in Thread] Current Thread [Next in Thread>