[Summary: Is there a simple mbox->Maildir conversion tool that preserves
the "Replied", "Seen", "Trashed" and old/new status of the messages?]

I've looked through 3 different mbox->Maildir conversion tools
(http://www.qmail.org/top.html#maildir), but none of them seem to address
the problem of preserving message flags. In an mbox, message flags
("Read", "Deleted" etc.) are stored as headers.

pine and mutt (I'm guessing POP/IMAP does something similar; correct me if
I'm wrong, since I don't use POP/IMAP) can set these headers to indicate
various flags:

Status: RO
X-Status: AD

A = message has been Replied to
R = message has been Seen
D = message is marked to be Trashed
O = message is old
(Any other flags I missed? Those are all the ones that show up in
"Status:" or "X-Status:" in my 10009 message mailbox.)

>From reading the Maildir specification
(http://cr.yp.to/proto/maildir.html), I gather that this is the conversion

1. The message should be placed in new/ unless "O" is set, in which case
   it should be placed in cur/.

2. The flags ARD should be converted to RST in the maildir filename, if
   the file is in cur/.

I also think that these maildir conversion utilities are written too
complex, which makes it harder to incorporate them into one-liner shell
scripts. The ideal interface to a maildir conversion program could be like

mbox2maildir < Mailbox ~/Maildir

which reads the mailbox from standard input, and takes the first argument
as the path to the Maildir. Even though this can only convert one mailbox
at a time, someone can just do "for x in /var/spool/mail/*" to
mass-convert mailboxes.

Thoughts? Is there a mbox->Maildir conversion utility that has the
qualities I described, or should I consider writing one myself?

P.S. How should the following header be interpreted? Note the doubled
"From" line. I have three messages like that in my 10012 message mailbox;
one of the mbox->Maildir conversion utilities I tried made that into two
messages (the first one being blank). I'm guessing that since there was no
blank line after the first "From" line, it should have known better.

>From [EMAIL PROTECTED]  Fri Apr 14 14:05:59 2000
>From [EMAIL PROTECTED]  Fri Apr 14 14:05:59 2000
X-UIDL: cd2063b7269c3a7a8d7faaf20cc13632
Return-Path: <[EMAIL PROTECTED]>

Reply via email to