How should I configure Mail.App and Google Mail?
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":
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?
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:
How do actions sync in IMAP?
Gmail folders in your mail client
Recommended IMAP client settings (be sure not to save deleted messages to the Trash)
Recommended settings for Mail.app
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
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.