Save Local Disk With Gmail "Advanced IMAP Controls"

I outlined ”Setting up Leopard Mail.app with Google Gmail IMAP” previously, and Google Labs has released a new feature for regular and Google Applications Premier Edition Gmail - Advanced IMAP Controls. How can you use this to save space?

Screenshot showing Google Labs GMail Advanced I.M.A.P. Controls.This tip shows you how to avoid having to sync the GMail “All Mail” folder, thus saving a considerable amount of local hard disk space in many cases. Before enabling Google Labs features, note the caveat mentioned by Google on this FAQ.

At any rate, here’s how to enable Advanced IMAP Controls:

  1. Close Mail.app.
  2. In Gmail settings, Labs tab, turn on “Advanced IMAP Controls” by enabling it.
  3. Delete the locally sync’ed All Mail Folder.
  4. Start Mail.app and confirm. You can press Cmd-0 to check activity in Mail.app.

Screenshot showing Google Labs - Configuring Gmail I.M.A.P. Folder Syncing. You can easily delete your local copy of the All Mail folder from Terminal. Use the sudo command to run a bash shell within your shell, and feed the password prompt your administrator password. You can check the size of the various folders using du, and rm -rf to force-delete the folder. Exit will get you out of the sudo’ed bash prompt and back to your normal prompt.

Cleaning up IMAP
1
2
3
4
5
6
7
8
9
jrc $ cd ~/Library/Mail/IMAP-rick.cogley\@imap.gmail.com/[Gmail]
jrc $ sudo bash
Password: *********
bash-3.2 # ls
All Mail.imapmbox Drafts.imapmbox Reference.imapmbox Starred.imapmboxExpiring.imapmboxSent Mail.imapmboxTrash.imapmbox OmniFocus.imapmbox Spam.imapmbox
bash-3.2 # du -h -d 1
bash-3.2 # rm -rf All \Mail.imapmbox/
bash-3.2 # exit
jrc $ 

When you restart Mail.app, the folders for which you had sync enabled which are now disabled, will take a moment to disappear. I saved myself 2 GB of disk space by enabling this.