[TAG] maildir to mbox conversion
dups@neanderthal.ws
dups
Sun Apr 24 18:54:54 MSD 2005
On Fri, Apr 22, 2005 at 07:44:41PM -0400, Benjamin A. Okopnik wrote:
> On Fri, Apr 22, 2005 at 12:25:50PM +0100, Thomas Adam wrote:
> > On Thu, Apr 21, 2005 at 09:28:57PM +0530, Joydeep Bakshi wrote:
> > > finally I like to go for sylpheed-claws. at present it can't
> > > support maildir folder .so I have to change all the mails of kmail
> > > from maildir format to mbox. is there any script/programme which
> > > can do this conversion ? Kmail can do this. but I am looking for
> > > any console based or light weight GUI utility.
> >
> > Where do you get your information from? Sylpheed-{claws,vanilla}
> > has always supported maildirs - in fact it's mbox that it won't do,
> > so I don't see what your problem is.
> >
> > If you want to go maildir -> mbox, then the best way is to do it
> > manually, even if crudely put:
> >
> > `` cat foo >> ./mbox ''
> >
> > for each file.
>
> The above could, of course, be simply done with
>
> `` cat /my_mail_dir/* > mbox ''
>
> However, that will not create a mailbox. :)
>
> Going by my dim recollection of having done this before, and
> reinforcing it with a quick Google search - which confirmed the former
> - the maildir format is missing the 'From ' line at the start of each
> email, without which the mbox will not be recognized as an mbox. Here
> is something that _should_ do it, though. (WARNING: this code has not
> been tested - be sure to keep your original archives until it has been
> *proven* to work!)
>
> ---------------------------------------------------------------------
> #!/bin/bash # Created by Ben Okopnik on Fri Apr 22 19:16:58 EDT 2005
>
> # Set this to your maildir directory MAIL=/my/mail/dir # Set this to
> the filename you want as your mbox MBOX=/tmp/mbox # Set this as the
> "From " name for the mail header (pick one at random)
> NAME=foo at foofoo.com
>
> for n in $MAIL;do (echo -e "\nFrom $NAME `date`"; cat $n)>>$MBOX;done
> ---------------------------------------------------------------------
Hello TAGsters,
Formail will take care of inserting the missing 'From ' lines -
$ cat /my_mail_dir/* | formail -ds > mbox
-- Andrew
More information about the TAG
mailing list