Achieving Email Bliss with IMAP, Gmail, and Apple Mail
[Note: With the release of OS X 10.9 Mavericks, this article is completely out of date. If you’re running Mavericks, please do not follow these instructions! My latest advice for dealing with Gmail in Mail can be found in “Take Control of Apple Mail.” Quoting from that book:
When Mavericks was first released, Mail had some appalling bugs that made Gmail almost completely unusable for anyone who had followed [the steps in this article] (which, remember, were previously the way to prevent misbehavior). In later updates [to Mavericks], Apple fixed a number of bugs so that people who had changed their Gmail settings in the way I suggested wouldn’t suffer (much). Be that as it may, the way Mail in Mavericks handles Gmail accounts is so much different from Mail in earlier versions of Mac OS X that, for all practical purposes, those 21 steps to “bliss” are now irrelevant. In fact, you’ll now get the best results in Mail if you leave most of Gmail’s settings at their defaults!
For information on even further changes to Mail and Gmail with the release of OS X 10.9.2, see “Mail Improvements in OS X 10.9.2,” 25 February 2014.]
For the past few months, I’ve been unusually happy with my overall email situation. I won’t say it’s perfect, but it’s way better than it has been in the past – much better even than when I was running my own mail server on my own Xserve, a setup that I would have thought offered me the ultimate in flexibility and power. The ingredients I now rely on – Google’s Gmail (via Google Apps Standard Edition, which lets me use my own domain name), IMAP, and Apple Mail – provide the sweet spot that best suits my needs. However, as I discovered through a considerable amount of trial and error, the recipe needed to combine all these ingredients into an
edible dish was anything but obvious. For those who have had less-than-satisfactory experiences with their email providers and software (especially Gmail and Apple Mail, respectively), I’d like to share how I achieved my personal state of email satisfaction.
Well, that’s what I intended to do, anyway. The more I wrote, the more I realized how many aspects of the IMAP/Gmail/Mail universe are unclear or confusing, as evidenced by the many email messages I’ve received on those subjects, and as feedback to my books (“Take Control of Apple Mail in Leopard” and “Take Control of Spam with Apple Mail“) and my Macworld articles on the topic. So, what I thought would be a straightforward article has turned into a manifesto. (That means it’s quite long, and somewhat opinionated – fair warning!) And, I admit it: I’ve written it for a largely selfish reason,
which is to save myself from having to explain this information repeatedly in email messages! But I do hope you’ll find it interesting and helpful if you’ve ever struggled with the combination of IMAP, Gmail, and Mail.
I want to be clear about one thing right up front: my method works well for me because it matches the way I use, and think about, email. If you’re accustomed to using or thinking about email in a much different way, your mileage may vary – and you may find my setup unworkable. In particular, if you expect Mail (or any IMAP client) to work just like Gmail’s Web interface in the way it handles archiving, some of what I describe here may disappoint you. Email management is a matter of, among other things, habit and taste. So I don’t presume to say this system will work for everyone, or that it doesn’t have limitations.
That warning aside, I’m going to – eventually – explain how I do what I do in what I hope is a clear, systematic way. In order to provide context for the actual steps to take, I’m going to begin with detailed background information about IMAP generally and the somewhat nonstandard ways Mail and Gmail handle it. Feel free to skip the background stuff and jump ahead to “How to Configure Everything for Maximum Happiness,” but even highly knowledgeable users may find this material enlightening.
IMAP — I’ve been extolling the virtues of IMAP (Internet Message Access Protocol) for well over a decade, and although this protocol has become much more popular during that time, it’s clear that a lot of people still don’t understand what it is and why it’s superior to POP (Post Office Protocol). Even in the past couple of months I’ve heard more than one person dismiss IMAP using arguments that reflect basic misunderstandings. So, without giving a complete, detailed technical overview of IMAP, let me lay out the basics.
POP and IMAP are both methods of retrieving messages from a mail server. (In fact, many mail servers support both protocols, enabling you to access the same messages in either way.) The most common way to explain the difference between POP and IMAP is this: With POP, you download all your messages to your computer, whereas with IMAP, all your messages remain on the server. That’s more or less true, but it overlooks several important points.
- First, the fact that IMAP stores messages on the server is often taken to imply that it’s equivalent to the POP option to download messages but leave them on the server. But it’s much different. In the first place, IMAP servers, unlike POP servers, can keep track of flags for each message, indicating things like which messages have been read, forwarded, or replied to. With POP, your local email client has to track this information. That means if you download a bunch of messages on computer A using POP but leave them on the server, and then switch to computer B, you can still download the messages again, but they’ll all appear to be unread – computer B won’t know which messages you’ve seen, filed, or otherwise dealt with, because
that information isn’t kept on the POP server.
- Second, speaking of filing, another key difference between POP and IMAP is that POP has just one mailbox – your inbox – on the server, whereas an IMAP server can have any number of mailboxes. So, if you check your email on computer A and move a certain message to your Read mailbox, and then check your email on computer B, that message will appear in the Read mailbox there as well.
Third, I would like to put to bed, once and for all, the biggest IMAP myth of all time. It is not the case that when you use IMAP, you can access your email messages only when you’re connected to the Internet! I want to be crystal clear about this. If you use IMAP, you absolutely can have local copies of all your email messages, in their entirety, on your computer, and you can read, search, file, and do anything else you want to do with those messages even if you have no Internet connection at all – just as you can when you use POP. It is true that in some IMAP clients, this behavior isn’t automatic and requires a few clicks to set up, but there’s nothing about IMAP that inherently prevents messages from living
both on your hard disk and on the server. In fact, the most common configuration of IMAP these days – and the default configuration in Mail – is to have one’s local mail store exactly mirror the server’s mail store, such that changes made on one side are reflected automatically on the other side. File a message locally, it’s filed on the server; delete a message locally, it’s deleted on the server, and so on.
In short, although both POP and IMAP can get email messages from a server onto your screen, IMAP provides a much broader and richer set of options. And, as a bonus, you can use IMAP as a sort of rudimentary email backup. Even if your disk crashes or your computer is stolen, you’ll still have a copy of all your messages on the server. (The reverse is also true: if your IMAP provider should lose any of your messages, you’ll have a local backup.) One of the things I’ve appreciated most in my years of using IMAP is that I can switch email clients, computers, or even operating systems without giving the slightest thought to exporting or importing email messages (and all the grief that can involve). I simply enter my account credentials in
the new software and (not counting the time it takes to download new local copies of my existing messages) I’m all set.
IMAP does have a couple of downsides, which may or may not be significant to you. First, most IMAP servers impose a storage quota on each user. If that quota is fairly low (say, 1 GB), you could run out of space for all your messages, forcing you to move some off the server to a mailbox that’s stored only on your computer. (Gmail deals with this problem by setting generous quotas, which increase in size every day, and by offering even larger quotas for a modest annual fee.) Also, if you have a slow Internet connection (such as a dial-up or GPRS mobile connection), IMAP can be slower than POP because your client must explicitly ask the server for each message you want to download, rather than simply downloading whatever new messages
appear in the inbox automatically. (With fast Internet connections, this method of asking for and receiving data isn’t a problem.)
Mail and IMAP — Although IMAP is wonderful in theory, all IMAP servers are not created equal. Some have features that others lack, or use nonstandard approaches to providing one capability or another. In addition, one’s experience of using IMAP is always mediated by client software (either software you run locally on your computer or software that provides a Web-based interface to the IMAP server). Unfortunately, many IMAP clients also take certain liberties with the IMAP protocol, with the result being that some of that wonderfulness is lost from the user’s perspective. Apple Mail, which is a much better IMAP client than some, nevertheless has a handful of quirks in its
handling of IMAP that can drive one to distraction. If you combine Mail’s IMAP oddities with those of a less-than-standard IMAP server – Web Crossing, I’m looking at you – you could easily have unpleasant experiences that may lead you to the erroneous conclusion that IMAP itself is buggy or poorly designed. (Later on, I’ll get into the even weirder ways that Gmail deals with IMAP.)
Here are some of the problematic ways in which Mail handles IMAP:
- Mail has had, for quite some time, odd performance problems when communicating with at least some brands of IMAP server. Frequently, the simple act of checking one’s mail takes an inordinately long time, sometimes because Mail, in the background, is busy synchronizing a bunch of mailboxes and only gets around to checking your inbox when it has completed a number of other tasks. For the same reason, it’s not uncommon for Mail to take a long time to quit. It looks like nothing is happening, but in fact it’s trying (clearly, not hard enough) to log out of certain accounts, finish syncing mailboxes, or do other last-minute cleanup tasks such as deleting old messages. Some Mail users never encounter these problems, but if you’re unlucky
enough to use an uncooperative IMAP server – and especially if you use Mail for several accounts at once – Mail can appear to be quite sluggish when using IMAP.
IMAP supports server-side searching (say that five times fast), but Mail doesn’t. Mail relies on a Spotlight index of (the locally cached copies of) all your messages to deliver search results. For all the hype Apple has heaped on Spotlight, I (and many other Mac users) have found it to be a drag, even in Leopard. It’s often slow and frequently yields incomplete results. And even though system-wide Spotlight searches are reasonably capable, Mail’s pathetic search interface has no support for Boolean operators or proximity searches, and can’t search hidden headers, HTML source, or any other message components that are normally invisible in the user interface. This is a pity, because IMAP itself supports all this – if Mail let you tie
into the server’s existing search capabilities, you might get faster, more accurate, and more flexible results.
With most IMAP clients (including, notably, Entourage), you can subscribe to particular mailboxes in a given IMAP account, meaning only those mailboxes show up in the client’s mailbox list. If you have old mailboxes full of archived mail, for example, you can opt not to subscribe to them, so your software never has to waste time syncing them, searching them, or whatever. Mail doesn’t do subscriptions – it just shows you all your mailboxes, all the time. If you choose Get Account Info from the pop-up Action menu at the bottom of the sidebar in Mail and click Subscriptions, you might think you’ll see a list of mailboxes to which you can subscribe or unsubscribe. But usually this list is blank; it shows only mailboxes in
“Public” or “Shared” mailboxes on the server, if such mailboxes exist.
When it comes time to delete a message, the IMAP procedure is for your client to set a flag on the server that marks the message as ready for deletion. Then, at some later point, your client (manually or automatically) tells the server to “expunge” the mailbox – that is, actually delete all the messages in it that are marked for deletion. In the meantime, the client can hide the marked-for-deletion messages, or show them in a strikethrough style, or designate them as almost gone in some other way. Mail, instead, tries to replicate the Finder’s model for deleting files. When you delete a message, Mail appears to move it to a Trash mailbox (which, confusingly, may be either local or on the IMAP server, depending on settings that
aren’t obvious). Then, to delete the message for good, you choose Mailbox > Erase Deleted Messages > Account-Name. However, in reality, what happens when you delete a message in Mail is the following. First, Mail makes a copy of the message in your Trash mailbox. Then it marks the existing copy for deletion, making it invisible in the process. As far as your IMAP server is concerned, the message is still where it always was, only with a new flag. When you choose Erase Deleted Messages, Mail expunges the original copy and deletes the copy in the Trash mailbox. You can fiddle with Mail’s preferences to treat deleted messages in a more standard IMAP manner, but it takes some doing.
By convention, most IMAP servers and clients set aside special mailboxes for Drafts, Sent, Junk, and Trash, but the names used for each of these mailboxes differ from one program to another. Mail lets you designate any IMAP mailbox to serve any one of these purposes (by using commands on the Mailbox > Use This Mailbox For submenu). However, after you set up a new IMAP account, the first time you send a message, Mail looks for a mailbox named Sent Messages to store a copy in. If it doesn’t find that mailbox, it creates it. (Similarly, when you first save a draft or delete a message, Mail looks for a Drafts mailbox or Deleted Messages mailbox, and if it doesn’t find one with that exact name, it creates one. And, if you use Mail’s
built-in junk mail filtering to move suspected spam to a server-based Junk mailbox but there’s no mailbox there named Junk, Mail creates one.) So, for example, even if you already had a mailbox on your IMAP server called Sent, which you wanted to use to hold sent messages, and even though Mail’s mailbox list contains a mailbox called Sent, what happens behind the scenes is that Mail creates a new mailbox on the server called Sent Messages, displays that mailbox using the label “Sent,” and uses that to store sent messages – while, at the same time, displaying your existing Sent mailbox separately in the mailbox list! This is incredibly confusing, especially when I have to explain to someone that their Sent mailbox isn’t really their Sent
mailbox, and that to fix the problem, they have to select the Sent mailbox listed under their IMAP account name, choose Mailbox > Use This Mailbox For > Sent, and then delete the Sent Messages mailbox that will suddenly, mysteriously appear where Sent used to be. Gah!
The other special attribute of the Drafts, Sent, Junk, and Trash mailboxes is that most IMAP clients (including Mail) let you choose whether you want to store their contents locally only, or on the server (with a local copy). By default, Mail stores all these items except Junk on the server. Personally, I’ve never seen the point in offering the choice; it seems to me that it would be simpler if these mailboxes were always stored on the server and cached locally, like the rest. Be that as it may, your choice of which of these items are enabled, along with the names used for each mailbox as described in the previous point, can have a big effect on how Mail behaves, but it’s complicated for non-expert users to decode what Mail is doing
or how to set it up optimally.
Mail can, and usually does, make as many as four simultaneous connections to any given IMAP server. In theory, this should provide faster performance by enabling Mail to do several different things at once (such as copying messages from one mailbox to another while refreshing the contents of your inbox). However, sometimes all those connections actually slow Mail down, especially when you’re checking multiple IMAP accounts at the same time. Moreover, Mail sometimes insists on keeping all four of those connections open even when they’re not actively doing anything, and can be very slow to close connections that are stuck or non-responsive for a period of time. This behavior has special implications for Gmail, as I’ll explain shortly
– and unfortunately, Mail offers no user interface (as some other IMAP clients do) to set the maximum number of concurrent connections or whether to keep those connections perpetually open.
Gmail and IMAP — Gmail started out as a Web-only interface for email. Since Google had complete control over how email was processed, stored, and presented, they decided to handle it all in the way that made the most sense for their existing indexing infrastructure and for (what they perceived as) users’ needs. The basic idea was that a good search engine should make mailboxes obsolete – just toss everything in one big mailbox and do a quick Google search to find whatever you’re looking for.
Later, a refinement appeared in the form of user-defined labels. By labeling (or tagging) messages, you could indicate that many seemingly unrelated messages shared something in common, thereby letting you quickly display a group of messages that would never otherwise appear together in a search. Gmail lets you apply as many labels as you want to each message, which is a much different approach to categorization from using mailboxes (since each message can appear in only one location in a mailbox hierarchy).
Users flocked to Gmail for a variety of reasons, not the least of which were its cost (free), its large storage space for email, and its accurate spam filtering. But because many users preferred to use their existing email software, rather than a Web browser, to access their email, Google added a POP interface to Gmail. Obviously, when downloading messages via POP, you lose Gmail’s search and labeling features (though you can also choose to leave all the messages on the server as well, to give yourself another way to access them). Through Google Apps, Google even made it possible to use Gmail with one’s existing email address, so that users could take advantage of all the nifty Gmail features without having to switch domains or
Gmail eventually added yet another major feature that many people, including me, had been dying for: IMAP access. For me, the benefits of IMAP outweighed the benefits of Gmail, but I was thrilled when I learned I could get both. Now, I could have all the IMAP goodness (such as freely switching between clients and platforms) along with all the Gmail goodness (excellent spam filtering, a great Web-based interface for when I’m away from Mail, and most of all, freedom from having to constantly futz with my existing and increasingly finicky mail server).
To pull this off, Gmail’s paradigm of using multiple labels to categorize messages (with no capability to create mailboxes) had to be reconciled with IMAP’s assumption that you can create as many mailboxes as you need. Their solution was to map labels to mailboxes and vice-versa. So, if you move a message in your IMAP client to a mailbox called Stuff, you’ll see, in Gmail’s Web interface, that the message has a label called Stuff. If, using the Web interface, you apply the labels Apples, Oranges, and Mangoes to a message, then, in your IMAP client, you’ll see three copies of that message – one each in the Apples, Oranges, and Mangoes mailboxes. It’s not a perfect solution, and it’s certainly nonstandard in that IMAP normally stores only
one copy of each message – but it’s a reasonable design, as far as it goes.
Apart from that unusual system, Gmail’s IMAP implementation is weird (at least, from the Mail user’s perspective) in other ways. For example, Gmail limits each account to 10 simultaneous IMAP connections, not counting access via the Web. That sounds like a lot, and for many people it isn’t a problem. But because Mail is so greedy in this regard – opening, as I mentioned earlier, as many as four connections, and keeping them open – the practical upshot is that you’re limited to running just two simultaneous copies of Mail (say, one on your desktop Mac and one on your laptop). Even more aggravating, if I have Mail open on my Mac and my iPhone turned on (whose version of Mail also uses multiple IMAP connections), I’ve hit my limit right
there. If I then open Mail on any of the other Macs I might be using at any given time, that puts me over the limit with just three IMAP clients – Gmail automatically blocks the connection to the most recently used copy of Mail until the total number of connections drops below 10. And, because Mail can take such a very long time to let go of its connections, this may mean a wait of up to 10 minutes (Gmail’s IMAP timeout period for inactivity) even after taking one of my copies of Mail offline. (And before you ask, no, this has nothing to do with Mail’s “Use IDLE command if the server supports it” checkbox – that’s another whole can of worms.) A Gmail engineer who contacted me expressed hope that this problem will be addressed in a future
version of Mail.
In addition to the limit of 10 connections, Gmail watches for what it considers excessive activity – such as downloading all your IMAP messages several times in a day. (The need to download all one’s messages occurs, for example, when setting up Mail on a new computer or re-syncing Mail’s entire database after data corruption.) Although the exact algorithm Gmail uses to determine what’s excessive is not publicly known, I’ve personally surpassed whatever the metric is when, for one reason or another, I had to download all my IMAP messages just twice in one day, not counting my usual IMAP access. When you surpass this mysterious download limit, Gmail locks you out of all IMAP access for up to 24 hours – an extremely unpleasant
There are other limitations and issues with Gmail’s IMAP support, too, some of which I mention later in connection with Mail.
Mail and Gmail and IMAP — Mail, by itself, has some issues with any IMAP server, and Gmail, as a nonstandard IMAP server, has some issues with any IMAP client. When you put the two of them together, you can run into some interesting behavior. For example, Gmail’s one big mailbox that holds all your messages is called, cleverly enough, All Mail. (This includes copies of messages you’ve sent, even though they’re also available by using the Sent label/mailbox, as well as spam messages and deleted messages in your Trash.) This mailbox, along with all your other labels-as-mailboxes, syncs locally to Mail when you access Gmail via IMAP. As a result, if you (like most IMAP
users) have filed all your messages into various mailboxes, Mail would download at least two copies of every single message – the one in All Mail and an additional copy for each label the message had. Of course, this poses no problem to IMAP clients that can unsubscribe from particular mailboxes, but oops! Mail can’t do that. This was one of the biggest headaches I had in my early days of using Gmail with Mail, and in just a bit I’ll explain how to overcome this problem.
A further complication of All Mail is that Gmail has a concept of “archiving” messages, which means moving them out of your inbox but not necessarily giving them another label. The result of this is that they appear only in the All Mail mailbox. If you prevent All Mail from appearing in Mail (as I recommend and describe ahead), this means you won’t see any messages in Mail that you previously archived there using Gmail’s Web interface but which lack any other label. Nor does Mail (or IMAP generally) have anything precisely equivalent to Gmail’s Archive button – that is, a way to move messages out of the inbox without explicitly putting them somewhere else. This is one of those examples of needing to think about email a certain way: if
you’re committed to the archiving paradigm, my suggestions won’t suit you. However, I present a possible workaround ahead in my detailed list of instructions.
Another source of confusion was what to do with the special mailboxes Drafts, Sent, Junk, and Trash – specifically, whether or not (in view of the odd label/mailbox behavior and the duplication of messages) to store their contents on the server. Google’s Web site provided suggested settings, and some other Web sites I read offered conflicting advice. What I discovered was that with Google’s recommended Mail settings, every time you send a message you get two copies – one stored in a local Sent mailbox and the other stored in Gmail’s Sent Mail mailbox on the server (and, of course, synced locally too)! Only after experimenting with a variety of settings myself and observing the results (in multiple accounts, on multiple Macs) did I
arrive at a combination that gave me approximately the behavior I expected, even though it contradicts Google’s advice.
And finally, I’m accustomed to having all my mailboxes be part of a single hierarchy within any account. But Gmail wants to display, along with all my regular labels-as-mailboxes, another mailbox called [Gmail] that contains my Drafts, Sent, Junk, and Trash mailboxes – plus All Mail and Starred (equivalent to Mail’s Flagged status). According to Google, that unfortunate organization was necessary to support certain nonstandard IMAP clients and work around problems with supporting multiple languages. It offends my aesthetic sensibilities, but I wasn’t happy with the workaround I discovered for getting rid of the [Gmail] folder either.
How to Configure Everything for Maximum Happiness — Hey! Everyone who blew off the last few sections because you weren’t interested in background info! This is where you jump back in. I’m going to explain, top to bottom, how to configure everything on both the Gmail side and the Mail side to work the way it does for me, which is to say as good as I can figure out how to make it – and that’s pretty darn good in my book. I’m also going to mention a few things that, even in this shiny new world order, aren’t quite right – and then wrap up with some observations about the pros and cons of using this method for handling email.
Steps 1-5 are basic Gmail and IMAP configuration. You may have done some of these steps already; if so, please read them over anyway to be sure you’ve set up things the same way I recommend, and if not, make any necessary changes as you go.
(1) Get a Gmail account. I won’t walk you through the process because it’s fall-off-a-log simple. However, I do want to reiterate that if you want to use your own, existing domain name with Gmail, you need to go through an entirely different setup process to set up a free Google Apps Standard Edition account. This involves changing some of the DNS settings for your domain name to point to Google’s servers. It’s not hard, and Google offers clear, detailed directions. But be aware that your Google Apps Gmail account is completely separate from any existing Gmail account you may have – you can’t simply assign a new email address to your current
account. Apart from the initial account sign-up procedure, all the steps that follow are, with a sole exception (noted ahead), identical for either type of account.
(2) Log in to your Gmail account.
(3) At the top of the window, click the Settings link.
(4) Click the Forwarding and POP/IMAP link.
(5) Select Enable IMAP and click Save Changes.
Steps 6-8 configure a special Gmail Labs feature to minimize IMAP annoyances in Mail:
(6) Only if you’re using Google Apps, make sure Gmail Labs is enabled. To do this, make sure you’re logged in to Gmail as an administrator of your domain, and click the Manage This Domain link at the top of the Gmail window. Then click Domain Settings. On the General tab (displayed by default), make sure both of the following boxes are checked: Automatically Add New Services When They Become Available and Enable Pre-Release Features. Click Save Changes at the bottom of the window. Then log out of Gmail, log back in, and once again click the Settings link.
(7) Click the Labs link, which should appear under “Settings” to the right of “Web Clips.” Scroll down until you see Advanced IMAP Controls and click the Enable checkbox next to it. Then click Save Changes.
(8) Click the Labels link under “Settings.” Now, uncheck the Show in IMAP checkboxes for Starred and All Mail. This is essentially the same thing as unsubscribing from these two mailboxes, except that you do it on the server side instead of the client side – it applies to all clients. Crucially, this step avoids having the All Mail mailbox, with its duplicates of every single message you send and receive, clutter up Mail.
As I explained earlier, the downside to this approach, for those who like to use Gmail’s Archive button to remove messages from the inbox without putting them in another mailbox, is that you can no longer see archived messages in Mail unless they also have some other label. I never used this archiving method – for me, every message has at least one label (or is in a particular mailbox) – so this problem didn’t affect me. But if you’re accustomed to Gmail’s archiving, you may find that you get equally good results by creating a different catch-all mailbox in Mail, such as “Filed,” and simply moving all messages to that mailbox that you’d otherwise archive. Then, in Gmail’s Web interface, you can select all the messages in All Mail
without any other label and apply the Filed label, which makes them appear in Mail’s Filed mailbox. It’s not exactly the same as archiving, but it’s reasonably similar.
(9) Once again click the Forwarding and POP/IMAP link. This time, check a new setting that was added by enabling the Advanced IMAP Controls. If it’s not already selected, select Immediately Expunge Messages When I Mark Them Deleted in IMAP (under “Auto-Expunge”) and click Save Changes.
Steps 10-15 set up your Gmail account in Mail:
(10) Open Mail, choose Mail > Preferences, click the Accounts button on the toolbar, and click the + (plus) button at the bottom left.
(11) Enter your name, your full Gmail address, and your Gmail password.
(12) Extremely important: uncheck Automatically Set Up Account, and click Continue. (If you leave that box checked, Mail sets up your account as a POP account, which is not what you want.)
(13) On the Incoming Mail Server screen, choose IMAP from the Account Type pop-up menu. Enter a description of your choice, change the Incoming Mail Server field to imap.gmail.com, make sure the User Name field includes your entire Gmail address, and confirm that your password is filled in. Click Continue.
(14) On the Outgoing Mail Server screen, once again enter a description of your choice, and check Use Only This Server. All of the other settings should already be correct – smtp.gmail.com in the Outgoing Mail Server field, Use Authentication checked, and your user name and password filled in.
(15) Click Continue, review your information, and click Create. Give Mail a few minutes to download your existing messages from Gmail and create mailboxes corresponding to your Gmail labels.
Finally, Steps 16-21 enable Mail to deal correctly with Gmail’s special mailboxes. Note that you need not explicitly make any changes to the checkboxes in the Mailbox Behaviors view of Mail’s Accounts preference pane, but following these steps results in all four of the “Store messages on the server” boxes there being checked.
(16) Look in the mailbox list in Mail’s sidebar. You should now see, at the bottom, an account with whatever description you specified for your Gmail account in Step 12. Click the disclosure triangle next to it to display its contents. You’ll see, at minimum, a white mailbox (white signifying that the mailbox itself contains no messages) labeled [Gmail], along with mailboxes representing any other labels you’ve created. Click the disclosure triangle next to [Gmail] to display its contents, which should at this point be Drafts, Sent Mail, Spam, and Trash. (Had you not performed Steps 6-8, you’d also see Starred and All Mail here.)
(17) To tell Mail to use Gmail’s Sent Mail mailbox as the Sent mailbox for this account, select Sent Mail under [Gmail] and choose Mailbox > Use This Mailbox For > Sent. The Sent mailbox then disappears from under [Gmail] and reappears near the top of your mailbox list as a sub-mailbox with your Gmail account name under the main Sent item. (Here, and in the steps that follow, note that the special mailboxes appear as sub-mailboxes only if you have at least one other account set up in Mail; otherwise, they’ll be the only Drafts, Sent, Junk, and Trash mailboxes that appear.) If, after you do this, a Sent Messages mailbox appears at the bottom of your mailbox list in your Gmail account, select all its contents (if any) and drag them to
your main Sent mailbox at the top. Wait a few minutes for the transfer to complete, and then select the Sent Messages mailbox, choose Mailbox > Delete Mailbox, and click Delete. I want to reiterate that this advice differs from what Google suggests, but trust me: this is the way you want to do it, to avoid having duplicate sent messages in different mailboxes.
The result of doing this will be that, whether you send a message from Mail or from the Gmail Web interface, a copy will be stored in the same mailbox – the one Mail calls Sent, and Gmail’s Web site calls Sent Mail. Note: Do not CC or BCC yourself on messages you send via Gmail. (That is, choose Mail > Preferences, click Composing on the toolbar, and make sure Automatically Cc/Bcc Myself is unchecked.) It’s not necessary, because Gmail saves a copy automatically, and you’ll only end up with a duplicate. Note also that Gmail displays in your Sent (Mail) mailbox any spam messages you may have received that were forged so that they appear to have come from your own address! Weird and annoying, but if you delete all your spam
messages regularly, nothing to worry about – they disappear from Sent too.
(18) Next comes Drafts. As you did with Sent, select Drafts under [Gmail] and choose Mailbox > Use This Mailbox For > Drafts. The Drafts mailbox then disappears from under [Gmail] and reappears as a sub-mailbox under the main Drafts item. Now, whether you save a draft in Mail or in the Gmail Web interface, it’ll show up in the same (Drafts) mailbox. (If you were to skip this step, the next time you composed a message, Mail would create a new, hidden Drafts mailbox that would appear, in Gmail, as a label called [Imap]/Drafts. That introduces yet another layer of complexity I prefer to avoid.) Once again, if, after you do this, a Drafts mailbox appears at the bottom of your mailbox list in your Gmail account, select all its contents (if
any) and drag them to your main Drafts mailbox at the top. Wait a few minutes for the transfer to complete, and then select the Drafts mailbox under your Gmail account at the bottom of the list, choose Mailbox > Delete Mailbox, and click Delete.
But, you need to be aware of yet another goofy thing about Gmail and Mail when it comes to drafts. Normally, when you compose a message in Mail, it saves a copy in your Drafts mailbox automatically every 30 seconds as well as whenever you manually click Save as Draft. Each time a new draft is saved, Mail deletes any previous draft of that message (without moving it to a Trash mailbox), so you see only one draft in your Drafts mailbox. But Gmail-over-IMAP behaves differently. When you compose a message in your Gmail account, Mail still saves a copy of your work in progress every 30 seconds, and still deletes any previous draft. However, instead of the previous drafts disappearing altogether, they all show up in your Trash mailbox. As a
result, if you spend 10 minutes writing a message in your Gmail account in Mail, you could see 20 drafts of that message in your Trash mailbox! This behavior isn’t harmful – just empty your Trash every so often, or use Mail’s preferences to set up automatic Trash emptying. But it can be quite a shock to see tons of draft messages in your Trash that you never explicitly created or moved there! A Gmail developer told me that this strange behavior was necessary to work around a bug in certain IMAP clients, and that they may be able to find a better solution in the future.
(19) Now on to Trash. Just as in the last two steps, select Trash under [Gmail] and choose Mailbox > Use This Mailbox For > Trash. The Trash mailbox then disappears from under [Gmail] and reappears as a sub-mailbox under the main Trash item. Now, whether you delete a message in Mail or in the Gmail Web interface, it’ll show up in the same (Trash) mailbox. If a Deleted Messages mailbox appears at the bottom of your mailbox list in your Gmail account, select all its contents (if any) and drag them to your main Trash mailbox at the top. Wait a few minutes for the transfer to complete, and then select the Deleted Messages mailbox, choose Mailbox > Delete Mailbox, and click Delete.
(20) Finally, the Junk mailbox. Unlike the other three special mailboxes, Mail doesn’t store Junk messages on the server by default, the assumption being that there’s no need to waste space on the server with messages you don’t want in the first place. But Gmail automatically applies a Spam label to all suspected junk mail, which has the effect of keeping it out of your inbox and putting it in a Spam mailbox when viewed from an IMAP client. In other words, spam is already on the server (and, along with all your other IMAP mail, synced locally to your Mac too), so the question becomes how you want to view and manage it. You have two approaches here, both perfectly valid.
One option is to leave the default settings in place. The result would be that any messages Gmail flags as spam would appear (only) in the Spam mailbox under [Gmail] in your Gmail account. You could then review and delete those messages at your leisure – either in Mail or in the Gmail Web interface. However, if Mail’s built-in Junk Mail filter were to catch any additional spam messages from your Gmail account (which does happen from time to time), those messages would either be marked as Junk Mail and left in your inbox, or moved to a Junk mailbox in the “On My Mac” (local) portion of your mailbox list, depending on your preferences. In other words, you’d have to look in two places for suspected junk mail instead of one. On the other
hand, since Mail’s Junk Mail filter is less accurate than Gmail’s, it could be that most of what Mail flags as spam are false positives. If so, you may prefer to use this approach, in which the likeliest false positives are all together in a relatively short list that’s easy to scan, instead of mixed in with all the other messages that are more likely to be spam.
The other option, and my personal preference, is to go ahead and let Mail treat Gmail’s Spam label/mailbox as the Junk mailbox for that account. This has no effect on the number of spam messages downloaded to your computer. What it does change is putting all the junk mail in one place and eliminating an extra mailbox – so I like it for the sake of tidiness. In addition, it means that whenever Mail marks a message as spam by moving it to the Junk mailbox, it also tells Gmail that the message is spam, helping to improve Gmail’s spam filtering for all users at the same time Gmail helps to improve Mail’s junk mail filtering by teaching it which messages it thinks are spam.
To set up the Junk mailbox in the way I prefer, first choose Mail > Preferences, click Junk Mail, and make sure the Enable Junk Mail Filtering box is checked. Under “When junk mail arrives,” if the top radio button (Mark As Junk Mail, but Leave It in My Inbox) is selected, instead select Move It to the Junk Mailbox and click Move. Next, go back to the main Mail window, select Spam under [Gmail], and choose Mailbox > Use This Mailbox For > Junk. The Spam mailbox then disappears from under [Gmail] and reappears as a sub-mailbox under the main Junk item. Now, whether Gmail flags a message as spam, or Mail’s Junk Mail filter does, or you manually mark a message as spam in either place, it’ll show up in the same mailbox – the one Mail calls
Junk, and Gmail’s Web site calls Spam. If a Junk mailbox appears at the bottom of your mailbox list in your Gmail account, select all its contents (if any) and drag them to your main Junk mailbox at the top. Wait a few minutes for the transfer to complete, and then select the Junk mailbox, choose Mailbox > Delete Mailbox, and click Delete.
(21) That’s (pretty much) it. At this point, your mailbox list should show, under your Gmail account, an empty mailbox called [Gmail] (though it’ll contain a mailbox called Spam if you went for the first option in Step 19), along with mailboxes representing your Gmail labels. You can simply ignore the [Gmail] mailbox.
But maybe you can’t ignore [Gmail]. Maybe its very presence in your mailbox list offends your sense of order, since it serves no purpose now. Can you get rid of it? Well, you can, but you may find the consequences of doing so even more unpleasant.
To get rid of [Gmail], tell Mail to treat the [Gmail] mailbox, rather than your inbox, as the root of your IMAP account. To do this, choose Mail > Preferences, click Accounts on the toolbar, and select your Gmail account in the list on the left. Click Advanced, and in the IMAP Path Prefix field, type [Gmail]. Then close the Preferences window and click Save. What happens at this point is that [Gmail] disappears – yay! But something else disappears, too: the rest of your Gmail mailboxes! With this configuration, Mail can display only mailboxes that are in the [Gmail] hierarchy. So, let’s say you create a new mailbox in Mail called Archives. When you go to the Gmail Web interface, you’ll see a new label called [Gmail]/Archives!
Only labels that begin with [Gmail]/ will show up as IMAP mailboxes in Mail (or any other IMAP client). This won’t affect your Drafts, Sent, Junk, and Trash mailboxes because they were already under [Gmail], but it will mean that if you had messages in any other mailboxes, you’ll have to manually relabel them in Gmail in order to make them show up in Mail – and you’ll have to live with every Gmail label starting with [Gmail]/. Personally, this bothers me more than having an empty [Gmail] mailbox, but you can do it if you want.
Further Considerations — Now then. Let me explain what we have at this point. Your email arrives at Gmail’s servers and gets filtered for spam automatically. You can then check your email in Mail (or in any other IMAP client, on any computer), or via the Gmail Web interface, and no matter how you look at it, you’ll always see the same messages, with the same status (read/unread, replied to, etc.), in the same location (mailbox or label). You have tons of email storage space, access to a boatload of optional (and sometimes experimental) Gmail features, and you’re not paying a cent for it.
One thing I love about using Gmail for mail is server-based rules (which Gmail calls filters). To set up a filter, just go to the Gmail Web interface, click the Create a Filter link next to the search field at the top of the window, and follow the instructions. Although Gmail’s filters are less sophisticated and flexible than Mail’s, I’ve been able to replicate about 90 percent of the functionality I had with Mail’s filters (which I then deleted). Not only does this make Mail snappier by giving it less to do, it means that if I access my messages on the Web, on my iPhone, or in another client, they’re already (mostly) presorted into the mailboxes of my choice, and my inbox isn’t cluttered with nonessential mail.
Because your mail is hosted by Google’s massive server farm, it’s not subject to the kinds of problems that could affect mail hosted on a single server (like my Xserve) and is somewhat less vulnerable to outages than with most email providers. But Gmail has had a few (well-publicized) outages (see, for example, “Gmail Outage Marks Sixth Downtime in Eight Months” at PC World from February 2009). Some of these outages have lasted an uncomfortably long time, and they could potentially happen again. Of course, any email provider can have outages – that goes for MobileMe (see “MobileMe Mail
and Gmail Go Down Simultaneously,” 2008-08-11), Fastmail.fm (see Glenn Fleishman’s blog post “No Longer Recommending Fastmail.fm” from August of 2006), and your own server too. My own feeling on the matter is that I’d rather have one of the world’s largest Internet companies worrying about my email outage than having to deal with it myself (or leaving it in the hands of a smaller, less-capable email provider), and since I have several other email accounts I can use as a backup, I don’t lose too much sleep over it.
Nevertheless, I do, naturally, counsel you to back up the local copies of all your mail. In the event that a catastrophic outage at Google resulted in some or all of your messages disappearing from the server, you want to be sure you have another copy somewhere. So, you know the drill: read the book (or the other book), set up your backups, and test them regularly.
If you have more than one email account (and who doesn’t these days?), you can use Gmail as a central repository – either forwarding your other accounts’ mail to Gmail or letting Gmail check the messages in other accounts using POP. This lets all your accounts take advantage of Gmail’s spam filtering and other features, and is especially helpful for devices like the iPhone that don’t offer a consolidated inbox view for multiple accounts. What makes Gmail especially good as a central clearing house (as opposed to, say, MobileMe Mail) is that it offers a way to let you send outgoing mail from other addresses. I describe this entire process in detail in a Macworld article titled “Streamline E-mail with Gmail.”
Last but not least, I’d like to put in a plug for the method of email organization I’ve found to be most effective and least stressful, which is to adopt a strategy that keeps one’s inbox empty nearly all the time. As I type these words, there happen to be two messages in my inbox, and that’s only because I’m not wired for multitasking and I haven’t had a chance to deal with them yet. They’ll be gone within the hour. If you want to read about (a simplified version of) how I pull this off despite receiving gazillions of messages every day, see my Macworld article “Empty Your Inbox.”
Since this article was published in May 2009, a number of things have changed in Gmail and Apple Mail, and many more things have changed in iOS Mail. Although you should still be able to follow the instructions above (with perhaps a few minor alterations) and get good results, you may be interested to read more thorough and up-to-date discussions of getting Gmail to interact happily with Apple Mail via IMAP, and with your favorite iOS device via either IMAP or Exchange. If so, I invite you to purchase either or both of my more recent ebooks on those topics: Take Control of Apple Mail in Snow Leopard and Take Control of Mail on the iPad, iPhone, and iPod touch, Second Edition.
Hey, Joe. Great writeup. I've played with both methods of gmail access on the iPhone. Although push via the exchange setup works, it doesn't interact well with Apple Mail via IMAP; namely, the replied to and forwarded markers do not propagate back to Apple Mail. I find that unacceptable, so I still use the standard IMAP on the iPhone and deal with the every 15 minutes for checking. Any thoughts on that?
I do the same thing. For me, proper (or proper-ish) IMAP behavior is much more important than push email delivery. Even if I could have both, I'm not sure I would, since push eats up your iPhone's battery, and it's almost unheard of for me to receive an email that absolutely, positively requires my IMMEDIATE (as in, before 15 minutes have elapsed) attention.
Indeed it is valid, still. Even on Lion.
Of course there a few changes in settings on both sides —mail.app and gmail. But the reader who learn what he's doing and why by your article will go through them with ease.
Thank you so much for sharing your knowledge.
The 10.11 El Capitan edition of Joe's ebook about Apple Mail will be published in just a few days and will be called "Take Control of Apple Mail, Third Edition." In the manuscript, Joe says, "But the way Mail in Mavericks and later handles Gmail accounts is so much different from how Mail in earlier versions of Mac OS X did that, for all practical purposes, those 21 steps to "bliss” are now irrelevant. In fact, you’ll now get the best results in Mail if you leave most of Gmail’s settings at their defaults!
'In short, if you read that article, or one of my earlier books on Mail, and made a bunch of changes to your Gmail configuration so that it would work better with older versions of Mail, you should consider undoing some of those changes now. I explain how just ahead. If you haven’t made any changes to your Gmail setup yet, account setup is quite simple"
I was having terrible problems with gmail and Mail, and was at the end of my rope when I read this. I followed your directions (adapting a little, because I'm using Mail 4.4) and so far it seems to be working. Thank you!! And thanks also for the intro where you explain how it all works. I thought I knew, but after reading it, I know more.
I'm so glad you've found it helpful!
Yay you! I was up til 4am last night lurking around mac forums trying to cull together the best advice on 1st converting my PC's Outlook mail to a mac version (I used Outlook2Mac) and then figuring out all this Gmail+Mac Mail stuff. Your post was the best - clear, straightforward and no nonsense. Plus i like your humor and if you meant it or not, laughed out loud at: Maybe its very presence in your mailbox list offends your sense of order, since it serves no purpose now.
Since it kind of does offend...but not enough to do more!
One question. Now i have 40K emails in Mail's inbox. If I trash them on my mac...will they never download here again? I definitely want to remove them from my Mac (they are from the last few yrs).
Nope. I deleted them on Mac mail and now about an hour later (my one happy hour!), they are downloading again! Why? On Gmail's webmail they were marked as 'deleted' in my inbox.
Why do they keep downloading? Your help is greatly appreciated.
Glad you enjoyed the article!
Before I answer…what's not clear to me is whether you want to keep the messages in Gmail but just not have them in Mail, or if you actually want them to be deleted forever in both places.
What should happen if you follow everything in this article is that Gmail's labels exactly mirror Mail's mailboxes. That means if you delete a message in Mail, Gmail should apply the Trash label, and then when you expunge messages in Mail (for example, by choosing Mailboxes > Erase Deleted Items > In All Accounts), then it should disappear from Gmail FOREVER. If that's not happening for you, then I suspect some setting isn't quite right.
But maybe you actually want to hang onto these messages in Gmail, you just don't want them in Mail. In that case, you MUST get them out of your Inbox—that is, in Mail, move them to another mailbox, which should have the effect in Gmail of removing the Inbox label.
I may not quite be understanding, though, so please clarify if need be!
Thanks for your expertise!
First to answer your question:
I wanted all the emails always there on Gmail.com (as sort of a backup--i used to do POP and Outlook...so gmail.com was just sort of my backup and i dealt with everything in Outlook), but NOT ALL emails on my Mac Mail--just the ones i saved/categorized etc.
Here's what i ended up doing:
On Gmail: I created a label called My archive (i wasn't sure what their 'archive' really did) and moved about 10K newer emails there.
But also in my haste I moved about 30K mails to the trash label/folder.
The result is no more downloads of old mails to my Mac Mail, but now i am worried that the 'trashed' mails will delete in 30 days as it says. Should I select all of them and move them into 'my archive' to save them? Eventually i have to delete some for good as Gmail says i've used 75% of my storage space.
Thanks for the explanation. OK, if you set up things as I describe in this article, and messages on Gmail are labeled as Trash, then you absolutely run the risk that Mail will delete them from Gmail permanently. (For me, that's desirable behavior, because I use Trash to mean "I really honestly truly don't want this ever again," and I put mail I want to keep somewhere other than the Trash.)
So, in your case, the safest thing to do is to move those messages labeled Trash to your "my archive" label or give them some other label—and make sure they lose the Trash label!
You are so helpful. Thanks for cutting thru all the "clutter" out there on this.
On Gmail: I moved everything from Trash into "My archive" for now.
i do see that when i delete something on Mail...or even in Gmail. It remains in the AllMail folder. How do I truly delete emails (forever) or get them to really delete when i hit delete on my inbox in Mail? Right now on Mail they go to the trash (which consists of 2 folders...'on my mac' and 'gmail'. When i right click and delete the trash...they disappear but are still in AllMail on gmail. When does delete really mean delete?
Also--random--that "My archive" folder is showing up in my Mail sidbar under "Gmail". But i think after that i turned off that 'show in imap' button. So now when i try to delete the 'my archive' mailbox on Mail it says it can't b/c its 'an unknown folder'. Any idea how to get rid of it? Will i have to turn the imap on for it and risk downloading 50K emails? Oy!
If you set up everything EXACTLY as I describe in the article, then delete really will mean delete, once the messages are expunged. That's a weird concept, I know, and Gmail makes it weirder. But, basically, trashing something marks it for future deletion but leaves it in All Mail. You have to either choose Mailbox > Erase Deleted Items > whatever, or set Mail's prefs to permanently erase deleted messages periodically (Mail > Preferences > Accounts > Gmail > Mailbox Behaviors) and then wait until the relevant event occurs or time elapses. Then and only then will the messages truly disappear forever, including from All Mail. If they don't, then something is definitely different between your setup and what I describe here.
You can't delete "my archive" in Mail unless you turn IMAP back on—that's the way it works. There's not enough space here in comments to deal with this properly; let's continue this at http://getsatisfaction.com/takecontrolbooks/
Thank you for your post. I have been reluctant to send emails from apple mail for quite a while because I could not figure out proper syncing of all the folders. I even attempted to use Thunderbird, but that came with its own set of problems (address book being the biggest). Now, it finally appears to work as it should. Again, many thanks!
You're quite welcome!
Great article clearing up misconceptions and truly illuminating the beauty of IMAP. Thank you.
So can I apply the steps to email bliss if I have already set up my Apple Mail-Gmail account(s)? I DO want to truly have deleted mail begone forever, I DO want to file and organize hierarchically as I wish and I DO NOT WANT TO LOSE ANY EXISTING MAIL.
Would it be best to start from scratch or can I modify per your rules?
On an entirely other matter, you mention in the article using "Google Apps...possible to use Gmail with one's existing email address...without having to switch domains or addresses." Where do I find info/instructions to set this up? My wife uses a comcsast POP account, they don't do IMAP, and it would be great to get that account into the state of bliss without changing the address. Have you written or can you direct me to a 'how to' for that?
Once again thanks for the terrific work.
You can certainly modify your existing setup to match my suggestions, or if it makes you more comfortable, start from scratch by deleting your Gmail account in Mail. You won't lose anything that's on the Gmail servers, although I do of course recommend good backups!
As to your second question, see: http://www.macworld.com/article/138836/, which should at least point you in the right direction.
The modification of my existing account went very well, again thank you. I have long wanted to make this happen just like you've written.
Another question, my gmail subfolders did not come over to Mail. Do you have a strategy for creating and syncing additional subfolders that exist in gmail but not in Mail? (Is this maybe because I modified instead of creating new?). The subfolders are all on the iphone mail.
You'll have to quit and restart Mail after making changes to your labels on Gmail for them to show up, but if you've already done that, I don't have any good explanation for why the mailboxes would show up on your iPhone but not in Mail on your Mac. As a last resort, you could delete the account in Mail and re-create it.
Just wanted to say thank you for an incredibly useful article.
Thankfully my migration project (still underway) has the benefit of Mail 4.4, so many of the small details have been taking care of client side. But having the knowledge of how to wrangle the gmail settings meant I was able to move across what I needed (POP > Gmail > Mail+Gmail as IMAP)
... as well as starting to think of ways to improve email productivity with the goal of an "empty inbox" as you mention in another article.
I'm so glad I was able to help. Thanks for your comment!
Wow...a little knowledge is a dangerous thing. Without carefully going through the steps in this article, I decided to play around with setting up an IMAP hookup from Mail to my gmail account. Miraculously, about half of my iPod Touch Notes appeared in Mail.
Interesting, I thought, but I think I'll delete that account until I'm ready to really work with it, e.g,, to move my office gmail over to Mail. After I deleted it, the Notes were gone--from my iPod Touch as well as from Mail. Hope there was nothing essential...
Hi Joe. Thanks for this very informative article.
I've enabled IMAP for my Gmail account and it works great when sending / receiving email to/from my Apple Mail client. But you're right, searches and Smart Mailboxes display duplicates. Very annoying!
I've enabled Advanced IMAP Controls but when take the checkmark off of the "Show in IMAP" box under Settings / Labels (i.e. not Showing in IMAP) I cannot receive email for this account on my BlackBerry Torch (9800). I receive the following message on my BB from RIM:
"Your [email protected] email messages are not being delivered to your BlackBerry(R) device. To receive your email messages, turn on the IMAP setting for All Mail in your [email protected] account.
After you turn on the IMAP setting for All Mail, you must validate your account on your BlackBerry device.
1. Click the Setup folder (if available), then click the Email Settings or Setup Internet Email* icon.
2. Click Email Accounts.
3. Validate your [email protected] email account.
The other email accounts on your BlackBerry device are not affected. BlackBerry(R) Internet Service"
I have followed thru the instructions again and again. IMAP is enabled for sure but I am still not receiving my Gmail messages on my BB. Again it works just fine on my Apple mail client on my MacBookPro.
It may be that there isn't a solution to this and I'll have to live with the duplicates in my Apple Mail client. I've read here http://bit.ly/edLjmx (see the next to last posting on this page) that the "advanced IMAP controls" isn't the problem per se, it is selecting to hide the "All Mail" folder from IMAP views. [Apparently] the BlackBerry polls the All Mail folder, not the Inbox. Therefore, if you enable advanced IMAP controls and hide the ALl MAil folder, the BB cannot see it, and you don't get any mail on your device.
I'd appreciate any suggestions you might have.
I've heard from other people that BlackBerry doesn't work if you disable All Mail. I don't have a BlackBerry so I can't test this, but if that's the way their email client is designed, there's probably nothing you can do about it, unfortunately.
I have (or perhaps, I hope I have) followed this to the letter but I can't get Trash to co-operate. I remains steadfastly inside [Gmail] in the Mail sidebar - actually mine is called [Google Mail]?
In reality, the only Trash I can see when I go the the Gmail web interface is BIN but I assume that's not the one we are discussing here.
Meanwhile I shall persevere.
Gmail is called Google Mail in some countries, so that difference doesn't surprise me. As to why your Trash won't behave... So, if you select the Trash under [Gmail] and choose Mailbox > Use This Mailbox For > Trash, what happens? If nothing happens at all, I'm afraid I'm a bit stumped. If something happens, but just not what you expect, then we might be able to debug it.
As for "BIN" in the Web interface, you've got me there. It could be that Gmail calls Trash "BIN" in the same countries where Gmail is called Google Mail, but that's only a wild guess. In that case, I suppose you'd have to translate my directions accordingly!
I think I encountered this as well when setting up the accounts. Just double check the checkmarks on the second tab of your account settings in Mail: are the ones for the trash behavior both checked (near the bottom)?
Thanks for documenting all your good work on email. I also use Mac Mail, Gmail and IMAP. My problem is that I have strangely duplicated "IMAP on Gmail" mailboxes under my "Reminders" and "Notes" folders in Mail. Why would they show up under Reminders and Notes and how do I get rid of them? Thanks!
Each account normally has its own entry in both Notes and Reminders, same as under Inbox, Sent, Trash, and Junk. That's because you can store notes and reminders in any account, but Mail has to be able to show you which items are where. So, if you have just one "IMAP on Gmail" mailbox each under Reminders and Notes, that's as it should be. (You can use the disclosure triangles to collapse the display if you like.) If you have more than one under each...that's a puzzler.
To get rid of [Gmail], tell Mail to treat the [Gmail] mailbox, rather than your inbox, as the root of your IMAP account. To do this, choose Mail > Preferences, click Accounts on the toolbar, and select your Gmail account in the list on the left. Click Advanced, and in the IMAP Path Prefix field, type [Gmail].
After this instruction my Sent boxes " work" and " Home" disappeared under "Sent" .
After deleting the prefix [GMAIL] the sent boxes " work" and " Home" are back ???
( Working with two accounts Home and work )
Any idea what is wrong ?
As I discuss in my book, doing that has potentially undesirable consequences. Specifically, any other Gmail mailboxes that were showing under the Gmail category in Mail’s sidebar disappear! With this configuration, Mail can display only mailboxes that are in the [Gmail] hierarchy, and these mailboxes are outside the hierarchy. This won’t affect your Drafts, Sent, Junk, and Trash mailboxes because they were already under [Gmail], but it will mean that if you had messages in any other mailboxes, you'll have to manually relabel them in Gmail in order to make them show up in Mail—and you'll have to live with every Gmail label starting with [Gmail]/.
Thanks so much for this post!
I followed your instructions, but for some reason Gmail keeps re-appearing in Mail, with a sub-folder [Gmail]. Any idea what this is or why it's happening? I checked in Gmail and don't see anything there. Thanks!
Oh, and one more question: Under to-do, I have both "On my Mac" to-do, and "Gmail" to-do. I would prefer to just have one. Any idea how to rectify this? Thanks again!
As I explain in the article, the Gmail account, and its (empty) [Gmail] subfolder are supposed to be there, annoying as they may be. You can change your IMAP path prefix to get rid of [Gmail], but I recommend against it because it has undesirable side-effects.
Mail displays one To Do mailbox per account, and unfortunately you can't delete them.
Thank you for this great article. There are many that try to explain a similar setup, but yours is the most detailed and educational.
I am left with two questions that I hope you can answer:
1- Most of my mail is only in my inbox, but a good amount also has one other label, very little has multiple labels. Will I have duplicate mails on my local system (one for 'inbox' and one for 'other label') if my mail has multiple labels?
2- I use gmall's Accounts settings to send mail as my other google for my domain accounts, this actually sends it using alternate mail servers (not just setting the From). I'm new to mail.app, but I can imagine two different ways to set this up and I hope you can tell me if both are possible, and which is best:
2a- I could set up multiple accounts in mail.app, each one checking each of my google apps for my domain accounts, and sending as that user. This seems to be most in-line with what mail.app wants, since that's the easiest? way to get a unique signature for each account.
One problem I see is that what happens when, in your instructions, I set a specific 'Sent' folder as the Mailbox for Sent mail. Is it possible to tell mail.app to save messages sent as [email protected] into that specific gmail send, and mail sent as [email protected] into a different sent?
2b- I could have all my google apps account forward mail (And label it) to a single central account. I have this working today. Then in Mail.app I'd have to select which from address I wanted to use to reply with, and hopefully that would support a different signature.
Which do you recommend?
Many thanks for your great article.
1: Any messages that are in your Inbox and have another label will appear in Mail multiple times (one for each label/mailbox). My advice is not to keep most of your messages in your Inbox.
2: I would go with 2b, personally. In Mail's Accounts preferences, add the extra email addresses in the Email Address field, separated by commas. Even if you have Gmail set up to send via another SMTP server, Gmail (and Mail) will keep a copy of outgoing messages in your Sent mailbox. (I don't believe you can route different sent messages to different Sent mailboxes.) HOWEVER: note that although you can define many signatures in Mail, they're selected automatically only when you switch accounts (as in 2a). If the signatures all go with a single account, you'll have to manually choose the one you want from a pop-up menu in addition to choosing the desired From address for each outgoing message.
Thanks for the reply Joe. Now that I think about it more, I have to have mail.app send from different SMTP servers for different 'from's, which I think forces me to use multiple accounts? In that case, I'm kind of stuck since I would need to update the sent mailbox each time before I send email. Perhaps I can use some type of actionscript hook?
Thank you so much Joe for this very detailed and informative article. I just received a Mac last month, and finally decided to jump in and use the Mail program. This has greatly helped decrease frustration. It was a huge help. One question. A couple of months ago, I was "cleaning out" my Gmail (before I had Mail) and in the process of deleting messages, anything that was linked as a conversation in Gmail completely disappeared. I have avoided deleting anything now because I am uncertain what is going to disappear. Do you have any thoughts? Thank you so much.
Just to add an addendum to this, as I have done a little more reading since I wrote this: I still have a "deleted" folder under Gmail. I am unsure what to do with that. I did set up one "Junk" folder that is located at the top left of my Mail. And, could you please clarify exactly what settings should be checked under Mail>Preferences>Accounts>Mailbox Behaviors. This part confuses me, as far as knowing where deleted items are going. Thank you.
If your "deleted" folder isn't being used, feel free to delete it!
I have everything checked under Mailbox Behaviors except for Show Notes in Inbox. My personal preference is to delete Sent messages never; Junk and Trash when one week old.
In Mail, deleting a message deletes just that one message, not the whole conversation. (Perhaps this will change in Lion, I don't know, but that's the way it is currently.) On the Gmail site it's ambiguous at best.
Thank you for your feedback!
It pains me that people have to go through this because Gmail's IMAP setup isn't more standard, but I have no plans to move away. Their spam filters were one of the big draws for me, plus the excellent server-side filtering.
Brilliant Joe...I have followed your instructions to the letter, though I admit to not fully understanding what I was doing, and have it working as you describe. I wonder is it possible to clarify something...now if I delete an email in Mail it will go to Gmail trash and be deleted. Is there a way to delete the message in Mail, thus having it disappear from my mac, but remain archived in All Mail in Gmail. Thanks
Not if you have things set up the way I describe here. With these steps, delete means delete—everywhere. Mail doesn't have anything analogous to Gmail's Archive button (just remove the Inbox label, but don't apply any others). The only way to do this would be to enable [All Mail] (thus creating zillions of duplicates) and then move the message from the Inbox to [All Mail] instead of deleting it.
I think you could do this by transferring the message to an "on my mac" mailbox. This has the effect of removing the label in g-mail and effectively archiving the message. I think these "on my mac" mailboxes do not synchronize with gmail. Since they are not synchronized, you can throw mail in them away without affection the status in gmail.
I set this up the other way -- I"d like to keep back copies of everything on my mac and have my g-mail be more lean and current. So I move things to different "on my mac" mailboxes when I am done with them, and then it is safe to go to gmail and delete them there. (I think! please tell me if I am wrong!)
From the Mail menu, click Preferences > Accounts > Mailbox Behaviors
Move deleted messages to the Trash mailbox > do NOT check
Store deleted messages on the server > do NOT check
This will do exactly what you want, Chris. Cheers.
Thanks for the great information, Joe. I set up a test domain and I'm back in email client bliss. Hadn't been able to use Mail for nine months because of the persistent IMAP connections with my email host. Curious to see how OS 10.7 Lion changes Mail's IMAP behavior.
Before I jump in all the way, I have a question. Are there any email failover or continuity options in the event of a Gmail outage? Just looking for extra security in case there's a Gmail outage like the one in February or the one in February 2009.
There aren't any failover or continuity options that I know of, sorry!
I have followed your instructions and now I have an IMAP folder named "Archive" where I save all received mails I want to preserve, and I delete everything else. Your settings are wonderful to get this behaviour.
But there is something more: I would like the mail I send also be stored in "Archive", to get proper thread view. If I select "Archive" in Mail and select "Use this mailbox for Sent" the folder "Archive" appears as "Sent Mail", which I found confusing...
You don't want to tell mail to use "Archive" for Sent, because as you saw, that means it actually renames and moves the mailbox. Instead, continue to use Sent Mail for Sent, and to get the threaded view, select both Archive and Sent in the mailbox list (you can Command-click to select multiple, noncontiguous mailboxes). I gather that in Lion, Mail's conversation threading won't make you jump through that hoop.
Multiple selection, that's it! Thank you so much.
I tried the suggestions in this article, and then found out my iPhone now shows in the inbox the sent messages. So they show up both in Sent and in Inbox - the real incoming would then only be in All Mail. I tried everything from changing settings all over and deleting the accounts and reading them... In the webmail and in Mail there's nothing to suggest something is wrong - on the other hand the iPhone would only behave that way if something on the server is strange, right?
Even more strange. the emails i get now still do get through. only everything until the point i setup apple mail. so that means i did change something on the server i guess? still it doesn't reflect in apple mail, but only on the iPhone. how can i reverse it, any ideas?
I heard of one other person seeing sent mail in the Inbox, but I have no idea what might cause that. I couldn't even make that happen on purpose if I wanted to! I don't know what the problem is; only that what I described in this article works for me. You could try deleting the accounts in Mail and on your iPhone, restoring Gmail to its default settings (undoing any changes you made from these directions) and starting over... but that's about all I can suggest. Sorry!
Thanks for the answer. I've made some progress. I've discovered somehow "Inbox" label was added to all my sent emails. I was able to undo that from the web interface by disabling conversation view, choosing all the sent mail and then archiving it, which apparently is the same as removing "Inbox" label.
Now the Sent are no longer showing up in my iPhone inbox. But now I find out, only a little subset of my incoming mail shows up in there - so I've got a couple from this week and then from a few months back and then a few years back. very annoying... I still don't know what causes that. I could use some help if anyone has any idea... thanks!
Great article Joe. Thanks so much for sharing it. I am wondering if you have recommendations for how to set up Mail>Preferences>Accounts>Gmail>Mailbox Behaviors? I followed your recommendations exactly but am not sure how to adjust the settings in Mailbox Behaviors for Drafts, Notes, Sent and Trash so that everything still works exactly as you intended it with your article.
Well, you want to have all the "Store ___ messages on the server" checked. (Or at least I do; some people strongly prefer not to let any potential junk mail on their Macs, but I get too many false positives for that.)
As for the "Delete ___ messages when" options, that's a matter of taste and preference. I have Sent set to Never, Junk and Trash set to One Week Old.
I also have "Move deleted messages to the Trash mailbox" selected, as I believe it is by default.
And finally, I have "Show notes in Inbox" unchecked.
Thanks for the quick response! I have been pulling my hair out for a couple of months trying to figure out how to make gmail play nice with Mail. Your article is the only thing I have ever seen that explains it simply and works as advertised. Thanks again for shining the light in a dark corner.
Joe - Thanks very much for the helpful article and recommended settings. Can you provide an update for Mail 5.0 (Lion)? In particular, the Drafts folder is not working as outlined... If I select Drafts under [Gmail] and choose Mailbox > Use This Mailbox For > Drafts, the Drafts mailbox then disappears from under [Gmail] but reappears as a mailbox On My Mac, i.e., NOT under the main Drafts item.
Also, fyi, as a personal preference, I let Google handle all the spam filtering (which it does superbly), and leave Mail's filtering off. Finally, I do NOT move deleted messages to the Trash mailbox, so Gmail automatically archives all messages in its All Mail folder without cluttering my Mac. Nice.
The Drafts mailbox is working the same way in Lion that it did for me in Snow Leopard. If you say it's not doing that for you, I believe you, but I can't explain why it's working for me and not you.
Any changes to your recommended setup or configuration with Gmail and Mail 5.0? Thanks again, Joe!
Short answer: no—I left everything the same when I upgraded to Lion and it worked fine.
That said, this article could certainly use a few tweaks and updates in general, and I'll do that one of these days, but I'm up to my ears in writing books at the moment…
Interesting write-up, which I should have found before I reinvented the wheel on my own...! That said, there's one thing that bugs me since I started using Apple Mail. Here's my 'workflow':
- I've been running a local IMAP server to archive my messages for almost 20y now, with clients ranging from Pine through Apple Mail and (still) Sylpheed-Claws each of which sees a subset of my accounts.
- gmail serves as a central remote repository, and is always open in a browser (see below why).
- Apple Mail has my GMail/IMAP account, used mainly as the bridge to my own IMAP server. It only works at home, external IMAP being blocked where I work
- I leave email deletion to GMail
- I also have my iTouch set up to see my GMail account (as such, not as an IMAP account).
The issue: when at home, new messages in my inbox show up in Mail, but rarely on the web interface, unless I force a page reload. Any ideas why that might be?
I'm afraid I have no idea! For me, they usually show up on the Web before any clients, but then, I don't use an intermediate IMAP server so I'm not sure what effect that may have.
Oh, my own, local IMAP server isn't an intermediate, it's an endpoint! That's where the messages go that I decide to archive, manually (some of the mailboxes are at least 15y old...)
BTW, you mention Mail's spam filtering and how sometimes it finds junk that GMail let slip through. For me, the only spam it finds are legitimate messages. I have to insist to "unlearn" those, but I've never managed to get it to filter mail from specific senders as spam.
(I could teach them to GMail, but there are certain spammers I like to annoy back with spam reports so I'd prefer their messages to get recognised/filtered separately).
Great advice for configuring Gmail and Apple Mail but it still doesn't address one of the biggest problems with using the two.
If you SEND a message using Apple Mail (with everything configured correctly according to this article) that SENT message now shows up in the Gmail inbox as a SENT message and NOT in the Gmail "Sent" Messages.
One or two other people have reported this, but I can assure you that it does not behave this way for me (or for most users). I can't account for this behavior; I only know that for me, with things configured as described here, sent messages go in the Sent mailbox/label, and NOT in the Inbox. It might be worth deleting the account in Mail and setting it up again, just in case there was some random, passing glitch.
I think this is since lion. The new Mail does not offer the option to assign Sent/Sent Mail. :irked:
No, it's working exactly the same for me in Lion as it did in Snow Leopard. You can definitely still choose Mailbox > Use This Mailbox For > Sent (I just checked).
Sorry mate. Not getting it. See here:
That's the contextual (right-click) menu—a different thing. You have to go to the main menubar, to the Mailbox menu, and down to Use This Mailbox For.
Aha! Just re-read your instructions - my error. Apologies. :redface:
No worries at all. That used to throw me too—Apple *should* put that command on the contextual menu, but for unknown reasons they don't.
Useful and instructive article. My grateful thanks.
A big thanks for writing this very clear, and comprehensive guide.
I've been boycotting Mail for a while in favour of Thunderbird as these simple configuration settings seemed so hard to do. Granted (as you say), Google and Apple have made life easier now, but I still couldn't find the 'use this mailbox..' option. So thank you. My life would be a lot easier using the native programmes on my MBP so I'm very grateful. The only thing left to tackle now is how to get an empty inbox!!!
Quite an educational and valuable article. I have had a similar setup (can't remember where I got the instructions from) for a couple of years now but with some idiosyncrasies - the undying Bin/Trash behaviour being one of those. Bin is probably an Apple (UK) nomenclature as you say. All this time, if I wanted to delete an email whilst in Mail, I've had to mousedrag it to the Bin mailbox to function correctly (if I just keyboard delete or use the delete icon, it simply just becomes a Gmail archived mail). But now that I have all the checkboxes selected (thanks to the helpful commenter above), and ran through your instructions again, everything works just as you describe.
Many thanks not only for the instructions but for the simplified under-the-hood explanations as well.
I do have one unresolved issue though:
I have great many attachments cluttering my Mail/Gmail.
...continued in the next comment for want of space ...
Although I am nowhere near Gmail's storage limit and I have a fairly capacious hard drive for local storage, I do not see a reason for multiple copies of attachments lying around in different mailboxes. Any attachment that is being sent or received already has/will have a place in my folder system amongst my documents. An additional copy in the Mail/Gmail does little more than add to clutter.
I thought I had a workaround for this - through someone's helpful tip on the interwebs. By selecting the mail with the unwanted attachment, and choosing Message > Remove attachments, I keep the emails for reference and the attachments disappear..... or so I thought.
But, I just found out today that Gmail doesn't really want you to delete anything...it just creates duplicates. One email with the attachment and one without.
To get rid of this issue ,the only way I can think of is to trawl through 'all mails' mailbox and delete those duplicates again. Any suggestions please?
You need to look for unlabeled messages with attachments. If you do a search on the Gmail web site for has:attachment and then scan that list for matches that have no label at all, you'll find all the messages you removed attachments from in Mail, and then you can delete them for good. (Note that depending on your labeling/filing practices, some unlabeled messages with attachments might not be duplicates—just saying.)
What would you recommend for those trying to keep all messages like gmail archive in Apple Mail. I understand you can use your workaround by creating a new folder, but is there anyway to tell Mail that the Mail's trashcan is gmail's "all mail" and never empty the trashcan? So everytime you delete an email, it goes to the trashcan, which is essentially archiving? How you set that up on the gmail side?
I would not in any circumstances suggest using Trash as All Mail. It's too dangerous. Mail isn't designed to work according to Gmail's paradigm, and trying to make it do so is a recipe for pain. What I described in this article is the exact opposite: making Gmail work according to Mail's paradigm. And since I don't like or follow the Gmail way myself, I'm afraid I have no recommendations about how to do that in Mail, beyond what I said in the article.
Let me first off say thank you for this article, I think you did the world a great deed!
Now, if you don't mind me asking, how do you organize old mail? I can't imagine you delete everything? I noticed you said you put most of your mail in folders, but is that the only way? Could you just never empty the mail in your trash and use that? I'm not inclined to use a folder called "Filed" unless I have too... Thanks!
As I said, do NOT, NOT, NOT file mail in the Trash! Ever! Even if you plan not to empty it. Seriously.
I file my mail in a small number of mailboxes using Mail Act-On for keyboard shortcuts. It's super easy.
Haha gotchya. So I set up folder that I will be filing my emails to in Mail. But one last question: Since you don't have All Mail being forwarded to IMAP clients, does that mean that every email you get will still be saved in All Mail on gmails servers, regardless of what you do with them in Mail?
That's right. All Mail is still All Mail!
Joe, Thank you for this post. So helpful. Trying to set up Mail & Gmail for my mother - and doing as a trans-Atlantic project just to add a bit more spice to it all. I have a question - should I disable POP when IMAP is enabled? Going into the Gmail preferences I find POP and IMAP enabled.
There's no harm in leaving POP enabled but just not using it.
Thanks for the excellent article Joe! I don't suppose following your instructions will solve the infernal problem of not being able to send myself an email (ie. when "From:" and "To:" fields have the same address the email appears in "All Mail" folder but not "Inbox".) ? Having read your article and trawled the forums I understand why this is happening but have yet to find an adequate solution. Any help would be greatly appreciated - thanks!!!
I send email to myself all the time and it definitely shows up in my inbox. Not sure if I had to do anything special to make that happen, but I'm pretty sure if you just follow my steps here it will work.
OK - Thanks for responding Joe. I'll give it a shot! If I can't send myself emails I'll never remember to do anything!
Thanks for the guidance. I have set up 2 MAC on gmail and they are talking to each other like best friends now!!!
One question, I found it quite annoying to have all those drafts being saved in trash, so I UNCHECKED "keep Trash on Server" in Mail, and now my drafts don't show up there. IS there a reason I SHOULD NOT do that. Your setup instructions said to leave that setting checked on in MAIL.
THANKS FOR YOUR HELP.
The point of checking that box is to keep the Trash in sync between your Mac and Gmail—so that, for example, if you delete a message in Mail you can later recover it on the Gmail Web site, or vice versa. If you choose not to do that it's up to you, but just be aware of the consequence.
Thanks for your awesome write-up - I use Mail+Gmail exactly as you recommend.
I'm using Mail 5.0 on Lion 10.7.1 and am having a serious problem with sent mail showing up as unsent in my drafts mailboxes (I have three accounts in Mail).
This is a well-documented issue with many users frustrated since 2009 with seemingly no attention from Apple (Google it to see). Any advice? I'm desperately sick of deleting them after second-guessing whether they've been sent or not.
Sorry, I don't have any advice about that, except to ignore it, which is what I do. For me, it happens only occasionally, and it's not a bother because I never actually save drafts to finish and send later. So I never have to wonder whether something in Drafts was actually sent or not.
Hello! I tried your setup and it works great! However I don't know how to do it for 2 email accounts.
Could you help me set up 2 accounts? I have 2 Gmail accounts - Personal and Work.
What I used to do is forward all my Work Gmail to my Personal Gmail, and then allow my Personal Gmail to send email via my Work Gmail address.
Is this possible with Apple Mail?
I've tried to do similar things, and I think the short answer is 'no'. Apple Mail seems to require a separate incoming mailbox (POP, IMAP, whatever) for each outgoing identity. It won't let you set up an account without an incoming mailbox. So, if you want to send as either your home or work identities from your home computer, your home computer must be set to check your work email server directly. Once that's done, you can respond to any message with any return address. But, relying solely on the forwarding you have set up is not sufficient. At least that's my experience. I'd be happy to learn different.
I was able to add up 2 email addresses in 1 account using the following:
Now my current dilemma is how to automatically reply using the same address. It seems to always reply using the first email address, and I'd like it to automatically reply using the same address.
Account Settings: [email protected], [email protected]
I get a work email and when I click reply, it automatically replies with my personal email.
I can set it to reply using work email but I have to do it every time, and sometimes I forget. It comes out unprofessional.
Gmail had a setting called "Reply from the same address the message was sent to".
Please help!! Thank you!
I'm sorry to say Mail just doesn't work that way. If you want to be able to reply automatically from the account to which a message was sent, then you have to keep the two accounts separate in Mail—no forwarding from one account to the other. If you want to keep the forwarding, then you have to select the From address manually each time. Sorry!
I see! Is there a way to set up 2 account in Mail (my personal email is Gmail, and my work email is Google Apps) where the sent and junk messages go to the right mailboxes?
If I can do that, then I can turn off the forwarding.
Thanks for the help Joe!!
I have great news! I turned off my forwarding and set up my work email to another mail account just like your description and it works great!!
I was worried that I could only designate 1 sent mailbox and 1 junk mailbox. Now my Sent and Junk have 2 sub-mailboxes each - 1 for work and 1 for personal.
Woohoo! MAIL + GMAIL Bliss at last!!
Yay! (And also glad you were able to answer your own question.)
Thank you for all the info. But i find i am limited by the quota gmail lets me imap. Is there anyway of increasing that quota?
Sure, for a price!
This is the best advice I've see on gmail/apple mail playing nice--makes a huge difference, thanks!
One question with my new Mail 5.0. I'm a fan of gmail's Archive for those emails that maybe I need to keep, but don't have a special folder (I'm a serious deleter of most things). Apple has created a new "Archive," which sounds great. Is there a way to map it to the Gmail Archive label so that anything I move to the Archive folder in Mail is in the All Mail folder in Gmail?
I've got a set up right now similar to the user who did a "My Archive" folder and can keep it that way, but if there's a way to integrate the two, that'd be amazing!
iCloud Mail has an "Archive" feature, which is different from Gmail's—in iCloud, clicking Archive just moves a message to an Archive folder. But that's iCloud; it has nothing to do with Gmail. There's no Archive button in Mail, and even if there were, it would only work within a single account, not as a way to move messages from one account to another.
This is a really great article. Thank you.
I followed your steps to map everything using the "Use This Mailbox For" feature in Mail, but I'm not sure I like the fact that I can't really archive my GMail emails anymore. Is there a way to reverse or undo the "Use This Mailbox For" mapping that I've already done for Sent, Trash, etc.?
If you really want to disable those mailboxes, go to Mail > Preferences > Accounts > your Gmail Account > Mailbox Behaviors and uncheck all the "Store xxx messages on the server" checkboxes.
Very, very impressive job on this whole article. So glad I found it.
I was successful in following your instructions to get rid of everything under the Gmail Folder in Mail.app except for Trash. Choose Mailbox > Use This Mailbox for> Trash did not cause the Trash mailbox to disappear. Tried multiple times; all failed.
Any idea why your instructions worked on Sent, Drafts, etc., but not Trash?
Hmmm, very strange. One thing to check: go to Mail > Preferences > Accounts > your Gmail Account > Mailbox Behaviors and make sure both checkboxes in the Trash section are checked. Other than that, I'm not sure what to suggest, other than deleting the account from Mail and trying the setup again.
I did in fact not have those two boxes checked. I did so, and followed your steps to disappear the Gmail Trash folder but they did not work.
I neglected to note something which may or may not have a bearing on this: I prefer to keep the All Mail Folder under Gmail in the Mail.app and so have left it there.
Might this have been the reason why I could not disappear the Gmail Trash Folder???
Having All Mail visible or not shouldn't make any difference to Trash behavior. If those boxes are checked, then I'm afraid I don't have any other ideas, except to delete the account from Mail and try setting it up again from scratch (which may or may not change anything). Sorry—I've just never seen that before and don't know what the problem might be.
Just to close the loop on this one: I quit Mail.app, did a restart, again followed your directions for removing the Trash mailbox and this time it worked. Many thanks once again.
Ah, fantastic! I'm so glad it's working for you now.
Have re-read the article again now after setting up a Google Apps account (only had an ordinary account before that I did not use much). I really must find a way to store all Sent messages in my Inbox AND ONLY in my Inbox. (The Sent mailbox is fine for notifying that a message was sent successfully, but should then immediately be moved to the Inbox - why anyone would want to keep a message in a Sent messages box seems incredibly cryptic to me.) But with Google Apps this does not seem to be possible - can it be for real? Also before unchecking the save on server for Sent messages I could not receive messages in my Inbox sent by myself - such as notifications from iCal that I rely on. I guess I have to live with duplicates in an extra [Gmail]/Sent Mail mailbox in Apple Mail?
(As it was now I moved sent messages over to the Inbox and deleted them from the Sent mailbox as I have always done, but later realized the messages had thus been trashed from the Inbox as well. Great ... .) /Jerry
Realized that I can also hide the Sent Mail mailbox from IMAP access and with my setting of not saving messages on the server, which I think is the ONLY possible usable setting this will be acceptable.
I'm afraid I can't help you here… I can't even conceive of ever, under any circumstances, wanting to store sent messages in my Inbox, and certainly neither Gmail nor Apple Mail is a good tool if that's what you want to do. This article really is for people who want Mail to behave the way I want it to; if you're not such a person, this just isn't good advice for you.
The article is certainly good advice for anyone wanting to use Gmail and Apple Mail and I think most of your suggestions are quite good. (Changing the settings as I did solved most of my problems with Sent messages and also the problem of not receiving messages I send to myself manually or via iCal or other services.) Also, is not the (relatively new) idea of grouping conversations of messages from both Sent and Received mail a proof of the need some have for seeing the sent and received messages together? (I just find it a bit fun that they have "solved" that problem that I never had.)
I just got confused by the many things to think about when dealing with Gmail and Apple Mail (as I assume was the reason you also wrote the article from start). It is esp. confusing if one has several different IMAP accounts to remember the differences between maiboxes and tags. Thanks for the article!
I was perking along great using Gmail and Apple Mail until I upgraded to Lion. Now, every time I receive an email, it lands in the Gmail Inbox but then moves itself to the All Mail box. This ONLY occurs if I have Apple Mail running on the Mac so my assumption is that Apple Mail is the culprit. Any ideas?
Unless you have some weird rule set up in Mail, I'm afraid I don't have any ideas.
After spending lots of time trying various options in both Apple Mail and Gmail on my Mac I think I've figured out what the problem. In the Gmail settings I turned Auto-Expunge off. This seems counterintuitive but now things are working find.
Since Gmail is so widely used, I'm surprised that Apple doesn't make it easier for Apple Mail and Gmail to play nice with each other. Thanks, Joe, for your great article and I'd like to put in a plug for your ebook, "Take Control of Mail..." It's a great resource.
In the new version of Mail in Mac OS X Lion Mail wants to automatically configure your email.
Should I allow that to happen to configure my Gmail account as your article entails, or should I configure Mail manually?
In the Lion version of Mail, if you use the automatic setup feature, it does correctly choose IMAP rather than POP for Gmail. So that's a good starting point. However, you'll still have to follow the steps to deal with the Drafts, Sent Mail, Trash, and Spam mailboxes under [Gmail], and you should check the other settings too—some of them will be right, others not.
You solved what countless other websites and forums could not. I'm eternally grateful to your assertiveness and resolve.
I'm so glad you found it helpful!
I have both an aol email account and a gmail account. The problem I am having in Apple Mail (using Lion) is s mismatch between some of the names and email addresses. For example, I have Susan Smith in aol contacts and Susan Jones in gmail contact. When I receive email from Susan Jones, it is showing it is coming from Susan Smith. Why?
I'm afraid I have no idea.
Thanks for this article!
For someone who has followed your instructions, what is your recommended settings on the "Mailbox Behaviors" tab for each account? I have changed them so many times over the years trying to make things work that I do not recall what the defaults were anymore. :) I thought you had some recommendations about this in your article when I originally read it, but I think I must be confusing it with something else I read somewhere else.
See the note at the end of Step 15. Basically you want everything checked (except perhaps for Notes). As to when sent/deleted/junk messages are deleted, that's up to you. I set Sent to Never and the other two to One Week Old.
Thanks for this article, and for your continued responses to questions. Very helpful and appreciated!
You recommend "Then, in Gmail's Web interface, you can select all the messages in All Mail without any other label and apply the Filed label." How do I select all the messages in All Mail without any other label? I have too many messages to do this one-by-one. I searched in the Gmail Help for an answer, and found multiple threads stating that it can't be done.
Unfortunately, there's no simple way to say "show me everything without a label." So you have to use "-label" to tell Gmail which labels NOT to show. In the search box, you type:
and just keep adding +LabelName etc. until you've added all your labels. That's a pain to do, but you can do it just once and then save the URL that appears when you actually do a search.
(And, tip: if a label has more than one word, type a hyphen instead of a space.)
Thanks, Joe. I saw that approach mentioned when I searched Gmail Help, but I've got too many labels for that to be practical. I only had about 6 weeks of emails that were unlabelled, and it was easy (albeit tedious) to just add my "UNFILED" label to them manually. Now I've got my Gmail account set up according to your recommendations, and I think that it's a much cleaner approach that should work well.
Your article really helped me with alot of issues I was having with Gmail/Apple Mail.
One issue did pop up yesterday that wasn't discussed in article or comments. My outgoing server went "offline" in Apple Mail and my entire Sent and Drafts folder (at the top) were completely empty. Folders were visible with no contents. My inbox was still visible and held all incoming emails. After closing out of mail, opening again Sent and Draft messages still were missing. I logged into gmail and the sent messages were on the server but only accessible through gmail.
Finally I sent a test email to a co-worker, Apple mail had me input my password for outgoing server and the Sent and Draft messages came back to my Apple Mail.
1. Why did this happen?
2. How can I make sure it does not happen again? I don't want to lose access to my sent messages if I am disconnected from the outgoing server.
If you followed the instructions in the article, then I'm afraid I don't have a good explanation for the behavior you saw. We can hope that it was only a random, passing glitch and that it's now fixed for good. You might try quitting Mail, turning off Wi-Fi (or disconnecting Ethernet, as the case may be), and reopening Mail to confirm that the Sent and Draft messages are still available when your network connection isn't.
Another question - one of my users is not receiving attachments in their Apple Mail. People cc-ed on the email are receiving the attachment. The attachment is showing the user's gmail (online) account but not in the Apple Mail. Any suggestions?
I honestly don't know, but one thing to try on that Mac in Apple Mail is to press Command-Option-] when viewing the message. In some weird situations Mail can display a non-optimal format that excludes inline attachments. For reasons I won't get into, I kind of doubt that's what's happening in this case, but it's the only thing I can think of offhand to try.
A great article and explains the unexplainable very well. I have been using pop to access Gmail via Mail since Tiger release and so have built up a number of emails on my Mac. If or should I say when I change to IMAP - is there a way of moving the emails that are on my Mac to Gmail so I can then refer to filed emails on other devices? I would like to know this before I make the global change. Is this just a case of drag and drop and Mail uploading to Gmail? If so, I presume any mailboxes I have on my Mac would need to be created in Gmail first etc?
The other issue that would be most useful to know is how in IMAP does the data usage differ from Pop and how often are the connections made for new mail - is this similar to how the Pop method works?
Finally, is it best to use filters in Gmail or Rules on Mail client?
Any help on this would be appreciated.
To upload existing messages to Gmail, you can just drag and drop mailboxes from the "On My Mac" section of Mail's sidebar onto the icon for the Gmail account. It'll then (slowly) upload all the messages (and even nested mailboxes) inside. Mailboxes will appear in Gmail as labels.
How often the connections are made is up to you—you can check out Mail's preferences for that. Getting into the details of data usage compared to POP is more than I can do in a comment.
In most cases, I prefer Gmail filters to Mail rules, because then mail arrives pre-filtered on all my devices, even those (like the iPhone) that have no rules. Mail's rules have more features, but can't operate (obviously) until the messages arrive in Mail.
When I finally started to get serious about IMAP and Gmail, your article was invaluable. I just about got happy with the settings you recommended. Then I came across another article by Jeff Schuette at his eponymously named website. Between the articles I was able to get everything configured as well as get some knowledge of how all the parts play together. It's tricky stuff and hard to follow when working with similarly named but subtly different labels/folders etc. Thanks very much!
Thanks for the article Joe. I’ve followed your advice. Note:
I don’t use Google Apps, just a standard Gmail account. Anyway, all went according to plan beside point 17 (tell Mail to use Gmail's Sent Mail mailbox as the Sent mailbox for this account); on Gmail Web interface all the sent mail is now in “label:[imap]-sent” rather than Sent Mail.And, all the mail that I’ve been sending since from Apple's Mail client, ended up in both “label:[imap]-sent” and Sent Mail on Gmail Web interface.
Not sure exactly what went awry in step 17, but basically it sounds like you selected the wrong label/mailbox for Sent. So my guess (I can't tell for sure) is that you need to go back and try step 17 again, and then, on the Gmail site, move the sent messages from the wrong mailbox to the right one, and then delete the now-irrelevant label.
Lots of good stuff. However, you did not thread in the imap/pop usage in different machines to get around the gmail limitations (keeping our conversation topics in order they need = price for free gmail). It is irresponsible of Google to offer an IMAP option that in principle overcomes the pop limitations for multiple machine usage. Yet, as you explained there is a limit of two (2) machines. My institution adopted an Google app and I do not trust its intentions as they privacy disclaimer only explains how the data is managed in the server, not how private information is used!
Could you please comment on: (1) Mail in different units(OS) and combinations (different gmail accounts) imap/pop, (2) above, but when different machines have different rules (although identical gm filters), and (3) work around getting messages one read in one machine and MARK AS READ, but will not show in another machine even when checked through the web mail interface
So I've just spent an hour reading through all this info and setting up my gmail in mail and I can't get gmail to go online...
I keep getting and error message:
There may be a problem with the mail server or network. Verify the settings for account “Gmail” or try again.
The server returned the error: Application-specific password required: http://support.google.com/accounts/bin/answer.py?answer=185833 (Failure)
I was getting the same error message in the beginning stages of trying to add the gmail account to the mail account.
I just figured out what the problem was.
You need to Authorize Access to your Google Account by generating an application-specific password.
Here is a link:
Hope this is helpful to anyone else with the same problem.
Thank you very much for your detailed information it helped me to easily set up gmail in Apple mail in OSX 10.8 !!! One change that I noticed when following your instructions was that step 7 is no longer necessary as the Advanced IMAP Controls are no longer in Labs. They are now by default in the "Forwarding and POP/IMAP" section of settings.
Yes, a number of things have changed in both Gmail and Mail since I wrote this article. One of these days I'll have to give it a thorough update.
Thanks for a really interesting read. I recently had to move from ISP-hosted mail (based on Gmail) when I moved country. I decided to take the plunge with my own DNS and GMail apps. It was only then that I realised how little I understood. Over the last week, I have been scouring the web for info on how to optimise set-up, and have reached a place fairly similar to your method. So your article has made me feel much more confident that my method is going to work. A few questions:
1. Are you saying that a msg that gets through the GMail spam filter, but is picked up by Mail junk filtering (or manually marked as junk on the client by me) will then register as spam for purposes of spam "learning" by GMail? If so, that's cool.
2. What happens if I switch off junk filtering on Mail, and only keep junk / spam on server?
3. Can I use the new Archive button in OS X.8 Mail? As far as I can tell, it just creates a new label in GMail, but don't want to confuse things.
4. What about Ipad? Thanks!
1: Google doesn't say exactly whether or how its filters learn. It's not the same way Mail does it, though. When Mail marks a message as Junk, it does get marked as junk in Gmail too, but whether that actually "teaches" Gmail, I can't say.
2. The consequence of doing this is that you'll have to go to the Gmail site to check for false positives. I get a few of these per week, and I like being able to scan my Junk folder in Mail to catch them. It's way easier.
3. Archive in Mail ≠ Archive in Gmail. As you say, Mail simply applies a label called "Archive." You can use the feature if you want, just remember it's not the same thing as archiving in Gmail.
4. The iPad works great. I have a whole book about Mail in iOS, which will be updated very soon to cover iOS 6.
Thanks for getting back to me.
1. On the spam/junk point, it seems like when you report a message as spam in Gmail, it gets moved into the junk folder on Mail. But it does not get "marked' as junk - you have to go in and do that manually.
2 Couldn't you switch off filtering on Mail, but still have Gmail send SPAM to a folder on the client? That way you could still scan for false positives, but you don't have two sets of filtering going on. But maybe I'm trying to fix a problem that doesn't exist - I can be a bit OCD like that.
3. I've set up Archive in Mail. My thinking is that I will use this as my main "trash" button (i.e. get this message out of my inbox). And I will only use delete for messages I absolutely know I don't want. Then combine settings on client / server so that these are auto-deleted. That way, I get rid of the many incomplete drafts that come from syncing drafts to server. (See next comment)
1. Right. For a message to have a Junk flag in Mail means Mail's spam filter caught it, or you manually marked it as junk.
2. I suppose you could, but I don't think you'd be happy with the results, because it would mean Mail would move the Junk mailbox to a different location. In my opinion, best to leave things as they are.
3. Up to you, but just remember, you shouldn't be thinking of "trash" and "archive" as being at all similar.
What's the best combination of client / server settings to remove deleted messages from trash?
I have set up Mail to permanently erase deleted messages when one week old (gives me a little time to save a message if I make a mistake).
And on the server, I have set Auto-Expunge off, and selected "Immediately delete the message forever". I tried "Move the message" to the trash under this option, but realised that unless the Mail client on all my devices (iMac, MBA, iPad) had permanently deleted messages in the trash, then the server would keep downloading trash messages back to the clients.
I look forward to your iOS 6 book - presumably available as an e-book?
Thanks again. Emil
My own settings, which I've found through trial and error to work well for me, are Auto-Expunge ON in Gmail, and in Mail, Move Deleted Messages to the Trash Mailbox and Permanently Erase when One Week Old. But, like I say, I'm trying to get Gmail to behave as much as possible like other IMAP servers when used with Mail. It's somewhat a matter of taste/preference.
The book will be a new, fourth edition of this one (yes, ebook), in something like 2 or 3 weeks.
Hi. me again. After a few days of trial and error, I have concluded that you are right, and the many partial drafts in the trash are a price worth paying for full IMAP syncing of everything. But something weird has started happening - when I start to compose an e-mail, it is automatically saved in the Drafts folder (which is fine). Each time the saved message is updated, the old saved version goes to the Trash (also fine). But, when I finish the message and press send, the completed draft only disappears from the drafts folder (to be replaced by the sent message in the sent folder) about half the time. The rest of the time, a completed draft remains in the drafts folder (as well as the version that was sent in the sent folder). And if I delete this from drafts, it frequently reappears again.
Any ideas? I have everything set up as you recommend.
I haven't seen messages deleted from Drafts reappearing there, but everything else I have. I have no explanation or cure, other than to say this is Just One of Those Things about Gmail. Sorry!
I had something like this happen with an draft reappearing as many times as I would delete it. Turns out I had a draft of it open on another computer. Once I realized that and closed/deleted it, the draft never reappeared.
Wish I'd found this article sooner, though I found mostly similar directions in various other places and ended up doing most of the same things. But now we're left with a new question. I just helped someone who had multiple POP addresses in Apple Mail move them all into Gmail, including setting Gmail to check mail from the POP accounts and also to send mail as if from them, and then set Apple Mail to use Gmail via IMAP. Messages from all accounts come through to Mail and stay in sync between Mail and the Gmail web interface, but no matter which of the email addresses someone contacts, replies from Mail appear as being From the Gmail address. How can Apple Mail reply using whichever From address was initially contacted?
Mail doesn't have a way to do exactly what you're looking for, unfortunately. Related to this question, you may find this article helpful: http://tidbits.com/article/13189
Hi folks, hope your hive smarts can help. It's urgent i weed out my HD. I discovered today that the gmail folder in mac mail on my HD is >30GB in size. Yet at gmail.com, i have only about 6GB of mail in my account. I realize that MacMail duplicates mails madly. For instance, anything in a folder (or tagged), seems to be duplicated. Any advice on how to minimize this data explosion? One thought, perhaps: limit MacMail to download only the past year or so of email?
Turning off All Mail as described in this article should help a lot, as that will eliminate one duplicate of every message. But you'll still have an extra copy for each label a message has. Another possibility is to remove attachments from messages that you've already saved elsewhere. You can't set Mail to download only messages from a set time period, I'm afraid.
Thanks Joe, That's a helpful step. having read this i realize i don't really need the full archive of these accounts stored locally, in any event. Because Mac Mail's search function is so bad, I do most serious archival search on Gmail. A related question. For an existing account, set up conventionally on my Mac, If i now go and unselect 'Show in IMAP' for 'All Mail' at Gmail, will MacMail simply delete the cache of emails it has stored locally? or would i have to manually prune them if that's possible? or perhaps best to delete that account on my Mac, and rebuild it per your new, minimized rules? thanks for your consideration. it's a lifesaver. best, adam
If you hide All Mail in Gmail and then quit and reopen Mail, I believe the previously cached messages will go away (although it might take a while for those changes to sync). Deleting and re-adding the account would also work.
Many thanks Joe for this - the most helpful description of mail wrangling I've read anywhere. Some people may be interested to know that I had a Gmail account before IMAP was offered, so had a whole lot of mail from POP which I didn't want to download again. Using the method you describe, I found the "Sent Mail" label could not be removed from messages on the server - so all my sent mail was being downloaded again despite the fact that I already had these messages in archive folders on Mail.app. My solution was to create a new label "newSent" in Gmail setting, enable it for IMAP, and in Mail.app set that to being the "Sent" mailbox for the account. I also have a filter that tags any mail from me with the "newSent" label (not sure if this last is unnecessary). So far this has meant I have what I want, all my mail in Gmail and a single complete set of messages on my Mac as backup / local search archive. Thanks again for the excellent guide!
Joe, this has been really helpful. I'm one of those OCD people who doesn't want any trace of Gmail folders or sub-folders within Mail and your directions have worked for everything except for the Gmail sub-folder under Inbox. I can't seem to 'hide' that one. Any ideas?
Nope, can't be done as far as I know, sorry.
Thanks for the reply, Joe!
Thank you so much for this article. Was a HUGE help.
I switched my gmail account from POP to IMAP after reading about it in your Mail for IO6 book, but before reading this article. For the last 12 hours Mail has been downloading all of the messages from my gmail account. I can't get it to stop. What did I do wrong? I have unchecked the All Mail Show in IMAP box and have been deleting the messages from Mail but it just keeps downloading over and over. I also tried Archiving all of the Inbox on the Gmail website. I hope you can help.
Mail does download all your messages—that's what's supposed to happen. It keeps a local copy of all IMAP messages by default, which is usually what you want. If messages have multiple labels, meaning they're in multiple IMAP mailboxes, Mail downloads them more than once, even if All Mail is disabled.
If you have lots of messages this process can take a long time, but once everything has downloaded to your Mac, in the future it'll only download new messages.
In Mail you can choose Window > Activity to see exactly what's happening and get some idea of the progress. But, basically it sounds to me as though the right and expected thing is happening.
Thanks for the reassurance. It appears that gmail is downloading all of my deleted messages to the inbox so that I have to delete them again. Is this what should be happening?
You shouldn't have to delete messages again, no. Of course, I don't know what your Gmail and Mail settings are; I can conceive of a combination of settings that might lead to that behavior, but in general, that shouldn't happen.
Can you suggest what combination of setting that I might have that is causing the problem and how I might change them? I really appreciate your help.
Joe, I think I solved the problem. I just remembered that you said to restart Mail after making changes. I did that and the download of old emails stopped. Now I just have to clean up the duplicates. Thanks you for this article and you e-books.
Wow. Thanks SO much for this. I've been trying to figure this out for a long time. My only question now is "what about iCloud?" in Apple Mail. I'm not sure what and where that is and what I should do with it/how I should organize it.
Glad you found this helpful. As for iCloud, I wrote a whole book about it:
Take Control of iCloud - http://www.takecontrolbooks.com/icloud
Great, I'll buy it!. That link doesn't work, though.
Gah. The commenting system added the ) to the URL. Try again now.
How do I (or do I) move all the mails from "On My Mac" to gmail????
You can use drag and drop to copy messages, or even entire folders, from "On My Mac" to any IMAP server. Just drag them where you want them to go in Mail's sidebar. After you've confirmed that they've all been copied successfully, you can delete the "On My Mac" copies.
This article is simply awesome! Not only does it give specific step-by-step instructions how to do it, it also explains as much as possible what is going on behind the scenes of "Mail/Gmail IMAP" and why this is so difficult to configure intelligently. I had almost everything already right but now I understand much more about it and could also move many messages from "wrong" Sent, Drafts, Trash folders to the "right" ones and delete the wrong ones.
Thanks a lot!
I'm glad you found it helpful. But, I must warn everyone NOT to follow these instructions if you're using Mavericks! Full details here:
My days of Gmail bliss are over, but I regained it in another way. Here's my story at Macworld:
Dear sir I ave read all the above advice and comments and now in information overload!
I have just returned from 3 months visiting my family in Australia. My computer was placed out of commission for security reasons and my house was securely controlled. On my return I found that on connecting up my iMac all my emails has disappeared. The individual folders were still visible but the content was gone. I tried to contact gmail and Google without success. I them resorted to the web for information to discovered there were page full complaints about the same problem from masses of other people and none could get a response from gmail.
During my searched I read very good comments about Airmail. I wonder if I install Airmail can I recover my files from gmail via the airmail client.?
I am 74 and really need to recover my emails as my financial communications and contact with the Scottish parliament have all disappeared.
David W Edgar, C.Eng., MIET
Can ypu give a simple recovery?
I don't know exactly what the source of your problem is, so I can't give you great advice. (I will say that if you're using Mavericks, this article is totally outdated and should be ignored!)
However, if I were in your shoes, the first thing I'd do is log in to the Gmail Web site and make sure all my messages are there. If they are, then there's a way to get them into a Mac app (whether Mail or Airmail or whatever). If not, then no client software can help. And in any case, you can always read and reply to email on the Gmail site, without using a client at all.
Hello, Joe. Does your book offer a solution for setting up my Gmail over Exchange accounts, which stopped working in my new iPhone 5s?
No. Gmail no longer supports that (although devices previously set up to use it, before it was discontinued, should continue to work).