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

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.

Discuss - 516 Comments

  1. Joshua says:

    Thanks for the great information. So does this mean that when I check mail on my iPhone and either keep it or delete it, will it now be deleted from my gmail server account and apple mail. I’m tired of checking mail on my iPhone then having to check the same messages ad delete the same messages off my Mac.

    • Derek says:

      Correct. When you read email on your phone, the messages are marked as read in Gmail or Apple Mail. If a message is moved to the trash, it will be moved to the trash in Gmail and Apple Mail.

  2. Satyajeet says:

    Why does my IPhone 3 G S show old messages instead the newest ones on top of the list?
    Im using google apps and my own domain ( its like a gmail webmail interface for your own domain)

  3. Matt says:

    Thanks for the awesome tips! Is there a way to get it to show on my iPhone that I have responded if I have via gmail on my laptop? In other words, I just want there to be a reply arrow next to the email on my iPhone. Seems kind of nit-picky but it’s starting to drive me crazy!!!!!


  4. Matt says:

    As a quick follow up to my post above, if I forward a message on my laptop it will show on my iPhone, just not the replies!!!

    Thanks again!

  5. atrizu says:

    Unfortunately, setting the correct Drafts and Deleted mailboxes is not an option when using Google Apps as your iPhone’s exchange account. This is out of Google’s control, but it would be nice if Google could give us a setting to automatically remove labels such as “Sent Messages”.

  6. Tricky says:

    Really, really useful – thanks!!

  7. […] Google does not explain how to make the Inbox, Draft, Sent and Trash Mailboxes in Mail act as one — or at least not where I saw in the instructions. For that part, I followed the advice found at 5ThirtyOne by Derek Punsalen. Thanks Derek! Here is an excerpt from his instructions: Properly sort Drafts, Deleted, and Sent mail in Apple Mail […]

  8. […] a little harder to come by. That is, until Google recently added the long-awaited much-anticipated support for IMAP to their Gmail […]

  9. kate says:

    Is anyone else having issues with using Gmail’s Spam folder as the Junk Mailbox? i followed the steps above, to properly sort drafts and trash and such, but the Gmail spam folder won’t budge. I have tried to “use this mailbox for>junk” 50 times and the folder stays put under the Gmail heading. Any suggestions? Thanks!!

    • Chris says:

      Kate, I was having this problem too, and discovered it was because I had the “mark as junk mail, but leave it in my inbox” setting checked under Junk Mail preferences. I changed the setting to “move it to the junk mailbox” and the Gmail spam folder magically moved! Hope that helps.

    • kate says:


      thanks for the tip! looks like that did it, finally!

  10. Mark says:


    I am trying to set up my business email account on Mail [4.2]. It is setup through, however the mail address is …any hints on how to get this set up for incoming and outgoing email? (I tried, and also, no luck) thanks so much!

    • Diane says:

      Hi Mark,

      Did you ever figure this out? I would like to be able to send mail from another client in Apple Mail and on my iPhone without receiving all my mail twice!

  11. Michelle says:

    I had a hard time finding the hidden files so I downloaded a widget that shows the hidden files. Then I went into my user’s hard drive, library, mail, and chose the mailbox i was having problems with and then saw the cache so I could delete it!

    Here’s the link to the widget, I felt good about d/ling it since it was on apple’s website. 🙂

  12. Blake Nolan says:

    The issue I’m having is that I used to use Apple Mail with POP servers. I would delete items out of my inbox in order to keep it clear, and organized, and I would never empty my Trash. This allowed me to search through the trash, effectively keeping every message archived.

    I now have all my emails running through gmail, and I use Gmails IMAP with Apple mail. Now, I realize that Gmail has the “acrhive” feature on the web based version, but I can’t seem to find an easy way to archive messages in Apple Mail. When I press the delete button, the message is moved to the trash, and removed permanently within a months time.

    I want to find an easy way to archive message with Mail. Deleting the messages isn’t working for me, but I want to easily get them out of my inbox. Is there a shortcut key to archive messages in Apple Mail? Or some other solution that I’m missing?



  13. Joel says:

    I have the new iPhone4. I have a Gmail account. As far as I can tell I have everything set up right. However, I am experiencing one, annoying problem. If I receive and check a message on my phone that would normally be filtered to a folder via MacMail rules on my desktop, that message does not get filtered on the desktop.

    I receive a message from a client on my desktop. That message goes to the “client” folder.
    I receive the same message on my iphone, and read it. That message remains in my inbox on the desktop. I have to drag it to the client folder manually.

    This only happens when I READ the mail on the phone. But what’s the point of having email on your phone if you don’t read it?

    Any ideas?

    • Derek says:

      Maybe your desktop rules only filter new mail. Because your device does not have filtering, accessing your email away from your desktop interrupts the filtering rules on your desktop. I recommend you create your filters through Gmail (rather than your desktop client), and allow the filtering to happen remote so that your rules are respected on both your desktop and mobile device.

      This is something I do whenever I want to create a new filter / rule. Mail rules are limited to your desktop. Gmail filters affect how mail is handled on any device used to access your messages. Make sense?

  14. Joel says:

    That does make sense. I will have to set aside the time to create the filters and rules in Gmail. Previous to purchasing the iPhone, I did not have a means of checking my email with a mobil device. I have several email addresses that I keep track of via Mail. I was hoping there was a way to sync those folders etc with the iPhone.

    The majority of my mail now goes through Gmail anyway, so this isn’t a hard fix.

    Much appreciated!


  15. Joel says:

    Hey Derek. I took the time to set up the filters on my Gmail account, rather than depending on my desktop MacMail client. Nothing changed. When I read a message on my iPhone it remains in my normal Inbox in the desktop mail client, and does not get filted (labelled) and moved to the appropriate folder…

    • Derek says:

      Everything should filter server side (Gmail). If you setup your Gmail account in Apple Mail via IMAP, it should reflect the same filtering / sorting that you see in Gmail. When you access email from the Gmail web client, are messages sorted correctly?

  16. Joel says:

    I know everything “should” filter, but it’s not when used in conjunction with the iPhone.

    Gmail in Apple Mail is set up as IMAP. Yes.

    Accessing Gmail via web client (rare) from what I can tell the email is sorted properly. But that could be a result of me moving things in MacMail and Gmail updating. Though I’m 99% sure that the Gmail web client works fine.

  17. Joel says:

    I just checked to make sure, but yes Gmail accounts are set up as IMAP online as well as on MBPRO and iPhone.

    Thanks for the help anyway!

  18. shane says:

    I’m getting the dreaded “server not responding” message. I’ve tried configuring it a hundred different ways including the above way. Anyone have any ideas.

  19. Stephane says:

    Hi guys,

    I’ve another problem for the community:
    I’ve moved recently from South Africa to DR Congo… Yep that’s a change!
    I’ve an iPhone 4 fitted with a micro-sim from Vodacom Congo (I was with Vodacom in South Africa as well).
    I’ve modified the APN with the one used by Vodacom Congo. That allows me to browse the web and send e-mail… BUT the problem is that I do not receive any e-mails!!! I suppose the problem lays in the SSL settings or simply the usage of SSL.

    Does anyone of you has a clue? Can a country or a company prevent the usage of SSL for easier eavesdrop? What can be the problem on their side/my side?… Of course, you can imagine that it’s quite impossible here to get a Vodacom technician with enough knowledge to pinpoint the problem and give me a clear answer.

    Thanks in advance for your advices,


  20. jim says:

    hey everyone.

    i am using iphone 4 from verzion i would like to know if some1 knows how to keep my e-mail over gmail server if i delete them from my phone.. any help would be appreciated