Quickly archive and/or delete Gmail messages in Mail.app

Dec 29, '09 07:30:00AM

Contributed by: estnyc

In the recent Move messages to a target folder via keyboard shortcut hint, I noticed a user describing a script he'd written to allow him to archive messages from four different Gmail accounts. I replied with this simpler suggestion, and I think perhaps it might merit being considered as a hint in its own right. A quick search of the site didn't show that it'd been posted before.

When you define your Gmail account in Mail.app, make sure you do the following:

  1. Under Mailbox Behaviors for Trash, make sure both options are unchecked. You want Mail to not move deleted messages to the trash, and not to store them on the server.
  2. For Junk, check Store junk messages on the server, and set auto-delete to never. In the listing of your GMail account's folders within your Mail.app sidebar, select the Spam folder and choose it as Mail.app's Junk folder. You can do this by selecting 'Use this Mailbox for..' under the Mailbox menu, and selecting "Junk." This sets it up so that both Mail.app and Gmail are using the same folder for Junk and/or Spam.
Once you've done the above, you can easily archive messages without any custom scripts or plug-ins. Note: the following solution has one key limitation: if you have any accounts in Mail.app that aren't Gmail accounts, you'll be in for an unpleasant surprise if you try to archive mail from one of those accounts' inboxes by deleting it. With that caveat in mind, here's how I handle GMail in Mail...

When you're going through your inbox, to archive a message, simply delete it. As Gmail uses tags, not folders, you're not actually telling Gmail to delete the message, but rather to remove the 'Inbox' tag from the message. Without the 'Inbox' tag, the message will no longer show up in your Inbox, but it won't be deleted from your account; it's still accessible under 'All Mail.'

This is exactly the same as clicking on the Archive button for messages when you're using gMail's web interface. So deleting == archiving; it's not intuitive at first, but it's sure easy to remember and quick to perform.

If deleting is archiving, you may be wondering, what should you do if you really want to delete a message? This is also simple, but not initially obvious: Flag the message as junk mail.

Mail.app will move the message out of your Inbox and into your Junk folder, which also happens to be Gmail's Spam folder. In other words, when you click on a messages's Junk button, you're telling gMail to remove the 'Inbox' tag from the message, and apply the 'Spam' tag. So the message will show up in your Gmail account's Spam folder, and it will be automatically deleted when it gets to be thirty days old (the age at which Gmail automatically deletes Spam messages).

So, to archive, delete. To delete, junk. It really will make sense, I promise.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20091221173506630