Gmail's filters are either very weak or I don't understand, how to create just a bit more complex ones.

In particular, how can I create a filter, that will match:

  • messages in SPAM folder (as well as in others or only in SPAM folder),

  • messages, that contain specified keyword in many fields (i.e. From field and message's body).

I'm able to match messages, that contain more than one keyword in given field (for example, to match many keywords in From field, I use one OR two OR three). But, can I write one filter, that will match these keywords in both From field and message's body? So, it will apply given filter rule, no matter, if keyword was found in this or that field? Or do I have to write separate filters for each field, which I want to search for matching keywords?

1 Answer 1


Gmail filters may not be sophisticated enough for that. Further, filtering stuff that has the "spam" label may not work reliably. (Filters act when a message arrives; a message marked spam may have been processed before that. You'll even be warned to that effect. Works fine for search, though.)

The best I can come up with based on your question is a filter that looks like this:

Matches: (from:(one OR two OR three) (one OR two OR three) in:spam)
Do this: Never mark it as important

When you create the filter you'll essentially put the whole string from:(one OR two OR three) (one OR two OR three) in:spam in the Has the words field.

There are some flaws. The general text (one OR two OR three) could match against the subject (or possibly other places), because there's no way to limit the text search to the body of the message.

More at Google Support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.