Import your Email archive in to Gmail and keep in sync

Gmail LogoI really like the Gmail interface - it’s a better, more usable interface than most desktop mail apps I have used. In order to make proper use of it, I’ve needed to find a way to get all of my past mail archive of 5000+ messages in. And from then on I need to keep it in sync with my desktop mail application (Apple Mail)

If Gmail had IMAP access, this would be easy. But as yet they don’t. So here’s the best solution I could come up with, which is close to being perfect.

What you will need:

  • A Gmail account
  • A temporary IMAP account big enough to store all of your messages. You must be able to access this IMAP account by POP3 (they almost always have POP3 access)
  • An good IMAP client to perform the transfer (Mozilla Thunderbird works very well)

Step 1

  • Import all of your emails in to the mail client you are going to use the transfer (Mozilla Thunderbird). If you already use IMAP, you don’t need to import, just set it up as an account.

Step 2

  • Set up your temporary IMAP account in the same mail client.

Step 3

  • Copy all of your local messages in to your temporary IMAP account. Copy all folders in to the main inbox of the IMAP account, including your sent emails folder (In Thunderbird, select all > right click > copy to). This could take a long while if you have a lot of messages.

Step 4

  • In your Gmail account, set the POP3 mail fetcher to download messages from the POP account associated with your temporary IMAP account. (This is in Settings > Accounts). Untick the ‘leave a copy of the messages on the server box’.

Gmail will download 200 messages every 60 to 90 minutes - so this could take a while to complete. You can watch the progress by looking at the IMAP mailbox they are downloading from - they will disappear once they are downloaded.

Step 5

  • Set up your main email account to forward all messages to your Gmail account from now on, and set the sender address in Gmail to be your main email address.

Step 6

  • Set up POP3 access for your Gmail account (Settings > Forwarding and POP). Choose ‘For all messages from now on’ rather than ‘All messages’.

Step 7

  • Change your local POP and SMTP account settings to the Gmail account.

If you set the Gmail SMTP server as your outgoing server for all messages, Gmail is intelligent enough to store messages sent via SMTP within your Gmail account.

By using this method, you have achieved the following:

  • You have a local copy of your emails that matches the ones in your Gmail account.
  • You can send messages using your desktop mail client and your Gmail client, and all messages are stored in your Gmail sent folder.
  • New emails will arrive both in your Gmail account and your desktop mail client
  • You have a local backup of everything

But there are still some problems:

  • Problem 1: Messages sent via Gmail are not stored in your local sent items box.

The closest solution I have found to this solving this problem is:

  • Set up another POP3 mailbox and call it something like gmail-sent-messages@example.com
  • Set this mailbox up in your local mail client and create a rule to move all received messages in to your local sent items folder and mark them as read.
  • Every time you send a message from Gmail, BCC your gmail-sent-messages@example.com address.

Because it’s BCC, it doesn’t add anything to the message headers so you get a clean local copy of the message. This would be a good solution if Gmail had automatic BCC, but as it is it’s a pain to add the address every time you send a message.

  • Problem 2: The message ‘read’ status is not synchronised between your Gmail account and your local account. This is a shame but I don’t think there is any way around it without IMAP access.

But I think this is as close as we can get until Google add IMAP to Gmail.

1 Comment so far

  1. Abdolali Hajian on April 13th, 2007

    they almost always havePOP3 access)

Leave a reply