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!