HowTo: Load Mail Archives into GMail with Correct Dates

Another quick Google service related HowTo, as I just spent several days working on the task of uploading all my old mail into my Gmail account.

The Problem: Load your old mail archives into GMail, and keep the correct dates!

So say you’ve used various mail programs over the years, or change computers a lot, or for whatever reason have a large body of email sitting on your machine that you would like to upload to GMail. After doing a bit of webcrawling, you may have come across solutions such as the GMail Loader. However, I found that getting GMail Loader to work was painful, and even when it did, uploading my email turned into a huge mess, where all the emails seemed to have been sent on the day I did the uploading. They were all there, and searchable, but very annoying. There must be something better.

The Solution: Copy mail using Thunderbird and IMAP

Fixing this problem is actually really easy. Using GMail’s relatively new IMAP feature and the Thunderbird mail client (others likely work as well, I have not tested), it’s a a few easy clicks. Basically, just copy all your old email up there, and viola!

  1. To start, you need to get your mail archives accessible in Thunderbird. There’s lots of information out there about converting mailbox types and importing from one program to another; I will assume you have gotten that far.
  2. Enable IMAP access on your GMail account, by logging into GMail, clicking on Settings in the upper right corner, changing to the “Forwarding and POP/IMAP” tab, and clicking on “Enable IMAP” near the bottom.
  3. While you’re here, check out the “Configuration Instructions” link, to get a leg up on the next step.
  4. Now, add your GMail IMAP account to Thunderbird, using the Tools->Account Settings…->Add Account wizard. Note: in this wizard, add your GMail account as an Email Account, NOT as a GMail account, because we need to specify the IMAP settings, rather than use Thunderbird’s default POP access.

    The IMAP settings you need may differ depending on your account, but mine are:

    Server Type:
    IMAP Mail Server
    Server Name:
    imap.google.com
    User Name:
    full_email_address@gmail.com (or full_email_address@hosted_domain.com)
    Use Secure connection:
    SSL (Note: this changes the port to 993, which is correct.)
  5. Now, click on the Inbox folder of your GMail account in Thunderbird to make sure your connection is working. This will likely prompt you for your password as well, and will load the full list of folders on your GMail account. Note that GMail presents a folder for each Label you define in the web interface.
  6. To copy email to GMail, all that is left is to select the original messages in Thunderbird, right-click, and pick “Copy To”. Under the menu, choose your GMail account, and then which folder (think: label) you want to copy to.

    For instance, to drop all the email in your Inbox, use the Inbox. If you’d rather label everything and bypass the Inbox, pick a different folder. For me, I created a label (you can do this by creating a folder in Thunderbird) for the email address I was moving mail from (blah@oldaddress.com). Then I did “Copy To -> me@gmail.com -> blah@oldaddress.com”.

    For Sent Mail you can get these to show up in your Sent folder on GMail by copying them to the special [Gmail]->Sent Mail folder. Another useful special folder is the [Gmail]->All Mail folder, where you can copy messages that you do not want in your Inbox, but also do not necessarily want any other tag on.

  7. Give Thunderbird some time to process (you’ll see progress messages in the status bar), and you’re done!

3 thoughts on “HowTo: Load Mail Archives into GMail with Correct Dates

  1. Dankus

    This is how I’m doing it right now. For some reason, though, Thunderbird won’t show a progress bar anywhere, so it’s hard to tell when it’s done. This is as of 2.0.0.16. Used to work fine in older versions. You have to watch the message count in the folder to see when it’s done. But it works!

    Reply
  2. Brad

    Thank you for posting this; it has started me in the right direction. However, using the above instructions, I consistently received an error message that Thunderbird has failed to connect to the server, and I have struggled for a long time before finding the answer. Probably something has changed between the publishing of these instructions and the current date, July 2009, and I think that must be at Google’s end.
    A side-effect of this problem is that Thunderbird never asks for a password for the e-mail account, so the failure is at a fundamental level of the IMAP conversation.

    Finally, I have been able to make it work by replacing “imap.google.com” by “imap.gmail.com” – this is critical (I am using it with Google Apps for Your Domain – I don’t know if this makes a difference).

    Also, a piece of information for those migrating their e-mail to Google Apps: the Apps version of Gmail allows you to configure your mailboxes in advance of changing your mail server settings, so you have the chance to set up and test everything prior to burning your bridges. The address of those temporary Gmail mailboxes, at the time of writing, is

    your_mailbox@your_domain.com.test-google-a.com

    where you supply the domain name “your_domain” you are going to use with Google Apps and the mailbox “your_mailbox” which you are trying to pre-load and which you have created in Apps’ control panel on your domain.

    So if, in Thunderbird, you specify
    e-mail address: your_mailbox@your_domain.com.test-google-a.com
    and
    user name: your_mailbox@your_domain.com

    you should be able to pre-load all your old e-mail from your e-mail client, prior to cutting over Google Apps’ name servers.

    Thanks again to the original author.
    Brad

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *