Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use "not" in Gmail filters? [closed]

People also ask

How do I exclude emails in Gmail filters?

The minus sign (`-`) operator tells Gmail to exclude a specific item from the filter.

Why are filters not working in Gmail?

One of the reasons your filters are not working could be because there are too many filters. Keep in mind that only one filter can work at a time. If an email meets two different filter search criteria, only one of the filter settings is going to be applied.

Can you use Boolean operators in Gmail?

You can also use Boolean operators like AND , OR , NOT , or AND NOT in your Gmail searches just like in Google search.


Fixing this problem requires understanding two things:

1) If a label has been placed on an existing email by a filter, the label stays even if that filter were deleted. One must delete the label itself, and then re-create a new filter in order to get your edits to "take".

2) There is a bug in the Gmail filter system. If you try to set up complex Boolean such as

from:[email protected] -to:[email protected] -junk_term

It will work fine on the initial search, but if you use it to create a filter, the terms, especially the NOTs, will be garbled.

The correct syntax, (hat tip to chenghuayang) is to ignore the to's and from's.

[email protected] [email protected] -junk_term

You could use labels to flag your emails and process them accordingly, based on those labels:

  1. matches from: [email protected] then apply label Label_X
  2. matches from: [email protected] then apply label Label_Y
  3. matches junk_term then apply label Label_Y
  4. matches label:label_X AND -label:Label_Y then respond

The condition of the last rule has to be added to the Includes the words field.

Here is a list of further attributes.