<<< Date Index >>>     <<< Thread Index >>>

Re: How to convert maildir to mbox format



On Fri, 18 Jun 2004 22:31:59 -0500, David Champion wrote:

>* On 2004.06.18, in <E1BbW51-0002Ny-00@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
>*      "Larry Alkoff" <labradley@xxxxxxxxxxxxxx> wrote:
>> There are many mbox to maildir format conversion programs
>> but I have not found one going the other way.
>> 
>> Does anyone know of such?
>
>You can use formail (from the procmail package) for this.
>
>cd maildir
>: > ../mbox
>for file in new/*; do
>       formail -I Status: <"$file" >>../mbox
>done
>for file in cur/*; do
>       formail -a "Status: RO" <"$file" >>../mbox
>done
>
>
>Alternatively, mutt will save a mailbox in any supported format to
>any other supported format. Set $mbox_type in muttrc to control the
>preferred save format. You can use mutt to batch-convert a bunch of
>scripts, if you set various options to disable prompting, and use the -e
>option to mutt to feed it commands at startup.
>


Hello David.

I tried your script and it worked to create an mbox like file.
Amazing that it's so easy to do and that all my googling didn't turn up 
"formail".


One problem.
In the created mbox file, each
"From " line that starts a message contains a line like for example:
>From sentto-2577139-187-985364714-labradley=mindspring.com@xxxxxxxxxxxxxxxxxxx 
> Sat Jun 1
9 08:55:03 2004


Is this a proper mbox format?
I've looked at a few mbox files and the From lines I've seen all start with 
"From " then the email address, then date-time.
In the above case it would have been:
>From labradley=mindspring.com@xxxxxxxxxxxxxxxxxxx  Sat Jun 1 9 08:55:03 2004

Is this a format that Mutt would understand?

Thanks for your help,
Larry





Larry Alkoff N2LA - Austin TX