[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Converting between maildir and mbox



Brian Nelson wrote:

> Paul 'Baloo' Johnson <baloo@ursine.dyndns.org> writes:
> 
> > So for those of us not in the know, how easy is it to switch between
> > maildir and mbox in either direction and what does it involve?
> 
> First, run 'maildirmake Maildir' to create a maildir folder.

There's actually a tool to create maildir folders? I just do this:

   mkdir Mail/folder
   mkdir Mail/folder/cur
   mkdir Mail/folder/new
   mkdir Mail/folder/tmp

Seems to work well enough. Mutt is perfectly happy with such folders.

> Probably
> the easiest way to move your messages around is to use a MUA that is
> both mbox and maildir aware, like mutt.  Just save your messages from
> the mbox file to the maildir, or vice versa.

Or, if you already have procmail set up, just adjust it for the new
format, then pipe your old mail into it. Actually, I'm not sure that
will work with an mbox file as input, because procmail might prefer to
be invoked once per message (?). But it definitely works when your
source format is MH or maildir. I imagine with mbox as input, you could
do a simple script using awk or perl to pipe each message individually
though procmail. Though at that point, the MUA would be simpler, as long
as it understands both formats (which may not be the case).

Craig



Reply to: