Use Gmail with Mail - Take Control of Apple Mail (1.0) (2014)

Take Control of Apple Mail (1.0) (2014)

Use Gmail with Mail

If you have a Gmail account and want to use it in Mail under Mavericks, this chapter is for you. (For information on using Gmail in iOS 7 Mail, see Set Up Gmail as a Regular IMAP Account.) I cover the ways Gmail in Mail differs from Gmail on the Web, the ways Gmail differs from other IMAP providers, how best to configure Mail to use a Gmail account, and how to avoid common problems. All of this, I hope, will help make your experience of using Gmail in Mail as good as it can be.

Note: Everything in this chapter applies equally to standard Gmail accounts and to Google Apps accounts with a custom domain name.

If you don’t use Gmail (or don’t want to use Mail to access Gmail), there’s nothing to see here. Move right ahead to Find Your Messages.

Understand How Mail Works (or Not) with Gmail

If you’re accustomed to Gmail’s Web interface, you may expect it to work similarly in Mail. On the other hand, if you’re used to using Mail with other IMAP accounts, you may expect Gmail accounts to behave the same way. In both cases, the reality will differ quite a bit from your expectation, and you’ll have an easier time using the combination of Mail and Gmail if you know more up front about how the two systems try (and sometimes fail) to work together. I’ll start by talking about the differences between the Gmail Web site and Gmail as it operates in Apple Mail, and then turn to Gmail vs. Other IMAP Providers.

Note: Although Mail can also access Gmail via POP, I recommend against it and don’t cover it in this book. Among other issues, with POP, Mail can’t see archived Gmail messages or messages you’ve sent from your Gmail account using the Web interface.

Gmail on the Web vs. Gmail in Mail

Gmail started as a Web-only email system; POP and IMAP access were tacked on later. As a result of its Web focus, Google designed Gmail to handle email in a fundamentally different way from conventional email servers. Although I don’t care for Gmail’s model, I understand why a lot of people prefer it—but unfortunately, it’s a way of looking at email that Mail can’t entirely replicate. Here are some of the key differences:

· Labels vs. mailboxes: On the Gmail Web site, you can apply descriptive labels to each message to help you find messages with particular labels later—but the Web interface has no mailboxes or folders. For example, your Inbox is simply a view that shows all messages with the Inbox label; any of those messages might also have one or more additional labels you’ve applied, such as Work and Project A. Mail, by contrast, follows the traditional model in which messages are filed rather than tagged; messages are treated more like discrete files, so a given message normally exists in only one mailbox. When you access Gmail with an IMAP client such as Mail, Gmail’s labels are translated into mailboxes. The result is that if a message has three labels on the Gmail Web site, it appears in three mailboxes in Mail.

Prior to Mavericks, Mail would download and store an extra copy of each message that has multiple labels. This is no longer the case in Mavericks. Instead, Mail now stores just one copy and invisibly tags it with the names of all the other mailboxes in which it should appear. That saves space and bandwidth, but there’s still no convenient way to apply multiple Gmail labels to a single message in Mail. (The inconvenient way is to hold down the Option key while dragging a message to each of several mailboxes.)

· Conversations: Gmail shows all the messages in a conversation—a related series of exchanges between you and one or more other people—together in a single “stack,” known as a thread, regardless of how you’ve labeled the individual messages. Mail can do something similar, as long as View > Organize by Conversation is checked for the currently selected mailbox, but Mail and Gmail have somewhat different ideas of what constitutes a conversation, so you may not see exactly the same set of messages in both places.

· Archiving: In Gmail, you can archive a message, which removes its Inbox label and thus removes the message from your Inbox (but doesn’t explicitly put it an another mailbox—remember, there aren’t any!). Archived messages, along with all your other messages, appear when you click the All Mail link on Gmail’s Web site, so the All Mail category serves as a giant storage area for all your stored (and sent) messages, even if you haven’t bothered to label them.

Prior to Mavericks, Mail didn’t work well with Gmail’s method of archiving; if you selected a message and chose Mail’s Archive command, it moved the message to a mailbox/label called Archive, which is not at all the same thing. Now, Mail handles archiving for Gmail accounts the way Gmail does, and displays a special mailbox for Gmail accounts (see Special Mailboxes) called Archive (All Mail), which should show you the same collection of messages you see when you click All Mail on the Gmail Web site. (Mail still uses a dedicated Archive mailbox for each non-Gmail account.)

Archive vs. Delete

Many Gmail users habitually click the Archive button in the Gmail Web interface when they’re done with a message, and have trained themselves to expect that “deleting” a message in this way doesn’t actually erase it or move it to the Trash but only removes it from the Inbox (leaving it in All Mail).

If you’re such a person—and you want to approximate this behavior in Mail by pressing Delete to archive—let me first say, please don’t. It’s a dangerous habit, because Mail thinks delete really means “delete” and you could end up losing mail, especially if you accidentally do this in a non-Gmail account. However, if you’re determined to make “deleting” Gmail messages in Mail archive them, try the free Delete2Archive plug-in, which causes Mail’s Delete key to simply remove the Inbox label for messages in Gmail accounts.

A better idea is to retrain yourself to use Mail’s Archive command (or its associated toolbar button or keyboard shortcut, Command-Control-A), which has the same effect and is much less risky.

· Special mailbox handling: Mail in Mavericks automatically uses the correct Gmail mailboxes for Drafts, Sent, Junk, and Trash, without the extra setup steps that were formerly required. However, as of 10.9.2, you’re free to choose different mailboxes to serve these purposes, and you can even opt not to store such messages on the server at all.

· Starred: Another “special” Gmail label, which appears as a mailbox when you use IMAP, is Starred. Gmail expects you to use the Starred label to indicate messages that are especially important. Mail doesn’t have stars, but it does have flags (Message > Flag >Color), which serve approximately the same purpose. So, a message that’s Starred in Gmail appears with a flag in Mail, and vice-versa—although Mail’s various flag colors don’t map to Gmail’s star colors; the most you can guarantee is that having some color of flag equates to having some color of star.

· Chats: If you use Gmail Chat, the transcripts of your conversations can optionally be saved to your Gmail account as messages with a Chats label. This shows up in Mail as a Chats mailbox in your Gmail account, which you may either appreciate or find incongruous, since it doesn’t actually contain email.

· Important: Gmail has yet another label, Important, that acts as a sort of reverse spam filter—it’s a way of automatically highlighting messages that Gmail thinks are especially important, so they’ll stand out in a crowded Inbox. Important messages can appear first in your Inbox on the Gmail Web site, and can be identified with a special marker icon. (To determine how Gmail treats “important” messages, log in to your Gmail account, choose Settings from the gear pop-up menu at the top of the page, and click Inbox.) Although Mail can display an Important mailbox under your Gmail account that contains all the messages labeled as Important, it doesn’t show the special markers or put important messages at the top of your Inbox.

· Priority Inbox: If you activate Gmail’s Priority Inbox feature, you can configure your Inbox to prioritize the display of incoming messages you consider most worthy of your immediate attention (such as Important, Unread, and/or Starred)—and to display only a limited number in each category. To turn this feature on, log in to your Gmail account, choose Settings from the gear pop-up menu at the top of the page, click Inbox, and choose Priority Inbox from the Inbox Type pop-up menu. In the Inbox Sections area, choose which items to show and in what order, and click Save Changes. (To turn off Priority Inbox, repeat these steps, but choose Classic—or any other option—from the Inbox Type pop-up menu.) Mail doesn’t display a Priority Inbox, so regardless of your settings here, Mail displays all messages in your Gmail Inbox, just as before.

· Categories: If you choose the default Inbox type (as opposed to Priority Inbox or some other arrangement that shows a certain type of message first), Gmail on the Web displays a series of labels called Categories that show you all the messages Gmail perceives as being Social, Promotions, Updates, or Forums. These labels serve useful purposes on the Gmail Web site, but they don’t appear in Mail.

Gmail vs. Other IMAP Providers

Now let’s turn the situation around and look at how Mail handles Gmail as compared to other IMAP providers. If you’re used to a conventional IMAP account, you’ll notice that Gmail behaves almost the same in Mail, with the following exceptions (all of which I’ve mentioned elsewhere in this book):

· As of 10.9.2, you can reorder most top-level mailboxes in your Gmail account, although not Gmail-only special mailboxes such as Important and Chats.

· Archiving Gmail messages removes the Inbox label, such that they’ll appear in All Mail on the Gmail Web site rather than having an Archive label. With other IMAP providers, arching a message moves it to the Archive mailbox.

· Drafts behave differently. When you compose a message in a regular IMAP account, Mail automatically saves a copy in your Drafts mailbox 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.

When you compose a message in your Gmail account, Mail still saves a draft every 30 seconds, and still deletes any previous draft. However, instead of previous drafts disappearing altogether, they 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 set up automatic Trash emptying (in Mail > Preferences > Accounts > Account Name > Mailbox Behaviors, choose anything other than Never from the Permanently Erase Deleted Messages When pop-up menu).

Set Up Mail to Use Gmail

Back in 2009, I wrote an article for TidBITS that turned out to be wildly popular: Achieving Email Bliss with IMAP, Gmail, and Apple Mail. It explained Gmail’s nonstandard way of dealing with IMAP and how that didn’t work well with the version of Mail in use at the time. Then it detailed 21 nitpicky steps one could follow to eliminate or work around most of those problems, achieving a workable compromise between Gmail’s way of doing things and Mail’s way. Based on the voluminous feedback I’ve received about that article (and about similar steps I included in several of my earlier books on Apple Mail), that procedure seems to have helped a lot of people.

When Mavericks was first released, Mail had some appalling bugs that made Gmail almost completely unusable for anyone who had followed those steps (which, remember, were previously the way to prevent misbehavior). In later updates, 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!

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.

Activate and Configure IMAP

Before you can set up a Gmail in Mail, you must make sure IMAP is enabled for the account and configured properly:

1. Log in to your Gmail account (using this link or whichever URL you normally use for a Google Apps account with a custom domain).

2. From the gear pop-up menu at the top of the page, choose Settings, and then click Forwarding and POP/IMAP.

3. In the IMAP Access section, make sure Enable IMAP is selected.

4. Leave all other settings unchanged. But, if you’ve previously changed any of the defaults, this is a good time to put them back:

§ Under “When I mark a message in IMAP as deleted,” make sure “Auto-Expunge on - Immediately update the server. (default)” is selected.

§ Under “Folder Size Limits,” make sure “Do not limit the number of messages in an IMAP folder (default)” is selected.

If you made any changes, click Save Changes, and then go to the Labels tab:

§ Make sure all the Show in IMAP checkboxes for All Mail, Sent Mail, Drafts, All Mail, Spam, and Trash are selected. (The rest are up to you.)

You can now set up Mail to access your account.

Note: There is a possible downside to unhiding those other Gmail labels (especially All Mail) from IMAP: if you use another Mac or PC email client to check your Gmail account, those mailboxes (and the duplicate messages that come with them) will appear in the other client. This is less of a worry on iOS devices, since they don’t download mailbox contents until you tap the mailbox name.

Add Your Gmail Account

To set up your Gmail account in Mail, follow these steps:

1. Go to Mail > Preferences > Accounts and click the plus button at the bottom left.

2. Select Google and click Continue.

3. Enter your name, your full Gmail address (whether that’s a gmail.com address or one with a custom domain via Google Apps), and your Gmail password.

4. Click Set Up.

5. In the list of apps that appears, leave Mail selected. You’ll also see checkboxes for Notes, Calendar, Messages, and Notes—although in some cases one or more of them may be dimmed. Check them to set up those additional services automatically, or uncheck them to restrict the setup to email. (Either way, you can always change these settings later in System Preferences > Internet Accounts.)

6. Click Done.

Mail sets up your account and begins downloading any mailboxes and messages already stored on Gmail’s servers.

External Addresses in Gmail

Gmail has a mechanism whereby you can authorize addresses from your other email accounts as valid From addresses when sending from Gmail.

To do this, follow these steps:

1. Log in to your Gmail account, choose Settings from the gear pop-up menu at the top of the page, and click the Accounts link.

2. Under “Send mail as,” click the Add Another Email Address You Own link, and follow the instructions to enter and verify another address. For each address, you can choose whether to send outgoing messages with Gmail’s SMTP server (less good, in my experience) or the one associated with the other account (better). You can repeat this with as many addresses as necessary.

Then, add those alternative addresses to Mail with the instructions in Configure Alternative From Addresses.

Avoid Gmail Problems

I certainly hope that Apple makes improvements to Mail that result in Gmail working better. Even if that happens, though, Gmail itself is unlikely to change much, and that means some aspects of the way it works via IMAP could be problems for some time to come. Short of switching away from Gmail (see the sidebar Should You Give Up Gmail? ahead) or using Gmail’s Web interface instead of an email client like Mail, there are a few steps you can take to avoid or work around common problems:

· Stick with default settings. As previously discussed, Gmail works best with Mavericks Mail when you leave everything at its default—such as not hiding the All Mail label, as was once a good idea.

· Be patient on your initial sync. The first time you set up your Gmail account in Mail, it must download all your messages, and if you have several gigabytes worth of saved Gmail, that process might go on for days. During that time, Mail might be sluggish, new messages may not appear promptly, and mailboxes may appear to be empty even though they contain lots of messages when viewed on the Gmail Web site.

There’s nothing you can do here but wait—but once that initial synchronization is done, things will go much faster. (You can keep track of Mail’s progress by choosing Window > Activity.)

· Limit concurrent logins. Gmail permits 15 simultaneous IMAP connections for each account. That sounds like a lot, but a single copy of Mail uses up several of those at once (in an effort to be more efficient). If you log in to the same Gmail account on a couple of computers and a couple of iOS devices, you can quickly chew up all of those allowed connections, after which one or more of your devices will stop connecting and start giving you error messages. So, try to reduce the number of devices logged in to your Gmail account at once—especially Macs running Mail.

· Do the two-step. If you’ve enabled Google’s optional Two-Step Verification for extra security when logging in to Gmail (an excellent idea, by the way), simply entering your normal Gmail password when setting up Mail isn’t sufficient; you must generate a special one-time password and enter that.

To learn more about the process generally, read Lex Friedman’s Macworld article How to configure Google’s two-step authentication; for detailed instructions from Google about configuring Apple Mail to use two-step authentication, read Sign in using application-specific passwords.

· If all else fails, start over. If your Gmail account is acting wonky in Mail—especially if you’ve just upgraded to Mavericks from an older version of Mac OS X—it often helps to delete your Gmail account (in System Preferences > Internet Accounts) and then add it back from scratch.

It’ll take a while for your messages to download again, but this process does wipe out a number of odd gremlins. (You shouldn’t lose any messages during this process: Any mail still in Gmail will be re-downloaded, and if you’ve filed any Gmail messages into local mailboxes, those messages will be untouched.)

Should You Give Up Gmail?

If you’re unhappy with the way Mail works (or doesn’t) with Gmail, you might entertain the notion of dropping Gmail and switching to a different, more conventional IMAP provider. That’s what I did, and I found it solved a number of problems for me besides misbehaving Mavericks Mail. You can read about my decision in Why (and how) I’m saying goodbye to Gmail.