Exporting mail folders to CDROM

Andrew Daviel <[email protected]> Fri, 6 Jan 2012 00:48:13 -0800 (PST)
Newsgroups gmane.mail.imap.uw.c-client
Message-ID <[email protected]>
When transferring mail between different systems, it's probably easiest 
for a user to log on to two IMAP servers in a mail client and just drag messages 
across. But we were looking for a way to export a user's folders to some 
kind of portable format on removeable media without a lot of user 
interaction.

I found some notes on Mozilla's file format which seems to be consistent 
across Linux and Windows, and is basically a Unix mail file with an 
external .msf index, which Thunderbird will recreate if missing. So one 
can just copy files into the mail directory, or use the ImportExport 
add-on, and get Unix mail folders off a CD into a Thunderbird local 
folder.

https://nic-nac-project.org/~kaosmos/mboximport-en.html
http://en.wikipedia.org/wiki/Mbox

Having done that, it seems that all the message flags are missing, except 
"Read", so I wrote a bit of Perl to set them. The resulting 
X-Mozilla-Status headers should be harmless to other Unix mail readers.

I'm probably re-inventing the wheel, but if anyone's interested :

$ mailutil copy -kw foobar \#driver.unix/foobar.unix
$ unix2tbird.pl < foobar.unix > foobar.mozilla

http://andrew.triumf.ca/unix2tbird.pl