Gmail marks Facebook emails as spam, and “don’t send to Spam” filter breaks label functionality – what can I do

facebookgmailgmail-filtersgmail-labelsspam-prevention

For some reason, almost every email Facebook sends me (usually notifications about something posted in a group) ends up being marked as "Spam" by Gmail.

I've tried creating a filter "from:facebookmail.com, Never Send To Spam". It works in the sense that emails no longer go to spam, but it then breaks my other filters!

Here's what I mean – I basically have the following filters:

  1. from:facebookmail.com, Never Send to Spam
  2. subject contains "Toronto Pub Night", label as "toronto-events", skip Inbox

… and a whole bunch of other filters like #2 above for a bunch of different groups.

If I have both #1 and #2 enabled, messages don't go to spam, but the "skip Inbox" part is ignored for some reason, and messages end up in my inbox. If I only have #2 enabled, messages end up in Spam. What I want is for the messages to just be auto-archived with the correct label, and not in Spam obviously. Is there a way I can make this happen? In general, is it normal for Gmail to mark all Facebook mail as spam, or is there some setting I'm missing to prevent this from happening?

Best Answer

The reason this happens is because Gmail uses its filters in order, until the first filter matches the mail. If the first matching filter was found, Gmail will stop finding other filters that match.

So the algorithm used by Gmail is the following (simplified, but still technical):

for every filter loop
    if filter matches mail do
        do filter action on mail
        end filter loop
    end if
next filter

That way, only 1 filter is found and executed on every mail. So if your first filter matches, only this filter will be executed.

If you want to solve the problem, I think the only option is to say to every filter starting from #2 that it shouldn't be sent to spam. This will probably be a lot of work, to do that for every filter. But as far as I know, this is the only option that will really work at this moment. Until Gmail makes it possible to execute more than 1 filter on every incoming mail.

Footnote: this, is as far as I know, and have found out myself. So it could be different in reality.