I’ve found over time that a good tip for using gmail with Apple Mail is to use an IMAP prefix. This lets you control exactly what appears in Apple Mail (especially if you have a lot of gmail labels).
The first thing to do is to specify a prefix in Apple Mail:
Mail > Preferences Select Accounts, choose your gmail IMAP account and then select Advanced.
Enter a value into the field IMAP Path Prefix. I use the prefix IMAP, but this can be anything you want.
Now if you want to use a gmail label as a folder in Apple Mail, open your browser and go to the gmail web interface. In the gmail interface, you want to create labels that start with your prefix. Start by clicking Create new label, you might need to click on more to show the link depending on how many labels you already have. Start with the prefix you chose above, then a slash, and then add a name. I’ve got a couple of “auto filter” labels, one for DM’s and subscription notifications from Twitter that I don’t want in my inbox, so I’ve created a special “twitter” label to associate with this filter.
The effect of doing this is that all of the “normal” labels from gmail like “[Gmail]” and “All Mail” won’t appear in Apple Mail. Only the “inbox” and labels that start with your prefix will be picked up by Apple Mail. I’ve found this improves the performance of Apple Mail when fewer labels/folders need to be synchronized. Also if you follow the new official Gmail IMAP + Apple Mail client settings instructions, all the labels you’re not using like “Sent” and “Trash” won’t clutter up your interface.
One of my goals with using IMAP prefixes was to keep my local Apple Mail database small. Before using this tip, some of my Apple Mail mailboxes were extremely large (even after optimizing the database/mailboxes). This made spotlight and Mail sluggish, unresponsive at times and often led to Mail crashing. Keeping only the inbox and a few select labels synchronized has cleared up most of my Mail problems.
One side effect of this, though, is that to search your email archive you’ll need to use the gmail web interface. Depending on how often you have set Apple Mail to clear out it’s local Send and Trash mailboxes, you will only be able to search relatively recent messages from Apple Mail. Anything older (again depending on how often you clear out Trash, Sent, etc…) can only be found from the gmail web interface. This fits my workflow because I find that gmail’s search interface is generally superior for larger numbers of messages.
The only minor drawback I’ve found is that it becomes trickier to synchronize drafts between the web interface and Apple Mail. I have an IMAP/drafts label associated with the Apple Mail drafts mailbox, but when you save a Draft in the gmail web interface it automatically gets gmail’s system label “draft”, which then gets filtered out of Apple Mail. I don’t often switch between interfaces with messages “in progress”, so I haven’t found this to be too much of a problem.
This tip also assumes you’re using the recommended client settings which suggest not storing Mail’s Trash, Sent, or Junk mailboxes on the server. If you’re not following those suggestions, you may see Apple Mail creating labels in gmail as it stores things under the IMAP prefix. I recommend following the recommended client config instructions, as there’s no real benefit to syncing/storing those Apple Mail folders into gmail.
It’s a small tip, but I appreciate the greater stability, performance improvements and cleaner folder interface. Also if you sync your settings with the iPhone, the label mappings and prefix will automatically apply there as well.