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: imap.gmail.com
  • Outgoing Server: smtp.gmail.com
  • Authentication: email@gmail.com + 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. Paul says:

    hi, I have a new Verizon iPhone4 and I forward my email from @mydomain.com to a gmail account, because of it’s push feature, superior spam control and webmail access. what I’m trying to do is:

    1. RECEIVE my mail at me@gmail.com

    2 yet SEND mail at me@mydomain.com (WITHOUT all the doubled email coming IN from the mydomain.com account, since I’m already getting that (pushed, de-spamified) email from my gmail acct.

    any brilliant thoughts? if you could solve this you would be helping MANY people.

    THANKS!
    paul

    • Brett says:

      I simply have all email forwarded to gmail with my own domain name, and for sending, I use my own domain for sending, like mail.mydomain.com on my shared hosting account (cpanel), just using the standard login/pass for outgoing. I also configured gmail to use this server as well, so gmail isn’t really visible anywhere, and I don’t have the limits of Google Apps… I’m definitely in email nirvana now.

    • Derek says:

      Unfortunately, if you setup Gmail Push on your iPhone you will not be able to add me@mydomain.com as a from: address. In order to add a separate from: address to use on your iPhone, you need to manually add Gmail as an IMAP account (do not select Gmail when setting up the account – select other). Once you have successfully created the account, go back into the account settings and add your alternate address for the ‘Address’ field. It should read something like:

      youremail@gmail.com, me@mydomain.com

      Note the comma separating the addresses.

      Even after you have added your personal from: address, you still need to make a conscious effort to ensure the mail client actually uses the from address. It’s a big headache to be honest. My recommendation would be to setup a free Google Apps for me@mydomain.com. This way you get rid of having to forward to a @gmail account AND you can setup Gmail Push while ensuring all of your mail is sent out as me@mydomain.com.

    • Paul says:

      hey Derek, I’m intrigued by your solution and would love to try it. unfortunately, I can’t figure out how to connect my GoogleApps account w my iPhone email…

      can you get me started in the right direction?

      thanks!!!

    • Peter Baumgarten says:

      If you add both email accounts to your iPhone you can select which email account you want to send from when replying to a message or composing a message. All someone needs to do is before sending the message just tap the from field, (once to expand it and then one more time to bring up a choice) then select which email address you want to send from. There is also a setting in Mail, Contacts, and Calendars to select the default email account to send from. Hope this helps, one year later.

  2. Jg says:

    I have the same question.

  3. Alexander says:

    I just found the golden solution to this problem: http://stl.techinno.nl/archive/

  4. freakqnc says:

    Something that has never been covered is that checking gmail account on 2 or more computers they will be out of sync… consider the following:

    Say you read your IMAP-conigured GMAIL mail on your mac at home using Apple Mail and imagine you received 3 emails to which you also replied.

    Now you go to work and use another mac with Apple Mail to access the same IMAP-conigured GMAIL mail.

    Well what you will notice is that in your inbox those 3 most recent emails you received are not there, nor are the replies you sent from home. Therefore it’s all out of sync! Since the accounts on all different macs are configured to work via IMAP I’d assume they should be in sync and all emai received should be present on ALL the macs that access the gmail account, no matter where it was first accessed after new emails arrived, or where a reply was sent from!

    I would not be surprised if it was all out of sync when using POP to access the email account, but the gmail address I am using across several macs it’s configured with IMAP so something is not right here!

    This is getting extremely frustrating and I’d appreciated if anyone has found a solution to it… and no… using gmail webmail interface is not an option (though that’s the only one i would have right now).

    Thanks in advance for your time everyone!

    Cheers!

    • TheMacMommy says:

      I believe, and someone please correct me, but I don’t think POP can be part of the process at all if all mail is to sync across multiple Macs or iDevices. All Mail clients on all devices and Macs must be set up to send/receive/draft Mail using IMAP. I think, just because you have it set to IMAP in your Google Account Gmail Settings does not mean that if the *client* is accessing it via POP it will still work. The Gmail server end plus the client end all need to be IMAP.

      I’m sorry if I’ve misunderstood your question, but when you mentioned POP, that’s what seemed out of place to me.

      I really hope that helps you out. All I can say is I’m using IMAP on all my Macs and iDevices and haven’t had syncing issues like you described. No where am I using POP so I thought that might applicable.

      Best of luck!!

  5. freakqnc says:

    Hi Mac Mommy and thanks for your reply, Like U said I know POP would not allow sync because it’s just pulling copies locally and (is so specified in account settings) will delete copies of the mail on the server…that’s why I said:

    “I would not be surprised if it was all out of sync when using POP to access the email account”

    I mentioned POP to reinforce the fact that is even more odd that the email account is out of sync across different macs because as I continued writing:

    “the gmail address I am using across several macs it’s configured with IMAP so something is not right here!”

    So there you go… I am using ONLY IMAP… no POP at all and still have problems where my account is not showing the same content across different computers with the same settings in Apple Mail.
    I am glad you got all working fine… though that does not help me much :P Thanks anyway for pitching in, much appreiated :D

    Cheers!

    • lesco says:

      I also have the same issues of read mail, sent mail, etc. not synchronizing across my two macs and iphone using imap (or pop for that matter).

      If someone has the solution, I’d be grateful to hear about it.

  6. Yves says:

    Thank you so much! I’ve been annoyed by Gmails Trash behaviour for a long time now, and I am amazed how easy the solution is (“Use this mailbox as trash”), and that I didn’t discover it myself, and that NOBODY else could explain this so concisely… you saved my day!

  7. Mara says:

    Has anyone figured out yet, how to star an email on the iPhone/iPod, without removing it from your inbox?

    You CAN star a message by moving it into the “starred” folder, however this removes it from my inbox…
    - is there a copy (instead of move) function perhaps?
    - is there a way to see the difference between starred and non-starred messages in your inbox (I already have several filters so some are stared in eg. webbrowser etc…)

    I also use hotmail, which also has “flags”….cant seem to use those either on iPod…
    I’m using Imap (I think, there was an auto setup on iPod 4G) for Gmail, and Exchange for Hotmail.

  8. Jim o West says:

    HELP!

    Sorry for asking a newbie question!

    I recently switched my Apple Mail 4 from accessing my Gmail via POp to IMAP. understand imap and how it works with lables and sync and all that. Used it for years in the early 90′s on Outlook. But i can’t figure out something important!

    Where is my INBOX??

    I now have to go to the IMAP/Gmail section of apple mail and There is no Inbox lable, and thus no Inbox folder. So I have to go to my All Mail folder, but then everything I filed away is still in my face!

    What would be a even added bonus is to have my gmail website inbox item in the real Apple Mail inbox.

    HELP!

    • Luke says:

      I’m having the same problem with having my Gmail inbox show up in Apple Mail. Has anyone found a way to make this happen?

      Also, is it better to use the Gmail folders on the side of mail, or to use the Apple Mail folders?

      Thanks!

  9. Jim o West says:

    Anouther question. The IMAP “gmail labs” extention. Does that offer any fixes or new features to the problems mentioned above?

  10. Kyle Webs says:

    Hello, I had a question and was wondering if you could please help?

    When I delete a message in Apple Mail, it doesn’t delete the message in Gmail. How can I fix this? Because I’ll delete the message, and then a minute later it refreshes and the message I wanted to delete from Gmail has synced back in to Apple Mail. So I have to actually go in to Gmail to delete emails, which is stupid. Any help on changing this?

  11. Mac_Security says:

    SMS Incoming Mail Notifications – Instead of Push.

    First, lets consider that “Push” mainly serves the purpose to notify you of incoming email, but keeping Push active on your phone drains your batteries – kind of fast.

    “Fetch” doesn’t drain your batteries as “push” does, but still, any active background process on your iPhone drains your batteries.

    Incoming email SMS notifications seems to be – for me – the very best option. Practically all Mobile Phone companies provides its user with an email address in the form of “YourMobilePhoneNumber@YourMobilePhoneCompany.com” and this email address serves two purposes – It allows you to send an SMS to any email address as well as to receive an email in the form of a text message – SMS. But you can also use it to forward your incoming emails from Gmail, Yahoo, Hotmail, and any other email system which allows you to forward email to another email address.

    But the real beauty of SMS notifications is that it arrives in just a few seconds and it doesn’t drain your battery as “Push” or even “Fetch” and to Receive SMS doesn’t cost a cent (just when sending you pay) Not to mention there is no need to configure IMAP, POP, and SMTP settings – If you decide to use the Superb Gmail Mobile Interface for Safari on iPhone – which is a Web App specially designed by Google to have all the features of Gmail on Mobile Phones – Preserving all the Goodies of Gmail on the Web – such as Labels, Folders, Filters, Contacts, Tasks and so on. In other words; There is no better way to enjoy Gmail than through its Web Interface – Whatever is on your computer or Mobile device.

    Once you receive the SMS notification you can see from whom it is and to which of your bast email address it was send – So you only have to click on the Google App for iPhone and Presto! Its even faster than any Exchange, MobileMe or any other “Push” or “Fetch” email I have try. And, You can usually use all the Battery power you save to actually composing and replying to your email – instead of carrying your battery charger.

    Another Good thing of Incoming Email SMS Notifications – In comparison to IMAP or POP – is that you can use Gmail’s Two Step Verification (better known as Two Factor Authentication or OTP Authentication). In other words: You Can’t use Gmail’s Two Step Verification if using IMAP or POP – because using any of these two protocols requires an “Application Password”

    About Password stuff on iPhones – If you use the Mail App (aka IMAP / POP) your email password is stored so you don’t need to re-type it again every time it syncs with the email server, but newer versions of Safari Mobile has an Auto-login function – So you don’t need to re-enter your login password as well. You will only need to enter the Two Step Verification Code sent to you by Google Two Step Verification through SMS – But actually this “mini extra step” is a Good which double protects your email account.

    By the way; When using Gmail’s Two Step Verification you can decide to receive your OTP codes via SMS, through a Phone call, or the code can be generated locally via the Free Google Authenticator App – for iPhone and Android devices. There is also some Good Password Apps for the iPhone that will log you in automatically to your Gmail account via their own adapted version of Safari for Mobile. Some really good and free password apps for iPhone are Wallet, pwSafe, DataInherit, IDBox and SafeWallet, and good paid ones are DataVault and eWallet and eWallet Go.

    Now, it will be Fantastic if the Good Folks at Google Security will incorporate Incoming Gmail SMS Notifications Directly from Gmail Severs – Delivered to Mobile Phones via SMS – So, there will not be a need to use Forwarding to email addresses provided by Mobile Phone Companies. I believe this wouldn’t be to hard to accomplish since Google is already providing SMS Notifications for it’s Gmail Two Step Verification.

    Yours Truly,

    Mac_Security

  12. Rei says:

    Mac_Security you are absolutely wrong. Push do not notify you of anything, you have no idea how this thing working. And push notifications doesn’t drain battery at all. Push was invented with thoughts to save batter in first place.

  13. Graemezee says:

    I am redirecting my email to my gmail account. I have set up a post account on my server which allows me to send from my domain from with in Gmail this works perfectly all the benefits of Gmail with my own domain name.

    With Apple mail set up with my google account using imap. to get the same effect I have to send my out going mail directly to my domain server. if I send via smtp.gmail recipients of my emails get notified that the email was sent via gmail on behalf of my domain.

    While my setup works very well the only issue I have, is that mail sent from my Apple Mail client or iPhone does not appear in sent mail in google can any one suggest away of getting copies of sent mail to appear in the gmail sent mail folder

    Graeme

  14. kenk3n says:

    I cant get Gmail on Iphone 4s. I have tried enabling IMAP on Gmail setting.. Outgoing server is correct.
    It says imap.gmail.com is not enabled on my phone. Please help me.
    Thanks

  15. I cant get Gmail on Iphone 4s. I have tried enabling IMAP on Gmail setting.. Outgoing server is correct.
    It says imap.gmail.com is not enabled on my phone. Please help me.
    Thanks
    Reply

  16. warren says:

    I have my gmail account for a number of years now. With my upgrade to an Iphone 4 i have a problem receiving and sending email.this is the message my phone keeps giving me.(The IMAP server imap.gmail.com in not responding.Check your NETWORK CONNECTION AND THAT YOU ENTERED THE CORRECT INFORMATION IN THE IN THE INCOMING MAIL SERVER FIELD.)On my phone there is no such setting

    • Derek says:

      I believe the setting for incoming mail is exposed depending on if you manually setup your Gmail account or used the option provided by Apple. If it’s manual there is an actual section in the Advanced Settings for Incoming Mail Server. Within that you’ll se options for Host Name, User Name and Password. If all else, simply delete your Gmail account from the phone and start over.

  17. Annie says:

    I’ve had that same problem for a while now. Sometimes I could fix it with one of the suggestions, but at other times I couldn’t. Then I just decided to leave it, which has resulted in a off and on service. The “not responding” problem only lasts a few hours, then it comes back on by itself. Have tried EVERYTHING, but now I just accept it as a break from checking email on my phone… :)