12 Notes on Setting up Gmail IMAP with Apple Mail
Just like Ryan, I’ve been in the process of moving to Gmail to handle all my email, now that they provide IMAP access. In no particular order, here are some notes and thoughts on the process of setting up Gmail IMAP with Apple’s Mail.app:
- Rather than restate all the steps I took, I’ll link to this post that I found useful. In particular, configuring Gmail’s Drafts, Junk, Trash and Sent folders to match those in Mail is nice.
- The way Gmail implements IMAP wasn’t very intuitive to me and took some getting used to. For example, deleting a message from a mailbox doesn’t really delete it, it just removes that label (or at least that’s how it’s supposed to work; more on that later). I found this page helpful in getting used to how IMAP functions match Gmail actions.
- I know this has probably been discussed ad nauseum, but I wish Gmail would loose the “labels” concept and move to “folders”. While I’ve eventually gotten used to it within Gmail, the problem is only made worse with IMAP. For example, if a message has two labels, you’ll see it in two folders, which means it’ll show as two unread messages.
- I figured as long as I was setting all this up, I’d use Gmail to backup all my old messages, as described by Ryan. This meant copying over my old mbox files, importing them to Mail, and moving them into the appropriate folders in Gmail. It’s definitely a slow process, but you can view the progress from the Activity window (under Window -> Activity). There were a few times when the moving failed: I believe it was due to cases where messages had very large bodies. Although it failed partway through, I was able to start over without having any duplicate messages, so it looks like Gmail is smart enough not to add an exact duplicate.
- To help speed the process a bit, I’d recommend turning off caching while doing any importing or moving of messages. This is done under “Keep messages for offline viewing” in the Advanced tab of the Gmail Account preferences. Once everything is set how you like it, you can turn cacheing back on. For a large number of messages the caching process can also take a while.
- It took me a while to find a setup for my outgoing messages that works for me. In the past, I’ve had my email client set to automatically BCC myself on any emails I send. This way my messages get categorized properly, and my emails will be in the same mailbox as the rest of a thread. With Gmail, my sent messages were getting put into the Sent Mail folder in Gmail, which means I never got a chance to filter them into any labels. BCCing myself didn’t help, since Gmail already had a copy of the message in Sent Items. What I’ve done now is to remove Gmail’s Sent folder as Mail’s Sent mailbox, which means the only copy that Gmail receives is the one that gets BCCed, which means I can have it filtered however I like. Update: Turns out I was wrong on this. Any email sent through Gmail’s SMTP will be added to “Sent Mail”, so BCCing won’t help.
- An unfortunate annoyance with Gmail IMAP is that unless you have a message filtered to automatically archive (in Gmail context this means moving it to “All Mail”), it’ll show up twice in Mail: once in the Inbox, and once in “All Mail”. So far I haven’t found a way to avoid this.
- The filters in Gmail are rather basic and limited, especially compared to Mail. For example, I don’t think there’s any way to match messages whose subjects start with a string, instead of just containing the string.
- Rather than set up a complex set of filters for all the email I get, I got an idea from Ryan to only create filters for less important messages, like automated log messages. Anything important will to go my inbox, and then I can choose how to label it or to delete it. This also has the benefit that on my iPhone, I can just check my Inbox and have important new emails in one place.
- Although Google Help says that deleting a message will just remove its label, it won’t necessarily work this way in Mail. Although deleting a message will remove the label (or if it’s in the Inbox, archive it), moving it to the Trash will actually put it in the Trash, which puts it in line for deletion. I think you could prevent this by not having Mail’s Trash mailbox be Gmail’s Trash, but the whole “deleting a message to remove the label” feature isn’t something I really need to use.
- I love the new Todos in Mail, but getting them working in Gmail also required some changes. From what I can tell, you can have Mail store the Todos locally or on Gmail (although there doesn’t seem to be a simple Preferences change for this). If it’s on the server, each Todo is stored as an email, and if you want to specify a Calendar for an item, it means defining a new set of Calendars in iCal. If you store the items on the server, each corresponding message shows up in a nice human readable format, but unfortunately on the iPhone all you see is a Mime attachment. Hopefully in the future Apple will provide a simple way to access Todos on the iPhone.
- Reading back on these notes, I see how complicated Gmail IMAP can be! I don’t think it’s quite ready for average users yet. That said, it’s nice to know that 1) I now have all my email accounts coming to one place, 2) my old emails are backed up online, and 3) I can access all my email from my computer, my phone, or a browser.


Yesterday, Apple
Just a quick note to let you know about the new