How should I configure Mail.App and Google Mail?

7,652

Solution 1

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.

Solution 2

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.

Share:
7,652

Related videos on Youtube

Garth Kidd
Author by

Garth Kidd

Ancient History Dept.: I was one of iPodder's lead developers. Oh, boy, was that iTunes 4.9 steam-roller heavy. These days, I code in C# and JavaScript, miss Python, and thoroughly enjoy strapping infrastructure together with Puppet.

Updated on September 17, 2022

Comments

  • Garth Kidd
    Garth Kidd almost 2 years

    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?

    • user199403
      user199403 almost 15 years
      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) ;)
  • Josh Hunt
    Josh Hunt almost 15 years
    Fantastic answer. The Labs features are experimental for a reason: they break things.
  • Garth Kidd
    Garth Kidd almost 15 years
    I still have the All Mail folder available in GMail — it's simply not advertised to the IMAP client.
  • caliban
    caliban almost 15 years
    @Garth - that might explain why. Advertise it to the IMAP client, and then it will work as advertised. :)
  • Garth Kidd
    Garth Kidd almost 15 years
    For this purpose, I don't want All Mail on the IMAP client. I'm trying to keep it light.