I am a BIG fan of Google’s Gmail service. It has the best webmail interface by far and offers nearly unlimited storage. Now that Gmail allows IMAP access I am using it as my primary email service via Apple’s Mail.app. I’ve configured Gmail to check all of my other email addresses via POP3. This is not only convenient since I have access to all of my email in one location, but it also reduces the amount of spam I see since the Google spam filter is very good. Note that you will need to maintain a list of contacts in Gmail to prevent real mail from being accidently labeled as spam. I use A to G.app to import my Apple Address Book contacts into my Gmail contact list. Continue reading to learn about the ideal settings for using Mail.app with Gmail via IMAP.
If you aren’t familiar with the POP3 and IMAP protocols, read this.
Enable IMAP Access
Before we begin you will need to enable IMAP access from inside your Gmail Settings ⇒ Forwading and POP/IMAP panel.

Setup Gmail IMAP in Apple Mail
Follow these instructions to configure Apple Mail.app to access Gmail. In short, your settings should look something like the following.
- Incoming server: imap.gmail.com
- Outgoing server: smtp.gmail.com
- Authentication: USERNAME@gmail.com + USERNAME’s password
- Check ‘use secure socket layer (SSL)’
- Use ports 587 for outgoing and 993 for incoming
Create New Labels in Gmail
Within Gmail’s web interface, create the following labels (keep in mind that Mail.app views labels as folders):
IMAP/SentIMAP/Trash
Modify Apple Mail Settings
Now open Mail.app Preferences ⇒ Accounts ⇒ Mailbox Behaviors, and confirm these settings:
- Uncheck the ‘Store draft messages on the server’ box
- Check the ‘Store sent messages on the server’ box (I’m using NEVER as my deletion interval)
- Uncheck the ‘Store junk messages on the server’ box
- Check the ‘Move deleted messages to the Trash mailbox’ box
- Check the ‘Store deleted messages on the server’ box (I’m using ONE WEEK as my deletion interval)

Assign IMAP Folders
Then under the Advanced tab section, set the IMAP Path Prefix to IMAP. Now assign the new folders as the Sent and Trash mailboxes.
- Select the
IMAP/Sentfolder in the sidebar and in the Mail.app menubar select Mailbox ⇒ Use This Mailbox For ⇒ Sent. - Select the
IMAP/Trashfolder in the sidebar and in the Mail.app menubar select Mailbox ⇒ Use This Mailbox For ⇒ Trash.
Flagging Messages
Flagging messages in Mail.app (CMD+SHIFT+L) is the same as adding a Star to a message in Gmail. If you flag a message in Mail.app it will show up as starred in the Gmail interface and vice versa.
Question for the Readers
Does anyone know how to prevent Mail.app from creating the ‘Apple Mail To Do’ folder on a IMAP server? I’d prefer to keep my ToDos locally but when I delete the label on Gmail it eventually reappears.
Leave me a comment if you know of a good Gmail tip that I haven’t mentioned.
[via macosxhints.com and 5thirtyOne]
