Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Remove Gmail's All Mail folder in Mail from Spotlight index Apps
A simple hint. Although we cannot remove the duplicate messages stored in the All Mail folder of a Gmail IMAP account in Mail.app -- we can't even unsubscribe from the folder -- at least we can add the folder to Spotlight's list of places not to index. Then searching will no longer show duplicate emails.

In System Preferences » Spotlight » Privacy, add each user's All Mail Gmail folder, usually found here:

~/Library » Mail » IMAP-username@imap.gmail.com » [Gmail] » All Mail.imapmbox

Not perfect, but no longer finding duplicates is nice.
    •    
  • Currently 2.29 / 5
  You rated: 2 / 5 (7 votes cast)
 
[53,570 views]  

Remove Gmail's All Mail folder in Mail from Spotlight index | 14 comments | Create New Account
Click here to return to the 'Remove Gmail's All Mail folder in Mail from Spotlight index' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: 5chm31din6 on Feb 15, '08 07:53:39AM

Now if there was only a way to remove it from showing in Mail.app itself. Very annoying.

---
Power corrupts. PowerPoint corrupts absolutely.



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: Tiggar on Feb 15, '08 10:06:17AM
Another way to remove the messages from GMails [All Mail] folder out of Mail.app would be to:

1. Close Mail.app and make sure it's not running anymore.
2. Open the Terminal/iTerm
3. Navigate to (using the 'cd' command)
    /Users/<your current user>/Library/Mail/IMAP-<your gmail account name>@gmail.com@imap.gmail.com/[Gmail]
(replace the the values in the brackets with your personal data)

4. In this directory you will find a folder called (use 'ls -alhG' command):
    drw-r--r--   1 Jan  Jan     0B Dec 20 19:22 All Mail.imapmbox
5. Delete
    rm -rf "All Mail.imapmbox"
or move
    mv "All Mail.imapmbox" /Users/<your current user>/Backup/Mail.app
this folder. The folder should exist beforehand. Create it with Finder.

6. Create an empty file with the same name
    touch  "All Mail.imapmbox"
7. Start Mail.app

Now the All Mail folder should be empty and will not be synchronized by Mail in future. This works for me since last year December and I'm happy with it.

Use this guide at your own risk. Be careful when deleting things in the terminal. Always double check what you are doing! Hope That Helps.

[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: ja on Feb 15, '08 12:49:36PM

I used a similar technique to keep my spam folder on an imap account from being synced with Mail.app.

Instead of creating an empty file I just link the mailbox to /dev/null

Follow the directions in the parent comment and then instead of

touch "All Mail.imapmbox"
use
ln -s /dev/null "All Mail.imapmbox"

Or, more accurately in my case:

ln -s /dev/null spam.imapmbox



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: poppap on Mar 08, '08 01:57:15AM
Instead of touch or ln -s to /dev/null
I copied the emptied Trash folder (Empty it in Mail.app first) as All Mail and chmod it to be read only.

first,
rm -fr "All Mail.imapmbox"
or back it up
then
cp -R Trash.imapmbox "All Mail.imapmbox"
chmod -R 500 "All Mail.imapmbox"

This prevent Mail.app from crashing when performing the search.

[ Reply to This | # ]
Alternative way to remove duplicates
Authored by: ady82 on Feb 17, '08 03:34:12AM

If you remove the All Mail folder from spotlight you will not be able to search for messages that don't have a gmail label.

I have found a better way is to exclude all your other gmail folders except for the All Mail folder. Now you can search your entire email archive (just like you can on the Gmail website) without having duplicates.



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: emmby on Feb 17, '08 10:54:58AM

Removing the All Mail.imapmbox directory and replacing it with a file worked for me in as much as I stopped getting duplicate email messages from my All Mail folder, but unfortunately it causes Mail.app to crash every time I do a search.



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: iTux on Mar 22, '09 01:48:16PM

Hey guys,

you can activate "Advanced IMAP Controls" from the Labs menu under settings in your gmail account. After enabling it, change to the labels menu in the settings and uncheck "Show in IMAP"

HTH
iTux



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: robogobo on Aug 26, '09 04:03:59AM

Finally a real solution. Thanks! Just be careful. I don't think you can get the labels/mbox back if you accidentally delete too much. I got a bit carried away and deleted my sent box. I'm trying to put it back now.



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: andrewwynn on Oct 14, '09 02:41:10AM

worked good for me (0kb file) but next time i will make sure no unread emails; stuck at 20 now. nice n fast though!

of much bigger consequence is the 6-8GB i can save on some computers not doubling@ the mail store! when will Mail figure out the cocept of an alias!



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: palahala on Oct 15, '09 12:12:03AM

You can't blame Apple for this. Gmail is mapping its labels to IMAP folders as good as possible, but IMAP does not support aliases either. So Gmail tells Mail that some folder has some message, and another folder has another message. And these happen to be the same messages.



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: markwi on Nov 21, '09 02:59:10AM

easy done, but then I can not move a mail to the "all mail" folder through my iphone to keep the message in case I need it later.
I don't want the 'all mail' folder in the mail.app to avoid downloading of >1000 old mails!
Any hint for a smart solution?



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: markwi on Nov 21, '09 03:01:25AM

easy done, but then I can not move a mail to the "all mail" folder through my iphone to keep the message in case I need it later.
I don't want the 'all mail' folder in the mail.app to avoid downloading of >1000 old mails!
Any hint for a smart solution?



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: andrewwynn on Mar 22, '10 09:26:54PM

not needed anymore thank God...

in gmail, open your settings, go to labs and turn on advanced imap controls.

now go to labels and un-check [ ] show in IMAP for all the useless folders:

all mail
starred

and any labels used for sorting/sifting online but not used in mail.app.

my mail storage size dropped 70% after removing all the duplication caused by the concept of labels vs folders.

-awr



[ Reply to This | # ]
Remove Gmail's All Mail folder in Mail from Spotlight index
Authored by: everkleer80 on Mar 23, '10 06:42:52AM

I find the all mail folder fairly useful to have when I accidentally 'delete' (archive) a message (I wish there was a better way though if you know of any - if I have it sent to my trash, will it remove it from the server? I want all/most of my email to be archived) or when I want to look for a message I recently archived (if it's more than a few days old then I use the web interface.)



[ Reply to This | # ]