Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

Import mailboxes from Thunderbird into Mail.app Apps
No formal tool exists for this that I'm aware of, but users who use Thunderbird may have a need to do this for one reason or another (as I did). I accomplished this task manually by doing the following:
  • Navigate to ~/Library: Thunderbird: Profiles: your_profile: Mail: Local Folders. Identify the mailboxes you seek to use in Mail.app.
  • Each mailbox has three pieces to it - i.e. inbox.sbd, inbox.msf and inbox with no extension.
  • Take the file with no extension, hold down the Option key (so it also stays in the folder) and drag it to the desktop.
  • Rename this copy with .mbox as the file extension. For example, inbox becomes inbox.mbox.
  • Open Mail.app and select File: Import, choose Other, and navigate to the desktop and click Choose. Choose the file you just renamed. Your mailbox(es) should appear in the import window and will import into Mail.app.
[robg adds: This earlier hint provided a script to clean up Mozilla Mail's files for import to Mail. This is apparently due to a problem with Mail's handling of whitespace (according to the posted comments). Since Thunderbird is evolved from Mozilla Mail, there may be a similar issue with importing some mboxes. If you have issues, you might want to try the script from the previous hint...]
    •    
  • Currently 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[112,323 views]  

Import mailboxes from Thunderbird into Mail.app | 25 comments | Create New Account
Click here to return to the 'Import mailboxes from Thunderbird into Mail.app' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
Import mailboxes from Thunderbird into Mail.app
Authored by: jmontana on Tue, Apr 5 2005 at 10:48AM PDT
I used the cleanmbox python script with great success: http://www.marklyon.org/gmail/cleanmbox.py

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: loungeboykip on Wed, Apr 6 2005 at 6:01PM PDT
How do you run this script in OS X?

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: MonkeyMini on Tue, Apr 5 2005 at 11:25AM PDT
Excellent, I look forward to trying this out.
With Mail's new integration with iPhoto, I was hoping to find a simple solution by the time Tiger comes out! Thanks.

---
www.monkeymini.co.uk
osxhints@monkeymini.co.uk

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: vocaro on Tue, Apr 5 2005 at 12:26PM PDT
Not sure why all these steps are necessary. If you just choose the Netscape/Mozilla option in Mail.app's Import command, it should find all the mbox files for Thunderbird, assuming you point to the ~/Library/Thunderbird/... directory, as specified in the hint.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: jmontana on Tue, Apr 5 2005 at 1:02PM PDT
Except that it usually doesn't. And if it does find them, you will note that a significant percentage of your email did not get imported. The times I tried to do this, there were hundreds of emails that didn't get imported.

That's why I had to use the cleanmbox script mentioned earlier. After cleaning them, you end up with a bunch of ".cleaned" mailboxes which *do* import properly.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: vocaro on Tue, Apr 5 2005 at 4:59PM PDT
Yes, I'm aware of the cleanmbox script. I'm the author. :)

My comment was regarding this particular hint, however, which suggests renaming mbox files and selecting "Other" as the import option. I am questioning whether these steps are truly necessary. Applying my script and choosing "Netscape/Mozilla" as the import option should be all that is needed.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: sunbane on Tue, Apr 5 2005 at 6:10PM PDT
I had nothing but problems using mail.app's import command. Mainly doing w/ larger folders that had been put into archive mode. I ended up setting up an imap server on a linux box... dragged my folders to my imap account in thunderbird, and then hooked into imap w/ mail.app, and dragged all the folders local. That was the result of MUCH searching on this subject on the web (switching from windows to os x).

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: MonkeyMini on Wed, Apr 6 2005 at 2:52PM PDT
Could anyone point me in the right direction on how to run a python script?
I've just bought into the whole Mac thing, and I really want to convert my Thunderbird mail to Mail.app but I've no idea where to start with the python script.

I downloaded Platypus in the hope I could make an application for it but I've not got anywhere? How do I pass the .mbox to the script?

Thank you :)

---
[url]www.monkeymini.co.uk[/url]
[email]osxhints@monkeymini.co.uk[/email]

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: drolander on Thu, Apr 14 2005 at 9:46AM PDT
To use a Python script, open a terminal window, and type:

python somescript.py optional_parameters.

This is the same way you would run a python script from Windows using a console (DOS) window.

I used the cleanmbox.py script and it worked fine.


[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: loungeboykip on Wed, Apr 6 2005 at 6:02PM PDT
I tried following these instructions but when I try to import the mboxes they're greyed out and mail.app won't like me choose them.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: MonkeyMini on Thu, Apr 7 2005 at 3:49AM PDT
Just click continue and Mail will read all valid files in that directory. How did you run the script?

---
[url]www.monkeymini.co.uk[/url]
[email]osxhints@monkeymini.co.uk[/email]

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: caj on Mon, Jul 4 2005 at 11:21AM PDT
I have had this same problem. After running the script, I have opened Mail.app, selected File/Import, have navigated to the directory where my newly cleaned files are only to find that Mail.app shows them as greyed out and unselectable.

Anyone have a solution or at least an explanation to this?

---
- caj

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: phenomenologist on Wed, Aug 3 2005 at 3:35PM PDT
Like the previous user said, all you have to do is select File -> Import, then go into the directory that your *.mbox files are located. They will all be greyed out, but just click on the 'Continue' button anyway. This will show all the *.mbox files and you can check off which ones you want to import.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: DocMan on Tue, Oct 31 2006 at 12:49PM PST
Throw the mbox files in a folder (with the other associated files) and select the folder in the Mail Other import dialog.

Doc

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: etcetera on Mon, Apr 18 2005 at 12:00PM PDT
I've just tried this using the Python script and have found that many of the imported mailboxes contain just one or two messages, where there should be hundreds. (The text is all there, it is just in the one or two messages instead of divided up correctly). I suspect that this is because the Thunderbird files I am using were copied directly from a Windows XP machine. Is there any chance the script author could modify the script to handle the mbox format Thunderbird uses on XP? (I know that's a stretch).

I've tried transferring the messages via a local IMAP server, but the problem there is that the messages end up with the current receive date -- I'd like to preserve all the original receive dates (if anyone knows a workaround for this, in turn, that would be very handy).

Brad.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: Stephen-I-am on Thu, May 19 2005 at 11:50AM PDT
Kind of a cludge, but you could make multiple boxes for different date periods, like "Inbox 2004", "Inbox 2005", and then put them on your IMAP server.

Stephen

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: PeaceFreak on Sat, Jun 18 2005 at 5:25PM PDT
This might be of relevance to Thunderbird: I copied it from a thread in the Apple Users Forums:

Hi all,

With the help of somebody having these problems (since I have not used Mozilla, I didn't have a testbed myself), I took a look at the problem and came up with a solution.

1. The problem:
Mozilla does not seem to use mbox files according to the relevant RFCs - some older versions of Mozilla seemed to have used Mac end-of-line (EOL) characters instead of the *nix ones (i.e., char(13) instead of char(10)) - some mailbox files might even have a mixture of the two
Mozilla stores the message status flags as well as the information whether a message has been deleted in two additional headers (X-Mozilla-Status and X-Mozilla-Status2) - Mail's import ignores those headers and all messages therefore import as unread. Additionally, Mail might also import messages which had been deleted in Mozilla before

2. The solution:
First, you will have to change all EOLs in all mailboxes to *nix style - I created an AppleScript which takes care of that (in order not to hit the maximum post length here, I will post the script in a separate message).
Second, you use Apple's import function to import the mailboxes (you can use "Other" or "Mozilla" for the import)
Third, you run another AppleScript (an improved version of the one I posted above) which adjusts all the message flags and deletes messages in Mail which should not have been imported
Fourth, you let Apple know that they should fix this problem (and, by linking here, tell them how to fix it) :-) http://www.apple.com/macosx/feedback/

Andreas

Here is the script to change all EOL characters to *nix style.

NOTE: the script changes the files you drop onto it - if you plan on using the mailboxes in Mozilla again, you might want to work on a copy of the files instead of the originals.

Select all the text inside the gray box and create a new AppleScript from it (use the "Services ? Apple Script ? Make New AppleScript" menu entry in the application menu (which currently most probably says "Safari"):

on run
set theFolder to choose folder with prompt "Please choose the folder containing your mailbox files"
processObject(theFolder)
display dialog "Conversion finished" buttons {"OK"} default button 1
end run

on open theObjects
repeat with theObject in theObjects
processObject(theObject)
end repeat
display dialog "Conversion finished" buttons {"OK"} default button 1
end open

on processObject(theObject)
set theInfo to info for theObject
if theInfo is folder then
set theContents to list folder theObject
repeat with theItem in theContents
set thePath to ((theObject as string) & theItem)
processObject(thePath as alias)
end repeat
else
set thePath to POSIX path of theObject
do shell script "perl -pi -e 's/\\r\\n/\\n/g' " & quoted form of thePath
do shell script "perl -pi -e 's/\\r/\\n/g' " & quoted form of thePath
end if
end processObject


Save the script as an application (using the drop-down item in the save dialog)

You can now drop files and/or folders onto the scripts icon (or run the script by double-clicking and select a folder to convert all files therein) - the script will change the EOL character for all files inside this folder (recursively).

Here is the script which adjust all message status flags and deletes messages in Mail which had been deleted in Mozilla.

Select all the text inside the gray box and create a new AppleScript from it (use the "Services ? Apple Script ? Make New AppleScript" menu entry in the application menu (which currently most probably says "Safari"):

tell application "Mail"
set theMsgs to (get selection)
repeat with eachMsg in theMsgs
try
set MozHeader to content of header "X-Mozilla-Status" of eachMsg
if (character 4 of MozHeader) is in {"8", "9", "A", "B", "C", "D", "E", "F"} then
set deleted status of eachMsg to true -- 0x0008
else
if (character 4 of MozHeader) is in {"1", "3", "5", "7"} then
set read status of eachMsg to true -- 0x0001
else
set read status of eachMsg to false
end if
if (character 4 of MozHeader) is in {"2", "3", "6", "7"} then
set was replied to of eachMsg to true -- 0x0002
else
set was replied to of eachMsg to false
end if
if (character 1 of MozHeader) is in {"1", "3", "5", "7", "9", "B", "D", "F"} then set was forwarded of eachMsg to true -- 0x1000
end if
end try
end repeat
end tell



You can run this script either directly from the Script Editor (make sure not to show the "Event Log" in the bottom pane since this will significantly slow down its operation) or save it as an application and run it by double-clicking.

Select all the messages in your imported mailboxes (you can select multiple mailboxes in the mailbox list and all messages from all those mailboxes will be shown in the message list - click into the message list and chose "Select All") and run the script - when it is finished, all your messages should have the proper message status and you shouldn't see any messages you deleted in Mozilla.

Andreas
A possilbe future version of my freeware Eudora Mailbox Cleaner should be able to handle this importing problem. Check it out... <http://homepage.mac.com/aamann/Eudora_Mailbox_Cleaner.html>

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: duhamel on Wed, Sep 7 2005 at 10:34PM PDT
Andreas,

This worked GREAT!!

Here's what I had to do.

I HAD Outlook Express on winxp (It is not being used much anymore).

1. I downloaded Thunderbird for windows and installed it. Thunderbird automatically imported my OE e-mail over.

2. I downloaded Thunderbird for Mac and installed it. Then, I copied my "profile" folder over to my Mac. Thunderbird then opened with all my mail.

3. I ran the script to change all EOL characters to *nix style (Thanks to Andreas!) against my Thunderbird mail folder.

4. I opened the Mail.app and imported all my e-mail - it worked GREAT!


Address Book:

1. Open Thunderbird and export your address book to "Ldif" format
2. Open the "Address Book" app and import. Address Book will ask what format you want to import from. Choose "Ldif" and tell it where your file is that was created in step #1.

3. Sit back, have a drink and be happy you're off of outlook express... a.k.a. "outbreak".

Cheers.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: bestcea on Mon, Aug 8 2005 at 9:28AM PDT
An alternate way to do this instead of running clean-up scripts, if you have access to Entourage, can be found on a posting from petterpp on Jun 23 2005, 18:42 at: http://www.neowin.net/forum/lofiversion/index.php/t317094.html.

Here is what you need to make it work - it did for me, at least. (I actually created a blank mailbox folder in Entourage to drop the Thuderbird files in).

"I have had the same problem as you until today! I found a way that works good.

1. Install Entourage
2. Find your mailfolders (found in Library/thunderbird/profiles/your account/mail/local folders)
3. There are three versions of your folders (Inbox.msf, Inbox.sbd, inbox)
4. Copy the one without extention to the desktop (or wherever you want)
5. Add the extention .mbox to your folders
6. Open Entourage and drag the folders to the main folder (Folders on my computer)
7. Open Mail and go: File/Import and select Entourage.
8. Done!

Hope this will help all frustrated minds out there.

/Petter"



[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: aboutimage on Fri, Aug 12 2005 at 2:19AM PDT
I read thru the steps required to import mail, and none of them worked for me. Perhaps this is because I was porting from Thunderbird (on a PC) to Mail.app? Dunno. In any case, I found that the solution is fairly easy, I was just overthinking it:

1. Find the Thunderbird mail source folders (on the PC, they should be in Documents and Settings / Username / Application Settings / Thunderbird / Mail (or something close to that - I'm typing this from memory).

2. In Mail.app, click Import, select Other, then select one of the mail folders that contain the Inbox.mbox files (and many others).

3. Click Choose. You're choosing the folder, not any of the files contained within it. Folder should be called Local Folders for the main inbox. If you used multiple mailboxes, the rest will be named by host (i.e. mail.yourhost.com).

That's it. I imported approximately 10,000 messages from my PC across a wireless network without a hitch. And without the Python script.

[ Reply to This | # ]

Import mailboxes from Thunderbird into Mail.app
Authored by: shwetank on Mon, Jan 16 2006 at 2:04PM PST
does anyone know how to import mbx files (exported from mail) into thunderbird?

when using import under thunderbird, the only 2 options are eudora and netscape.

i have tried copying the mbox file into the thunderbird profile folder as recommended by another article but that didnt work either..

any help is appreciated.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: pburkholder on Mon, Oct 9 2006 at 4:19PM PDT
With Mac OS X Tiger (10.4.8, to be exact), Mail.app 2 (2.1.1) and Thunderbird 1.5 (1.5.0.7) the import into Mail.app is very straightforward for importing the Local Folders and Inbox from a Thunderbird POP account. I did this as two imports, first the Local Folders, then the INBOX

1) in Mail, select File -> Import Mailboxes, then select Other
2) select the folder (HOME)/Library/Thunderbird/Profiles/Default.lay/Mail/Local Folder
3) Mail then finds all the importable mbox files therein, and all the nested folders and files as well. Confirm the import

Then repeat, but using (HOME)/Library/Thunderbird/Profiles/Default.lay/Mail/(account name) as the base for the import

This leaves you with two new top-level folders in Mail.app: Import and Import-2. You can then rename and re-arrange as needed for your purposes

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: pburkholder on Mon, Oct 9 2006 at 4:58PM PDT
EXTREMELY IMPORTANT: be sure to "Compact Folders" in Thunderbird before attempting an Import.

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: taganov on Thu, Dec 14 2006 at 8:53PM PST
I tried this, importing from Thunderbird 1.5.0.8 under 10.4.8 to Mail 2.1. I compacted in Thunderbird first. Then I experimented with a few mailboxes. Without exception, the import lost about 2-5% of the messages. The messages simply don't show up in the imported boxes.

On a separate Mac I imported ~20,000 messages. So how many did I lose? Too many to just live with it!

This just doesn't make sense. It should be easy!

...R

[ Reply to This | # ]
Import mailboxes from Thunderbird into Mail.app
Authored by: taganov on Fri, Dec 15 2006 at 12:45PM PST
OK I tried Eudora Mailbox Cleaner

http://homepage.mac.com/aamann/Eudora_Mailbox_Cleaner.html

Man, what a fine piece of free software! It worked perfectly. It even properly imported mail that I couldn't move through an IMAP server.

Nice.

...Robert

[ Reply to This | # ]