Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[23,001 views]  

Remove Gmail's All Mail folder in Mail from Spotlight index | 12 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 whomever 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 Fri, Feb 15 2008 at 7:53AM PST
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 Fri, Feb 15 2008 at 10:06AM PST
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 Fri, Feb 15 2008 at 12:49PM PST

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 Sat, Mar 8 2008 at 1:57AM PST
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 Sun, Feb 17 2008 at 3:34AM PST
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 Sun, Feb 17 2008 at 10:54AM PST
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 Sun, Mar 22 2009 at 1:48PM PDT
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 Wed, Aug 26 2009 at 4:03AM PDT
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 Wed, Oct 14 2009 at 2:41AM PDT
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 Thu, Oct 15 2009 at 12:12AM PDT
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 Sat, Nov 21 2009 at 2:59AM PST
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 Sat, Nov 21 2009 at 3:01AM PST
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 | # ]