Setting up Mac Mail and iPhone for Google mail

I recently had to set up Mac Mail for our company’s Google Apps account (although the same thing likely happens with GMail.) I was seeing strange behaviour which I eventually figured out was due to the weirdness of IMAP and how Google treats labels as folders.

  • deleting a message in Mail would just tag it with a Deleted Items label on the server; it never disappeared from the All Mail folder.
  • Sent messages were tagged with a Sent Messages label and didn’t show up when I went to the Sent Items folder
  • An [Imap]/Drafts label was cluttering things up in Google’s webmail

I pretty quickly figured out that it was just a problem of Mail not knowing what folders on the IMAP server were to be used for a specific function. But it took me a few days to figure out how to give Mail that information.

In Mail, open the [GMail] folder and select the Trash (Bin, Deleted items, etc) mailbox. Once it’s open, go to the Mailbox menu, select Use This Mailbox For, and choose Trash. Repeat this process for [GMail]/Sent Items, [GMail]/Spam, and [GMail]/Drafts. Now you can use the webmail interface to delete the Deleted Items, Sent Messages, and [Imap]/Drafts labels.

A similar problem happens with iPhone when using Exchange ActiveSync instead of IMAP. When you use IMAP, you have an option in your account settings to use Archive or Delete. But with ActiveSync, all deleted messages are archived by default, and stay in the All Mail folder. You can change this behaviour by visiting http://m.google.com/sync where you can change a few settings for each mobile device using ActiveSync, including Delete Email As Trash.