I think the spam detection of gmail is a filter applied before others...
How to deal with it:
- To filter mails flagged as spam: add
label:spam
in the"Has the words"
input box. - To avoid the spam flagging, create a filter that describes the cases when Gmail should not flag the incoming messages as spam and then check
"Never send it to spam"
.
source: googlesystem.blogspot.com