Importing and exporting your mail

From MozillaZine Knowledge Base
Jump to navigationJump to search
This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

Introduction

If your old email client is still installed the easiest solution is to import the e-mail , address books and settings using Tools -> Import. However, if its not installed or Thunderbird doesn't know how to import data from it typically you need to find some way to export or convert your old email clients mail files to either .EML or mbox files and some way to export or convert the address books to .CSV or .LDIF files.

Thunderbird, Netscape, Mozilla Suite and SeaMonkey use mbox files to store the messages for a folder. The ImportExportTools extension can import and export mbox and .EML files. Many email clients use mbox files (regardless of whether they use no file extension, .mbx or .mbox as the file extension) to store messages or provide a way to export folders as mbox or .EML files due to the popularity of Eudora and Outlook Express. Sometimes email clients use "Unix format" to refer to a mbox file since the format was originally developed for Unix systems.

If you have problems importing .EML files using the ImportExportTools extension try using eml2mbx to convert the .EML files to a mbox file and then import the mbox file using the ImportExportTools extension. A Google search will find several eml to mbox conversion programs. Whats unusual about this one is that provides a lot of control over how it converts the .EML files using a "eml2mbx.ini" file.

If your old email client supports exporting the address book as either a .CSV or .LDIF file you can import it using Tools -> Import -> Address books -> Text Files. If not you might be able to use a program like Dawn to convert the address book to a .CSV file and then import it.

No matter how you import or export your e-mail its a good idea to back up your e-mail first in case something unexpected happens.

If you're moving from a old PC to a new one its typically easiest (and safest) to install Thunderbird on the old PC, import your e-mail, settings and address books and then move the Thunderbird profile to the new PC.

Specific programs

America Online (AOL)

  • Import to Thunderbird:

Older versions of Apple OS X Mail.app

  • Each local Mail.app folder contains an mbox file that you can rename and move into Thunderbird's Local Folders directory (more details). This doesn't work for cached IMAP server messages; Emailchemy will convert Mac OS X 10.3's CachedMessages folders. This does not work for Mail 2.0 as shipped in Tiger because Apple has dropped the mbox format in favor of storing messages in individual files so they're Spotlight searchable.

Apple OS X Mail.app

  • See here for instructions on how to import the messages. You can export your address books by dragging them to the desktop, creating a vcard file, and then uploading it to this web page which converts it to a .csv or .ldif file.

Apple iPod (contacts and calendar only)

Barca and/or PocoMail

  • Use File -> Export -> Mailbox to export the mail folders in "Netscape" format. That should create mbox files. Rename them to have no file extension and import them using the ImportExportTools extension. Use File -> Export -> Address Book to export the address book as a .csv or .ldif file and then import it in Thunderbird using Tools -> Import -> Address Books -> Text File. See here for more information.

Calypso

  • It uses its own storage format to store folders in a .box file but provides an archive option to export folders as mbox files, which is what Thunderbird uses. You could use the ImportExportTools extension to import the folders. Another possibility would be to upgrade to Courier email client (its follow-on), let it import your data, and then migrate from Courier to Thunderbird using Courex.

Courier (Rose City)

  • You can export both the folders and address books using Courex.

Eudora

Eudora is no longer being sold by Qualcomm. They have created a open source version based on Thunderbird. See this article for more information.

Entourage

  • Open Entourage and drag and drop the folders to the desktop. That will create mbox files with an .mbox file extension. Either drag and drop them to the appropriate directory in your Thunderbird profile or import them using the ImportExportTools extension.

Google Gmail

Incredimail

Juno (the email client, not the ISP)

  • Use Dawn to convert the address book to a .LDIF file and then import it using Tool -> Import -> Address books -> Text file. UseJuno5bdb to convert the folders to mbox files. Then import them using the ImportExportTools extension.

MH, mh-e, nmh, xmh, exmh

  • The MH e-mail client and is descendants store each message in a seperate file using the MH (Message Handler) format. The e-mail client is made up of several programs. Use packf to convert all of the messages in each directory into a mbox file, and copy it to the local folders directory in your Thunderbird profile. For example, if you have a folder called SAVED the following command will create a mbox file called "SAVED_mbox." that contains all the emails from your SAVED directory.
% packf +SAVED -mbox -file SAVED_mbox

Mozilla Suite and Netscape 7

Outlook and Outlook Express

Pegasus

PMM 2000

  • This thread has a PHP script and a similar program in Pascal that could be used to convert the messages. The last poster wrote a program in Delphi that you can get for the asking if you contact him. PMM 2000 stores each message in a .msg file (but not in a rfc-conform format). For each folder you could modify each message by switching two lines (look at an existing mbox file first to get an idea of what to do) and then copying it into the appropriate mbox file using a text editor.

Polarbar Mailer / J Street Mailer

  • Both use .pop files that are actually .EML files to store messages. Rename them to use a .EML file extension and import them using the ImportExportTools extension. There is no problem converting messages from J Street Mailer. However, Polarbar Mailer uses a X-DateReceived: header instead of a Date: header in messages in the Sent folder. You need to edit those messages with a text editor and change X-DateReceived: to Date: before importing the messages.

The Bat!

  • Export the folders using the "Unix Mailbox" format (that's compatible with the mbox format used by Thunderbird) and then use the ImportExportTools extension to import them.

Webmail (including Google Gmail, MSN Hotmail, Netscape Mail, or Yahoo)

Windows mail (Vista)

  • Import to Thunderbird: Windows mail stores the messages as .EML files. You can use the ImportExportTools extension to import .EML files. It lets you select multiple .EML files at the same time.
  • Export from Thunderbird: Export the messages as .EML files using the ImportExportTools extension.

Migrating messages using a mail server

Using an extension to put your Thunderbird messages back on the POP server

Another way to export your messages would be to follow the instructions in Putting messages back on a POP3 server to upload your messages back to your POP3 server. You could then download them normally with another email client. They will have normal headers, it would not look like you had forwarded the messages to yourself.

Using IMAP remote folders as an intermediary

If you have problems migrating your mail you might consider signing up for a free IMAP account and use it as a intermediary to move your mail. Think of it as a file share that knows about mail folders. You could create a 7GB IMAP account for Gmail using these instructions,or a 2GB IMAP account with AIM using these instructions . When you're done moving your mail you can delete the IMAP account in both email clients.

IMAP supports remote folders (on the mail server) that you can access just like they're local folders. You can copy/move messages/folders to/from them, even drag and drop a entire folder hierarchy. This would let you preserve most of the message status information (what messages have been replied to etc.) and the folder hierarchy. It should cause the least problems since you're using a Internet standard that both email clients support, rather than trying to convert between two partially documented file formats etc.

Create an IMAP account in both email clients. Copy your messages/folders to a remote inbox folder using one email client and then copy them from the remote inbox folder to a local folder using the other email client. If you have more messages than can fit in the mailbox do it in several steps, deleting the messages/folders in the remote inbox and compacting it as needed to free up more space. There are a few email clients whose IMAP support is crippled, and don't support uploading messages. But most popular email clients (Eudora, Outlook, Outlook Express, Pegasus, Thunderbird etc. ) do.

If the performance delay due to sending a lot of messages over the network is a issue you could temporarily install a local IMAP server and use it to provide the remote folders. hMailServer is an open source IMAP server for Windows thats easy to install.

Use Gmail Loader to load MailDir, MH and several other unsupported mail formats

The Gmail Loader reads messages from your existing mail files and forwards them to either the Inbox or Sent Mail folder in a Gmail account. It supports Mbox (what Mozilla uses), MailDir (Qmail, others), MMDF (Mutt), MH (NMH), and Babyl (Emacs RMAIL) formats. It's not clear yet whether it hides the fact that the message is forwarded, but it does eliminate the grunt work of individually forwarding all of your messages.

You could sign up for a free Gmail account, and upload the messages, configure Thunderbird to use Gmail, and then download your messages as new mail. The program is written in Python and supports Windows, Linux and OSX. However, you do not need to install Python if you're using it with Windows.

Miscellaneous

Mbox files

There are four main versions of the mbox format. Thunderbird, Mozilla Suite, Netscape, Portable Thunderbird, Postbox, Spicebird, SeaMonkey and the open source version of Eudora use a slightly modified version of the mboxrd variant of this format. The proprietary version of Eudora uses a slightly modified version of the mboxo variant. Most Windows email clients that use mbox files will use a mboxo or mboxrd version, and you should have little trouble importing them. Under Linux you're more likely to run into an mboxcl or mboxcl2 version, which is incompatible. Both Kmail and Evolution use a compatible version. You might try migrating your messages to Kmail as an intermediate step since it supports importing numerous formats.

See the following links for more technical information about this format:

Manually importing and exporting

Unless you are an advanced user its generally preferable to use an application to import or export a folder since that typically sanitizes the file to minimize any incompatibilities. If you use IMAP's optional offline mode to create a local copy of remote folders, think ahead about how you will deal with any potential synchronization issues. To manually import/export mbox formatted files:

  1. Create the e-mail account you want to use for the imported mail (unless you will use an existing account).
  2. Exit Thunderbird or Mozilla Suite.
  3. Back up your profile or Mail directory, especially if you plan to overwrite existing mbox files.
  4. Find the mbox files in your account directory: In your Profile folder, you will see a "Mail" directory and in there you'll see one account directory named for each account.
  5. Copy the mbox files you are importing, for example, copy "Inbox" (not inbox.msf) to the Mail account directory where you want to see the mail. Note: If you want to keep the existing mbox file of the same name in the new location, rename the file you wish to import before copying it over. For example, rename "Inbox" to "InboxOld" and "Sent" to "SentOld".
  6. Open Thunderbird or Mozilla Suite. A folder for each file you copied should be displayed.
  7. Open each folder and verify that it contains the correct number of e-mails, that they are readable, and that you can open attachments. Sometimes, differences between mbox formats cause multiple emails to be combined into one larger e-mail or can make some e-mails unreadable.

Troubleshooting is beyond the scope of this article, but if you examine the mbox technical links and the links to importing specific programs, you may find helpful information.

See also