Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can anyone tell me how to clear the cache in the Mail application on Snow Leopard?

I noticed that it was automatically backing up my gmail messages so it ended up caching 11GB of emails even though that's more than my account.

The only solution I seem to be able to find is to delete the files in /Users/me/Library/Mail/MyGmailAccount

Is this the best solution or is there a better way?

share|improve this question
up vote 14 down vote accepted

This assumes that you're using Gmail IMAP. Set to not keep offline copies of messages. Mail -> Preferences. Accounts -> Gmail account -> Advanced Tab. Set "Keep copies of messages for offline viewing:" to "Don't keep copies of any messages."

As per Steve Folly's comment, it's true that with that method, Spotlight would no longer be able to access those emails for searching within entire messages. If the 11 GB of your email is mostly due to a lot of attachments, another option would be to choose "All messages, but omit attachments" in that same dropdown box. That way it would cache the text portion of the mail and you would still be able to search through it.

Gmail in

share|improve this answer
A word of warning - if you choose "Don't keep copies of any messages", Mail can't index content and you can't search in 'entire message'. – Steve Folly Jan 17 '10 at 23:26
Weird. I just tried it right now (Don't keep copies of any messages) and it proceeded to delete all the downloaded mail in the ~/Library/Mail folder. What you can do now is quit Mail, delete your mail in /Users/me/Library/Mail/MyGmailAccount as you stated in your question, and reload Mail, and see if it downloads your mail again with this setting turned on. – fideli Jan 18 '10 at 14:28
That did the job thanks. Mistake on my part didn't see it delete the messages. I'll up vote when I get to 15 :) – Gordon Jan 18 '10 at 22:47

Do you use IMAP or POP access to gmail? IMAP should sync local and server content (do Mailbox > Synchronize > [account] just to make sure). POP will make copies from server and accumulate mail locally (and delete from server after a while).

If you don't want email locally, just delete it from within the Mail app.

share|improve this answer

The Mailbox > Rebuild option worked great on an IMAP connection that stopped showing my older local email. It's a low-impact first thing to try before you start deleting files.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .