Import Messages into Gmail via IMAP
Posted by Gina Trapani at 9:00 AM on December 12, 2007
One of the nicest things about IMAP in Gmail—which can download and upload messages to the server, versus POP's download-only—is that you can drag and drop folders of messages into Gmail using any IMAP client. Over at the Draconis Software blog, reader Ryan had about 10,000 messages in Apple Mail he wanted to store in Gmail. He writes:
It was simple: I merely added Gmail as an IMAP account to my Apple Mail client, then just dragged folder-by-folder all the messages important to me onto my Gmail account. It took a while to transfer all the messages (be sure to open the Activity window in Mail to see your progress), but once it was done, all my old messages were safely stored in Gmail and had their original dates! Perfect!Unlike pre-IMAP methods of importing messages, like Ryan says, using IMAP will preserve the messages' original dates. If you're not using Apple Mail, check out how to turn Thunderbird into the ultimate Gmail IMAP client.

Comments (AU Comments · US Comments)
There are currently no AU comments for this post.
person_x
Posted 7:56 PM 11/12/07
Say i wanted to upload all my old messages but didnt want to use imap (i want to minimize bandwidth) - any reason i couldnt enable imap, do the upload and switch back to pop? will the messages stick?
person_x
Samson
Posted 7:44 PM 11/12/07
By using this feature of Gmail IMAP, I believe I've created the Holy Grail of web-based email management. I'd like to consolidate all of my email accounts (three GMail accounts, two work-based emails, and a GMail Domain) into using only one, but after 12 years of email usage on some of these accounts, it's just not reasonable. So instead, I created a setup that manages all accounts from a single interface - Thunderbird.
After setting up Thunderbird a-la LifeHacker, I installed the WebMail add-on with Yahoo and Hotmail connections to POP all email from those accounts into Thunderbird's local inbox. Then I set up a rule in TBird that runs whenever a message gets placed in the local Inbox and moves everything into my GMail inbox. With this setup, I can keep all of my web-based email accounts active, but all emails get funneled to GMail.
I can also email from any of those accounts via SMTP via the WebMail add-ons as well, which means I can keep all accounts open AND active from a single interface. AND I can continue to use any of the standard web-based interfaces if (I'm ever away from my primary PC) without impact to this setup.
The icing on the cake is that all of this is being performed using the Portable version of Thunderbird. Consolidated email on a USB stick!
Its completeness makes me so happy, I'm shedding a small tear right now.
Samson
Khamel
Posted 6:11 PM 11/12/07
i did the same thing, but with more like 20k emails (all college emails) and while im sure 99% of them copied, a bunch of them wouldn't for various reasons. Sometimes i could copy a few thousand no problem (it took time but whatever) but then it would hit an email and stop. I had to find where i was and start the copy process from there. Its always possible it was my computer but its certainly great to have all my email on gmail. the other options were a million times harder.
Khamel
Toschi
Posted 6:02 PM 11/12/07
a bit off-topic: for the 'unlucky' ones still waiting for IMAP on their gmail account - today I learned that switching from english(uk) to english(us) as language, might enable the IMAP option. Well, it worked for me, and appearantly quite a few more people.
Toschi
Deprong Mori
Posted 5:18 PM 11/12/07
Yeah, I did the same thing with my POP3-delivered messages and now everything lives on Gmail (I basically created Gmail labels corresponding to my old POP3 folders). I'm still using Yahoo! Mail for a couple of newsletters and moving selected messages over to Gmail.
Deprong Mori
devnull
Posted 8:38 PM 11/12/07
@PERSON_X
Yes, that would work. Just set up your email client as IMAP, upload your messages then reconfigure the client as POP. GMAIL can be configured to keep copies of everything you download.
My question would be, why? IMAP should use less bandwidth than POP since you can set up your email client so you don't actually download the entire message (& attachments) until you choose to do so.
I have four IMAP accounts (2 GMAIL, 1 .MAC, 1 Work) set up on my iPhone and the amount of data I use has dropped since I switched from POP to IMAP on GMAIL.
devnull
sinderphytik
Posted 11:45 PM 11/12/07
@Khamel:
I too tried copying over about 27,000 emails (from an old Gmail to a new Gmail account). I had about 150 folders (labels) to copy over, and had to select each one manually in Thunderbird. The copy process died frequently, especially on the largest folders. It took about a week, but I got about 25,000 of the 27,000 copied over successfully -- mostly attachments didnt come through, but I have local backups so I'm not too worried.
sinderphytik
dmccall
Posted 11:17 PM 11/12/07
I have a Gmail acct with around 20K messages. I would like to keep the most recent 1 month of mail on my Treo. (I sync to Outlook). What is the best way to accomplish this?
I assume I would set up IMAP to local Outlook, but do I have to sync all 20K messages? Can the Treo sync to only a certain period pr number of messages on Outlook?
dmccall
inbetweener
Posted 3:28 AM 12/12/07
Bugger me. This is a really good idea, I don't know why it hadn't occurred to me to use gmail IMAP to do this...
Thanks!
inbetweener
Himanshu Jain
Posted 6:14 AM 12/12/07
I use Gmail IMAP on my Nokia N73 and it is a breeze to use. I have also tried Gmail app for mobile but I am somewhat more comfortable with the IMAP mailbox.
Himanshu Jain
MichaelKVegfruit
Posted 9:04 AM 12/12/07
I tried this with a couple of month's of old messages from a work POP3 account just now, and it broke ThunderBird: kept getting password requests, and login failed messages. I'm not sure why that should be. Going to give it another try, with a few less.
I'd been considering doing something like Samson suggests for a while. My slight concern though is it might break either Gmail's terms, or my company's IT policy, if I copy all my work email over.
MichaelKVegfruit
mtnbkr1
Posted 1:41 AM 12/12/07
I recently imported several email accounts spanning the last few years. A couple of things that you should point out:
1-Any spam that is in your imported email will be screened against Gmail's spam filters (A Very Good Thing)
2-If you are lucky enough to have a web-host that supports IMAP, seriously consider moving all your email to your webhost first, then import into Gmail. By doing this, you add some complexity, but the system runs behind the scenes and you don't have to watch for time-outs. (NOTE: Gmail throttles the bandwidth by importing random amounts of email at random times - roughly 200 every 20-30 minutes. After I set this up, I pulled the trigger and occasionally checked back in with Gmail with strange fascination as it slowly but effortlessly imported all my email.
I haven't looked back since.
mtnbkr1
Gangles
Posted 7:52 PM 11/12/07
I'm really curious if this could be used to move an entire archive of e-mails from one gmail account to another (I'd love to ditch my old e-mail address.)
It makes sense to me in theory, but I don't have time to test it until later this week. I'll let you guys know what I find out!
Gangles
Mr.Gyver
Posted 7:34 PM 11/12/07
Well I still dont really get the Advantage of using for e.g. apple mail + gmail imap instead of using gmail in FF.
In apple mail the Access to the mails is really slow and how can I empty my inbox without deleting the mail(like the Archive Function in gmail)
Mr.Gyver
MLeo
Posted 6:47 PM 11/12/07
Question: Can I use something like this to move my e-mails from 1 gmail account (say soandso@gmail.com) to a Google Apps e-mail account with keeping original tags (maybe add another tag)?
I'm wondering, since the last time I tried to apply multiple labels through Thunderbird I actually got duplicate messages.
And I'm considering getting myself a domain and using Google Apps (the free version, there is/was a free version of it, right?) in it. But I rather not loose my old GMail account, for which I can use pop for any new message coming in.
MLeo
Samson
Posted 12:00 PM 12/12/07
Michael, if your company is large enough to have a corporate policy on email usage, I wouldn't siphon it out to GMail. My two work emails are (1) my own enterprise, and (2) a small consulting company, so my personal risk of violating corporate usage policies is nil.
An I haven't checked GMail's terms specifically, but I can't see how it would break anything. After all, it's my email, and it gives me the opportunity to slowly wean myself off the other web-based email systems. (At my own pace, of course.)
Samson
Tom-LH
Posted 10:59 AM 12/12/07
When is my account going to be upgraded!?
Tom-LH
pedro_mg
Posted 6:16 PM 12/12/07
... and if things go wrong with you client, try it manually via Ruby script (linux, osx, win):
[blog.tquadrado.com]
$ ./2gmail.rb MBOXFILE GMAILFOLDER [STARTINGMESSAGE]
Thousand of messages went up nicelly :) attachements included (beware of Gmail attachment limit)
ex.:
2gmail.rb your_mbox_file "[Gmail]/Sent Mail"
pedro_mg
john.jones.name
Posted 7:49 PM 13/12/07
please make sure you have the mappings correct !
clients interact with the folders and create duplicates and other unwanted side effects
see my blog post on exactly this subject
[www.johnjones.me.uk]
regards
John Jones
[www.johnjones.me.uk]
john.jones.name
maniacfive
Posted 12:36 PM 15/12/07
For those people still waiting for your account to be upgraded to IMAP, i DIDN'T have the IMAP option listed but went ahead anyway changing the settings in Mail.app and on my Sony Ericsson P1i.
IMAP works perfectly across all my machines and my phone so i would suggest giving it ago if you haven't already and seeing if it works
maniacfive