can you get more random?

Moving Mail from Mail.app to Thunderbird on OS X

April 9th, 2005 Posted in tech

I finally decided to switch from OS X default Mail.app to thunderbird. apparently the Mail.app in 10.4 is going to be amazing, but I cant wait that long, and I’m fed up with using a basic email client, especially when I’m more used to mutt.

I found this page, which was helpful, but I have dozens of mailboxes that I wanted to import, so I needed an automated solution.

Try the following at your own risk, I’m not responsable for any lost mail. You do backup, don’t you ?

1. in Mail.app, select all your folders, ctrl click and select “Remove deleted messages” (or whatever it is in English – I see “Eliminer les messages suprim├ęs”)

2. Close Mail.app

3. Make a copy of your mailbox :

$ cp -r ~/Library/Mail ~/mail-bak

4. Make a list of all mailboxes you want to copy :

$ cd ~/mail-bak
$ find . -name mbox | grep -v Deleted > mbox.list
$ find . -name Incoming_Mail >> mbox.list
(Incoming_Mail is the name of the inbox where IMAP mail is stored)

5. Copy the mail over to Thunderbird’s mail directory

$ cat mbox.list | while read line ; do newfile=`echo $line | sed 's/ /_/g' | sed 's/^\.\///g' | sed 's/\//-/g'`; cp "$line" /Users/gareth/Library/Thunderbird/Profiles/xxxxxxxx.default/Mail/Local\ Folders/$newfile ; done

this will create a folder with the name equal to the path where the mbox file was found. Its a bit messy, but at least you know which folder is which, and you can rename after.

After this, start Thunderbird, and you should see all your new folders in the ‘Local Folders’ subfolder

good luck ;)

Share

Post a Comment