Friday 10 June 2011

How to disable GMail's spam filter

GMail's spam filtering is usually excellent, but sometimes it can get over-zealous.  The first thing to know is that mail from people in your GMail Contacts list is never flagged as spam. So regular correspondents should be added to to your GMail Contacts.

If you want to turn off GMail spam filtering altogether, here's how...

The following steps will set up a filter to ensure that all e-mail goes to your Inbox and never to your Spam folder...
  • Log into GMail.com in your web browser
  • Click  'Options' (the cog icon on the top right of the screen)
  • Click 'Mail Settings'
  • Click 'Filters'
  • Click 'Create a new filter' (at bottom of list)
  • In the 'Doesn't have' field, enter "opsjk fokjaw9ptu4398ru39u9u93flkoifjew" (or any other long, random character string you choose)
  • Click 'Next Step'
  • Tick the box "Never send it to Spam"
  • Click "Create Filter".
I have several secondary GMail accounts that currently forward all mail to my master GMail account.   By disabling spam filtering on all except the master GMail account, there is only one Spam folder to check periodically for false positives (mis-labelled "ham").

You can also set GMail to forward messages only when filter conditions are met.  To do this, first remove any existing forwarding rule.  Then create a filter rule (after any Never send to Spam rule) for the messages to be forwarded.  For example, to forward all email sent to your domain EXCEPT mail to sales@ and info@, you can create a filter that has the To: field set like this:

         -{sales@example.com OR info@example.com}

Then after clicking 'Next Step', you just tick the option to forward matching messages to a specific address.  You can also add a similar list of banned words (or word combinations) in the Subject field.  Finally, be sure to use the 'Test Search' button to verify which messages from your current Inbox would have been forwarded by that rule.

17 comments:

  1. Thank you, Martin. This is a real life saver for eliminating missing mail!

    ReplyDelete
  2. Thanks Martin! Gmail suddenly started sending a bunch emails from my customers, and Ebay, and order confirmations from my websites to the spam folder, and I didn't notice until one called me and asked if I got the email. I'd rather have more spam in my inbox than miss important emails.

    This workaround was easier than constantly setting up new filters.

    ReplyDelete
  3. Thanks, sounds to be good solution for my problem.

    ReplyDelete
  4. Thanks Martin! exactly what I needed.

    ReplyDelete
  5. Thanks so much for this

    ReplyDelete
  6. Awesome-thanks!

    ReplyDelete
  7. This no longer works since, "never send to spam" is not an option. At least not on my iPhone, I don't have a computer, that's why I need to get all emails put in the inbox. Any suggestions?

    ReplyDelete
  8. It still works OK! If you use Gmail's desktop site, "never send to spam" is still an option.

    When you access GMail.com from a mobile device, by default you see a simplified view that fits more easily onto a mobile screen.

    If you can't borrow a computer, you should still be able to access that functionality (Mail Settings / Filters) from your iPhone by clicking the link "Desktop version" at the bottom of the mobile version of the GMail app. But it will take a lot of scrolling around on that little screen, so I haven't tested it from my own iPhone.

    Hope this helps

    ReplyDelete
  9. THANK YOU! THANK YOU! I was literally in tears!!

    ReplyDelete
  10. It's strange that Google hasn't provided a one-click option to disable spam filtering. Various schemes similar to this have been suggested in the last 4-5 years as a workaround, but this appears to be the best of the lot.

    Google's spam filtering is about the worst I've seen. If it uses a Bayesian filter, it's probably because the filter has been poisoned, but as an individual Gmail client one can't reset the filter and train it.

    If you use an email client such as Mozilla's Thunderbird or SeaMonkey, you don't need Google's spam filter at all, because these programs incorporate their own filters that work far better. Moreover, you can train them with your own messages. Using SeaMonkey, I don't delete spam; instead, I send it to the special junk mail folder that now contains hundreds of junk mail messages. If I suspect that my Bayes filter file has been poisoned or otherwise corrupted, I move the known spam messages to another temporary folder, delete the filter file, then manually mark all the messages in that folder as spam. This re-trains the filter for my particular spam pattern and future legitimate emails that end up in the spam folder can be tagged as "not spam" so the filter re-learns what NOT to flag. It can take anywhere from 200 to 1000 spam messages to train the filter, so if you're starting a new mail account and don't have a big collection of spam for training purposes, be patient. Like wine, it gets better with age.

    ReplyDelete
  11. Joe, I'm curious to see whether any other readers agree with your comment. I can't agree with you.

    Apart from very rare, short-lived glitches, the filters on GMail work brilliantly for me - so much better than all the approaches I've ever tried. My main email address is heavily spammed (hundreds per day) so this is an important issue for me. Yes I could change my email address, but relying on obscurity isn't ideal either.

    In the past, I ran my own mail server. I used some mild RBL's to block the more blatant offenders, plus Bayesian filtering between the client and the server. I also tried the filters on several different mail clients. But nothing was as effective or as simple to use as GMail's filter.

    GMail's strength in spam filtering comes from crowdsourcing. Each time I move a message into or out of the Spam folder on any of my IMAP clients, it helps to train GMail's scoring algorithm a little more. Clearly this is also a source of weakness: some people will hit the Spam button on mailshots they signed up for but no longer wish to receive - and this could poison the filter rules potentially leading to false positives. But when I've trawled around the Spam folder, it's very rare to see any false positives (ham marked as spam).

    I guess Google must have some clever people doing clever tweaks to maintain accuracy. Doubtless they have some test accounts exposed via Usenet and web pages, simply to gather spam to help feed the filters.

    Spam patterns are always changing, so I think using a big system like GMail to do the filtering saves a lot of work. I just don't have the time any more to maintain my own mail server. Client-side filtering doesn't work for me, as I regularly use four different IMAP clients, and I want a consistent view of all mail sent and received. I don't want to have one of the clients doing the filtering, and I certainly don't want all of them doing it.

    Nothing is perfect (you will never, ever get 100% accurate spam identification) but I do think GMail makes a good job of it. And the price is right.

    ReplyDelete
  12. Martin: I have to agree with Joe. My gmail frequently put my email from customers in spam and my electric company bills and several professional subscription services such as Medscape and Consumer Reports. For me, it happened so frequently that I had to use Martin's disable ploy (THANK YOU Martin!). I've now set up gmail to forward my old email address and use my old email program (Pegasus) to read email. Pegasus has a filter that works MUCH better than gmail and it's a zillion years old. How is that possible? Google needs to fix this.

    ReplyDelete
  13. thanks for solution, I found a lot of mail in spam folder, receipts from paypal and even mails from google itself (adsense notifications).

    ReplyDelete
  14. Hi, the Never send it to Spam option does not come up fr me, whatever i try!! Please help! It simply does not appear in the list when i create a filter???? thx

    ReplyDelete
  15. Hi,
    Actually just found the option, you have to use the new html option, not basic html!! Thx

    ReplyDelete

Spammers: please stop wasting my time. All comments are moderated before publication.