I'm running the Mac OS X 10.6 version of Mail.app and accessing Google Apps' mail via IMAP. I'm trying to make the integration as seamless as possible because I'm thinking of switching my wife to the combination.

I've used the Labs Advanced IMAP Controls to remove hide Starred, Chats, Spam, Bin, and — perhaps importantly — All Mail from my IMAP client.

I've configured Mail.app per Google's instructions. I've set auto-expunge off, and set the last expunge action to "Archive":

alt text

What I expect: when I delete a message from the Inbox, it's archived.

What I get: the message disappears from Mail.app, yet remains visible from Google Mail.

How can I tweak this so everything works as advertized?

  • What do you mean by "remains visible from Google Mail"? Is it still in the inbox in Google Mail? If not I think it already is working as advertised (as you are hiding the archive from imap client it surely disappears there) ;) – Turismo Sep 4 '09 at 10:02

Some more generic information for those getting to this question because of its title:

Gmail is very special when it comes to IMAP. Gmail uses labels, not folders, and there is simply no one-to-one mapping to IMAP. For example: putting a message in the Trash actually kind of assigns the label "Deleted". When labeled as such, any other label for that same message no longer applies.

Be sure to understand the implications of this. Like if you think you copied a message to some IMAP folder, then actually Gmail will only have assigned an additional label to the very same message. Now, if you've (wrongly) set up Mail to move deleted messages to the Trash, then after "deletion" of either of the two occurrences of that single message, the other is removed as well.

To get the full picture when using IMAP for Gmail, I think one should unfortunately at least read all of the following from Google's help:

Even some more details:

  • Like also noted in the question and other answers: see Google Labs Advanced IMAP Controls, which allows you to set When a message is deleted from the last visible IMAP folder: Move the message to the Gmail Trash. (Or "Bin" for UK English.)

  • The Gmail SMTP server automatically moves a copy to your Sent Items. So, when using that server, be sure to set up Mail.app to Use only this server. If you don't, then when Mail falls back to another server, you won't have a copy in your Sent Items.

  • If you want to use another Sender address, then see Adding a custom 'From' address; if you don't then Gmail will change it into your gmail.com address. For fine tuning see the recent new feature Send mail from another address without "on behalf of".

  • Changing the Gmail language also changes the names of things like Trash (Bin) and Sent Items. So choose the language before telling Mail about the usage of the mailboxes (using menu Mailbox, Use This Mailbox For).

  • Be sure to create a backup. If messages are somehow deleted form either your computer or Gmail's servers, then after the first IMAP synchronisation they're removed everywhere. (Or, for non-IMAP accounts: deleting any account also removes all of its messages!) When using Time Machine, then to restore items: first activate Mail and then enter Time Machine. This will give you the galaxy and star field with, instead of the default Finder, the Mail interface. Here you can even restore message from accounts you've deleted altogether.


To have "deleting" the message in Mail.app archive it immediately in GMail:

In GMail:

  • Click the "Settings" link at the top of your GMail window
  • Click the "Forwarding and POP/IMAP" settings tab
  • Select "Do not automatically expunge messages"
  • Select "Archive the message"
  • Select "Immediately expunge messages when I mark them deleted in IMAP"
  • Click the "Save Changes" button at the bottom of the window

In Mail.app, as per Google's instructions:

  • From the Mail menu, click Preferences > Accounts > Mailbox Behaviors
  • Under Trash, ensure both options are not checked:
    • Move deleted messages to the Trash mailbox
    • Store deleted messages on the server

alt text

If you don't automatically expunge, you can manually expunge by right-clicking the folder in Mail.app and selecting "Erase Deleted Items…" from the menu.


If you removed the "All Mail" option via the Gmail Labs function - your GMail is then set to display ALL MAIL irregardless of whether it is Archived or not.

That might explain why you are seeing it in GMail Inbox still - try not using the Gmail Labs function, and it should work now.

EDIT : If the instructions is muy unclear to you, just do this - get your ALL MAIL function back.

  • Fantastic answer. The Labs features are experimental for a reason: they break things. – Josh Hunt Sep 4 '09 at 9:10
  • I still have the All Mail folder available in GMail — it's simply not advertised to the IMAP client. – Garth Kidd Sep 4 '09 at 9:47
  • @Garth - that might explain why. Advertise it to the IMAP client, and then it will work as advertised. :) – caliban Sep 4 '09 at 9:52
  • For this purpose, I don't want All Mail on the IMAP client. I'm trying to keep it light. – Garth Kidd Sep 4 '09 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.