How-to: Proper Gmail IMAP for iPhone & Apple Mail

  • October 24th, 2007

UPDATE 03/28: Check out this Mail plugin which adds email archive support to Apple Mail.

UPDATE 11/18: inaequitas reminds us that in order to star messages on your iPhone, simply move the message the starred items directory.

UPDATE 10/26: RayL re-confirms the advantage of mapping your client-side Sent, Drafts, & Trash with server-side Gmail labels – no duplicate labels created in Gmail by your email client(s). Experiment with Gmail IMAP setup; if necessary reference the Google Group thread below.

UPDATE 10/25: If you start seeing duplicates, check this Google Group thread. Google may have made updates to Gmail IMAP access. YMMV.

The latest news on the street is that Google is slowly rolling out a much anticipated feature – IMAP support. If you point your browser to Gmail Help documentation outlining the steps necessary to get your mail clients setup for IMAP, you’ll soon realize the the directions are the bare minimum. It is recommended that you follow the directions from start to finish, but the actual configuration does not stop there.

Take a look at both IMAP support pages for Apple Mail and the iPhone. Both share similar steps including:

  • Incoming Server:
  • Outgoing Server:
  • Authentication: + email password
  • ‘Use secure Socket Layer (SSL)’
  • Ports: 587 Outgoing, 993 Incoming

There is nothing wrong with leaving your email clients as-is exactly as the Gmail Help documents instruct. Unfortunately, you will start to see a little inconsistency between your email clients and your Gmail web interface.

Diligent Gmail “labelers” will soon discover that those handy “tags” that they had been assigning to emails are now recognized as Folders in their email client(s). Your email clients will sync this Folders without a problem. In order to ensure your Trashed, Sent, Drafts, and Junk mail messages are sorted properly between your iPhone, Apple Mail, and Gmail’s webmail interface, you will need to add a few more steps to the initial setup instructions offered by Google.

Properly sort Drafts, Deleted, and Sent mail on the iPhone

Assuming that you have followed the iPhone IMAP setup instructions, it is now time to properly configure your mobile Mail client so that Sent Mail, Deleted Mail, Drafts, and Junk are reflected properly after syncing back between the webmail client and any other desktop clients you may have.

  1. Open ‘Settings’ > ‘Mail’ > [Your Gmail IMAP account] > ‘Advanced’
  2. Select ‘Drafts Mailbox’ > ‘On the Server’ > ‘[Gmail] Drafts’. Return to the ‘Advanced’ view.
  3. Select ‘Sent Mailbox’ > ‘On the Server’ > ‘[Gmail] Sent Mail’. Return to the ‘Advanced’ view.
  4. Select ‘Deleted Mailbox’ > ‘On the Server’ > ‘[Gmail] Trash’. Return to the ‘Advanced’ view.

Any emails sent from your iPhone will appear in Gmail’s ‘Sent’ view, any saved drafts saved on your iPhone will appear in Gmail’s ‘Drafts’ view, and any deleted messages will be reflected in Gmail’s ‘Trash’ view.

Properly sort Drafts, Deleted, and Sent mail in Apple Mail

Similar steps must be taken to ensure that any emails sent, saved as drafts, or deleted are properly identified by Gmail’s servers. After completing the IMAP setup steps for Apple Mail, instructing Mail is a few simple clicks away. Once your Gmail IMAP account is added to Mail, you’ll notice your [Gmail account] in the left sidebar.

  1. Highlight ‘[Gmail] Sent Mail’ in the sidebar and select ‘Mailbox’ (menu bar) > ‘Use This Mailbox For’ > ‘Sent’.
  2. Highlight ‘[Gmail] Drafts’ in the sidebar and select ‘Mailbox’ (menu bar) > ‘Use This Mailbox For’ > ‘Drafts’
  3. Highlight ‘[Gmail] Trash’ in the sidebar and select ‘Mailbox’ (menu bar) > ‘Use This Mailbox For’ > ‘Trash’
  4. Highlight ‘[Gmail] Spam’ in the sidebar and select ‘Mailbox’ (menu bar) > ‘Use This Mailbox For’ > ‘Junk’

Once properly configured, managing email from Apple Mail or the iPhone will be no different from managing emails within the Gmail web client – sent, drafts, trash, and junk properly sorted between your various email clients and web interface. [Digg this]

IMAP Gmail gems for Apple Mail & iPhone

I am certain that Gmail’s IMAP documentation is far from complete. The following will serve as a running list of details I have noticed – found by sharp readers or myself – not yet included in the Help pages.

  • Flagging messages in Apple Mail (CMD+SHIFT+L) is the same as adding a Star to a message in Gmail. Try it out for yourself. Flag a message in Mail and check your Gmail account online. The same message magically appears as ‘Starred’.
  • In order to “label” messages multiple times from within Apple Mail or the iPhone, you must copy the message(s) to each respective ‘Folder’ which corresponds with your Gmail Label. I think it’s time to move back to the idea of Folders as opposed to Labels.
  • If you wish to Archive mail from your iPhone, simply move the message to ‘[Gmail] All Mail’.
  • gec added this comment: “when you delete something from a folder other than trash, the message will effectively be archived, and not deleted. that means, the label corresponding to the folder you are deleting it from will be removed. if however you *move* it to Trash you will remove all labels assigned to it. bad for filter rules.”
  • Jonathan added this tip: “if you’d like to use a custom from address when sending from iPhone (not your Gmail address) just pop it in the Email Address field (not the authentication fields) and it will use that address instead of your Gmail.”
  • Want to send mail as a different email address on a case-by-case basis with Apple Mail? Follow the directions outlined in this comment. YMMV
  • MSK added: “if you want to get rid of that extra [Gmail] hierarchy. Go in to your advanced email settings and for ‘IMAP Path Prefix’ type [Gmail] now go back and reassign your Sent, Deleted, and Draft mail boxes, if needed.”

Similar rules apply for any other IMAP desktop or mobile client that you might be using. In order to prevent unnecessary labels from being created during synchronization, make sure that your Sent, Drafts, Junk, and Trash Mailboxes are configured properly.