Clearing Cache in Mail on Snow Leopard

8

1

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?

Gordon

Posted 2010-01-17T22:48:06.293

Reputation: 287

Answers

14

This assumes that you're using Gmail IMAP. Set Mail.app 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."

EDIT
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 Mail.app

fideli

Posted 2010-01-17T22:48:06.293

Reputation: 13 618

2A 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 – 2010-01-17T23:26:39.030

1Weird. 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 – 2010-01-18T14:28:46.973

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 – 2010-01-18T22:47:49.853

2

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.

Steve Folly

Posted 2010-01-17T22:48:06.293

Reputation: 5 293

1

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.

ca_peterson

Posted 2010-01-17T22:48:06.293

Reputation: 111