Wahoo! Google blog about this quite a while back and i didn’t realise it.
They have this new add-on currently experimental in their labs section, while gmail is still in beta, so almost everything is labs!
So the problem here is Gmail IMAP offer a very good means for almost everyone to sync their email in mail, iphone and thunderbird etc (outlook sucks in imap features, especially with gmail). BUT the “All Mail” label in gmail can get quite irritating when u start seeing duplicates emails in your “Inbox” and “All Mail” folder. and even more irritating when search produce 2 email of exact same thing from the 2 folders, of cos, there was recommendation like this to remove it from spotlight, but if your gmail account have 4gb of email, you are actually using 8gb to cache 4gb of your email.
So come “Advance IMAP Setting for Gmail”, simply go to “Settings” then under the “Labs” tab, search for:
Advance IMAP Controls
Enable it, and simply go to the “Filters” tab to exclude your “All Mails” label from showing in IMAP.
You can read more about this in google’s blog linked below.