I've been a user of Gmail since late 2005 and have loved just about every minute of it. The revolutionary webmail interface, the vast popularity among power users and plethora of scripts, add-ons and doodads - but the one thing that always bothered me was the loss of integration with the rest of my computing. Sure, there are some great tricks and bookmarklets we found for our Top 10 Gmail tips and hacks post, but I've missed real integration with Mac OS X apps like iSale that can show me emails related to an auction I created with it, iPhoto that can compress copies of 20 images and attach them to a new message and even simply double-clicking a .VCF I've downloaded to quickly add it to Address Book and keep on working. Heck, toss in a dash of Automator and I really find myself longing for a desktop email client and the synchronized wonders of IMAP.
- Create IMAP address, keep private: This is the address we'll use to forward all your Gmail to. It's best to get this set up right away as we'll need it pretty quickly down the road. Ideally, keep this address private, because no one should ever actually see it unless they go digging.
- Download all Gmail via POP: If you haven't already been doing this, you'll need to create a POP account to perform an initial download of all your mail, since Gmail only provides access via POP (one of the drawbacks that probably brought you to reading this how-to in the first place). Head over to Gmail's help section for exhaustive instructions on getting set up via POP, including plenty of guides written specifically for a wide variety of email clients across all OSes. Depending on how much Gmail you've already racked up, the actual downloading portion of this step might take a while, especially since Gmail seems to allow around 400-450 messages to be downloaded during each operation. Finish this step completely - downloading every last Gmail message - before moving on to the next step.
- Begin forwarding and disable the POP account: Immediately after you've finished downloading all your Gmail via POP, enable forwarding in your Gmail account and enter that IMAP account we created in step one. Depending on the volume of your email traffic, you'll want to be quick about this to ensure you don't miss any messages between your last POP download and when you flip the switch on forwarding to this new address. Just as quickly, you should either shut off automatic downloading of your Gmail POP account in your email client or simply disable POP access in Gmail's settings. I elected to shut off POP access in Gmail since the next step requires some shuffling of all that downloaded Gmail from your old 'n busted POP account to the new hotness IMAP account which we're about to set up.
- Add the IMAP account to your email client: This is where a couple of key incoming/outgoing server tricks come into play so you can transparently use your Gmail account over IMAP with a desktop client, but still maintain some of Gmail's cool features like the all-too-handy conversation view. As you might guess, begin entering the credentials for your secret Gmail IMAP account, but switch things up with two particular aspects of the account: the 'From' address (sometimes called a 'Reply-To' address) and the outgoing server through which you send your messages. One of the double-edged swords of email is that it's easy to make it look - at least superficially - like a message is coming from just about any address you want. While this is a trick that spammers use for evil, we'll be using it for good, ensuring that recipients of your messages don't get confused by your Gmail + IMAP trick: Instead of entering your secret IMAP address in the From/Reply To field, simply enter your actual Gmail address. This means that recipients of your email will see that it came from your Gmail address and not the IMAP account. While it is true that anyone can easily dig into the message headers to track down the IMAP account your messages are actually coming from, you shouldn't have to worry about this for the most part. As long as you aren't a spammer or otherwise misusing this trick, most people won't have any reason to go digging in the first place, and you'll be exchanging email transparently via your actual Gmail address.
- Set your outgoing server to Gmail, not your IMAP account: This is the final trick to maintaining optimum integration with Gmail, since using Google's servers to send all your email will ensure your sent messages and replies to conversations actually display in-line when viewing your Gmail in a browser. Gmail's SMTP server is smtp.gmail.com, and it requires authentication (your full Gmail address + password).
- Move over all your old mail: Now that you have all the IMAP setup out of the way, it's time to start moving over all your old Gmail from the POP account into your new IMAP account so it'll sync with email clients on your other computers. The time this takes is again dependent upon how much Gmail you actually have, but it basically involves moving/copying all your Gmail from the old POP inbox to the new IMAP one, as well as moving any folders you already set up under the old account into the new one. Since you could potentially upload a lot of email to your new IMAP server, this could take a lot of time. I had nearly 12K messages from Gmail when I did this, and between working on other projects and walking off to stretch my legs, it easily took a few hours, and possibly even half a day. Feel free to do this in batches if you can't afford all that time in one sitting, but the main point here is to move all your old POP Gmail into the new IMAP account so it will sync across all your computers and work well with the tagging system you'll set up in the next few steps.
- Install tagging plug-in, set up rules: If you don't already have MailTags installed in Apple Mail, grab it from indev.ca. It's a $20 plug-in but worth every penny, and as an added bonus, it can sync tags you apply to messages over just about every IMAP server by placing your tags in a custom X-MailTags header. This plug-in will also allow for more flexibility when organizing your messages into folders or, for example, when using Apple Mail's Smart Mailboxes to mirror your Gmail labels. MailTags even integrates with iCal, allowing you to easily create events and todos from your email, but that gets outside the scope of this how-to. For those not using Mail or even Mac OS X for that matter, I know of at least two alternatives: The cross-platform Thunderbird 2.0 has a tagging system that will sync over IMAP (and I believe, by extension, across OSes), and I found the Taglocity plug-in (thanks Chris!) for Outlook 2003/2007. While it should get the job done, note that Taglocity can't sync tags over IMAP just yet. With these plug-ins you should be able to sufficiently mimic your Gmail labels - MailTags allows you to search by tags (and even notes you add to messages), as well as filter your messages and even create Smart Mailboxes based on them. While creating these mailboxes and rules might be a little more work than using Gmail's "New Label" option, an open-ended tagging system that allows you to add tags on the fly can be a bit more flexible, depending on your workflow. This might take some tinkering with to find something that suits you, so be sure to discuss, ask questions and link other email clients and plug-ins that can help even more users make this leap from Gmail to IMAP.
- (optional) Install Mail Act-On: Another plug-in exclusive to Apple Mail from indev.ca (though Act-On is donationware, not commercial. At least not yet), but it's pretty fantastic: Act-On basically provides keyboard shortcut for managing messages. You can create a rule that automatically adds colored labels and (if you install MailTags as well) tags to messages, or even a rule that sends selected messages to a specific folder, and then simply use Act-On to add a keyboard shortcut to these rules. It's a pretty powerful management plug-in that will likely appeal to Gmail users who are addicted to Greasemonkey scripts like Macro.
- (required) Enjoy: If successful, you now have the best of both worlds: a Gmail account running over IMAP so you can use the power, integration and organizational synchronization of one or more desktop email clients, while also staying closely tied with Gmail should you ever want or need to check your email on the web and keep track of who said what and when. It might not have been an easy-breezy one-click journey, but this symbiotic setup should bring some relief to power users who find themselves caught between the online and desktop email worlds.
Catches, gotchas and other things to be aware of: Since this is essentially a workaround, it certainly isn't without its downsides. The primary catch with this setup is that, due to the need for forwarding your Gmail, your messages won't be marked read in Gmail online; the best you can do is set Gmail to archive your messages once they're forwarded, but if you plan on still using Gmail online with any frequency, this might add some complication to browsing your messages. Also, searching in most desktop email clients is far, far outshined by the power of Gmail's boolean search and its abilities to include specific phrases and exclude others in the same query. Unless I'm having an unusually hard time finding a specific message though, I have rarely found myself needing to hop over to Gmail online to really get the search done; possibly once or twice in the 4 months I've been using this setup. Finally, there's the commercial aspect to this trick: I don't know of an email or hosting service that offers IMAP for free, but to me, the advantages of having an email client that truly integrates with the rest of my OS far outshine the price I pay for DreamHost's services.
This guide should be enough to get you on your feet, but as always, feel free to discuss and ask questions in the comments. I've been using this setup exclusively alongside a few other IMAP accounts for 4 months now, and aside from a few Gmail perks that I've given up, I'm very happy with it. I hope you can be too.














Reader Comments (Page 1 of 2)
7-11-2007 @ 8:05AM
Brian said...
When you deleted your old POP account, did it also delete all your old emails that went to that account? That is the problem that I've been having. I want to keep those messages local.
Reply
7-11-2007 @ 9:43AM
josh said...
Excellent post! I recently did a post about using a service like Gmail with Fastmail so that one could get push email on the Palm Treo (with Chatter) running on Palm OS without needing an exchange server. Works well with what you explained as well.
http://blog.proud-geek.com/2007/05/27/push-email-on-palm-treo-via-chatter-and-fastmailfm/
Reply
7-11-2007 @ 11:11AM
Dave Chartier said...
#1: Well there's the beauty of IMAP: you keep a local copy of all your messages, but they also sync with a server and any other computers you add the IMAP account to.
If you would still rather hold onto that POP account for one reason or another, you don't have to delete it. Most email clients allow you to 'disable' an account so it isn't included when you check for new mail across all your accounts, but still keep it around for access to its messages. That's probably your best bet.
Reply
7-11-2007 @ 1:03PM
Jonathan Greene said...
I was initially forwarding my Gmail to my Yahoo account to get push IMAP on the iPhone... FastMail currently hosts my domain mail and it's all redirecting into Gmail since that has been my preferred way to do email via various mobile devices...
The issue is that even with archiving setup on Gmail you lose the "sync" you normally get on Gmail which is one of it's strengths... not too unlike IMAP actually.
I'm hoping Google releases either an iPhone specific way to do things or just an IMAP system since even with your workaround, you don't get tags back to Gmail for when you want to sort things... ;(
No idea why Google has limited us to POP... guess so they can serve us ads on the web.
Reply
7-11-2007 @ 1:08PM
AsktheAdminDotCom said...
Great write up would you mid if we republish this @ http://www.asktheadmin.com ? This is right up our alley this was our last post on Gmail Settings and Troubleshooting: http://www.asktheadmin.com/2007/07/question-of-morning-why-cant-i-pop-my.html.
Thanks and I hope you come and participate!
_TheAdmiN_
Reply
7-11-2007 @ 1:19PM
applegrass said...
So will this enable me to browse my email thru Thunderbird and Gmail with the same tags?
Reply
7-11-2007 @ 1:35PM
oren said...
Any ideas on how to get something like this working on an iphone?
Reply
7-11-2007 @ 1:35PM
Dave Chartier said...
#6: It would be great if you could link this and talk about the post and the how-to, but I believe Weblogs, Inc. policies forbid 'republishing' on your own site, especially if you display ads. Feel free to link, quote, discuss - you just can't scrape.
Reply
7-11-2007 @ 1:37PM
Dave Chartier said...
#7: Unfortunately, there's no way to actually sync your Gmail labels/tags with any other email client or plug-in. Part of the purpose of my how-to is to set up a tagging system of your own to either duplicate or, depending on your workflow, expand upon Gmail's tagging system.
Reply
7-11-2007 @ 1:44PM
Leonard Slutsky said...
Brilliant! Thanks a lot. Remember that when you setup the account, you must type in the email address you want to send as during the setup window (when in apple mail) even if you selected the gmail smtp server.
Leonard Slutsky
allaboutleo.tumblr.com
Reply
7-11-2007 @ 2:30PM
Tushar said...
aim.com provides free IMAP account of 2 GB
Reply
7-11-2007 @ 3:54PM
Jason said...
One other possible downside (please correct me if I'm wrong):
When you send an email via your IMAP client (Apple Mail, Thunderbird, ...), it will show up in Gmail as a sent message --> awesome
- but -
When you send an email via Gmail, it will never get forwarded to your IMAP account, thus you will never be able to search for it in Apple Mail (Thunderbird, ...) --> lame
Reply
7-11-2007 @ 4:40PM
Erik said...
Uh, I hate to rain on the parade, but I tested syncing tags in Thunderbird over IMAP between two computers. It simply did not work - the tags were stored in the index files local to the machine. I would really wish three was an accepted standard extension to IMAP for tagging messages. Or that gmail would provide IMAP access...
Reply
7-11-2007 @ 5:16PM
Chris White said...
Amazing work David, thanks to you I've been doing this for a bit now and I love it! I still haven't gotten all my old mail copied to the IMAP account but what I have so far works wonderfully.
If anyone comes up with any good tag solutions for Outlook I'd love to hear about them. I'll hopefully be testing Taglocity next week.
Reply
7-11-2007 @ 5:41PM
Alpesh Nakar said...
Awesome!
I have just moved back to google apps for my domain and have setup imap on dreamhost account exactly for this purpose.
Gmail spam filters are the best!
Thanks for writing this up. Now I don't have to write one ;-)
http://alpesh.nakars.com/blog
Reply
7-12-2007 @ 12:33AM
shafiu said...
in short forward all your gmails to a IMAP account and then push it to phone/client. So whats new here???
Reply
7-12-2007 @ 3:12AM
Dave Chartier said...
#13: The post states it pretty clearly in both the introduction and in the steps described, but to summarize: this doesn't just involve forwarding email from one account to another. Setting up outgoing servers so Gmail still displays your replies with conversations as well as tagging plug-ins and systems are also outlined.
Reply
7-12-2007 @ 6:47AM
Brett said...
Nice work David. I'm going to test this out tonight... I would love to use Mail with GMail.
#10: MailTags embeds it's tags in special IMAP headers, that's why it (probably) works. I haven't tried this setup yet, but it works for me when GMail isn't part of the equation.
#9: Seems like you should be able to work around that... I'll have to test it. That would be a major downside for me.
Reply
7-12-2007 @ 11:44PM
Jeff said...
I have done tech support at a web host and there is a big gotcha to this hack, since its success revolves around a user's own hosted email.
IMAP can be painfully slow on cheap/shared hosting. IMAP doesn't scale well either, meaning the bigger the IMAP mailbox, the slower IMAP send/receive gets. Since the hack is recommending the use of IMAP on a potentially 2+ GB mailbox and most web hosts consider a mailbox that's 1/5 that size to be large, that's a major consideration.
IMAP also exacts a heavy toll on server resources that is similarly proportional to the speed. If your drain on the server starts affecting other users on the box, it's very likely that the use of this technique with a large email box will get your hosting account booted off of a shared host.
Reply
7-13-2007 @ 1:27AM
fak3r said...
Good post, I do something similar that let's me use my home Webmail client (Roundcubemail) with my local IMAP server, but have all mail go out via Gmail's smtp. So far it's been seamless, though I do it a little differently; I use getmail [http://pyropus.ca/software/getmail/] on the FreeBSD server and it delivers straight to my IMAP Maildir directory - set a cronjob to kick off getmail with your getmailrc file in the line, and you're all set.
Also I've done Google Apps for Domains, which I've really liked, made it easy for me to consolidate 4 different domains with loads of diff email addys to one spot.
Reply