{"id":40,"date":"2005-04-09T12:08:41","date_gmt":"2005-04-09T11:08:41","guid":{"rendered":"http:\/\/bemused.org\/blog\/?p=40"},"modified":"2005-04-09T12:08:41","modified_gmt":"2005-04-09T11:08:41","slug":"moving-mail-from-mailapp-to-thunderbird-on-os-x","status":"publish","type":"post","link":"https:\/\/bemused.org\/blog\/2005\/04\/09\/moving-mail-from-mailapp-to-thunderbird-on-os-x\/","title":{"rendered":"Moving Mail from Mail.app to Thunderbird on OS X"},"content":{"rendered":"<p>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&#8217;m fed up with using a basic email client, especially when I&#8217;m more used to <a href=\"http:\/\/www.mutt.org\/\">mutt<\/a>.<\/p>\n<p>I found <a href=\"http:\/\/www.macosxhints.com\/article.php?story=20040401075611985\">this page<\/a>, which was helpful, but I have dozens of mailboxes that I wanted to import, so I needed an automated solution.<\/p>\n<p>Try the following at your own risk, I&#8217;m not responsable for any lost mail.  You do backup, don&#8217;t you ?<\/p>\n<p>1. in Mail.app, select all your folders, ctrl click and select &#8220;Remove deleted messages&#8221; (or whatever it is in English &#8211; I see &#8220;Eliminer les messages suprim\u00e9s&#8221;)<\/p>\n<p>2. Close Mail.app<\/p>\n<p>3. Make a copy of your mailbox :<\/p>\n<p><code>$ cp -r ~\/Library\/Mail ~\/mail-bak<\/code><\/p>\n<p>4. Make a list of all mailboxes you want to copy :<\/p>\n<p><code>$ cd ~\/mail-bak<\/code><br \/>\n<code>$ find . -name mbox | grep -v Deleted > mbox.list<\/code><br \/>\n<code>$ find . -name Incoming_Mail >> mbox.list<\/code><br \/>\n(Incoming_Mail is the name of the inbox where IMAP mail is stored)<\/p>\n<p>5. Copy the mail over to Thunderbird&#8217;s mail directory<\/p>\n<p><code>$ 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<\/code><\/p>\n<p>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.<\/p>\n<p>After this, start Thunderbird, and you should see all your new folders in the &#8216;Local Folders&#8217; subfolder<\/p>\n<p>good luck ;)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;m fed up with using a basic email client, especially when I&#8217;m more used to mutt. I found this page, which was helpful, but I have [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-geeky-stuff"],"_links":{"self":[{"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":0,"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"wp:attachment":[{"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bemused.org\/blog\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}