27

When you try to use any of the queries label:, in:, or is: in a Gmail filter, you will see the following warning:

Warning: Filter searches containing "label:", "in:", or "is:" criteria are not recommended, as these criteria will never match incoming mail.

However, if you want to disable the spam filter, you can safely ignore this warning. Are there any other exceptions?

2 Answers 2

27

Filters are processed in the order they exist in the list. This means that if a filter comes after another one, you can use one of these special filter criterias which it warns you about. For example, if you have a filter that stars a message, then you can have a rule below it use is:starred successfully.

Some criteria is even applied automatically before filters are processed. Examples are messages that are sent to spam (i.e. you can use is:spam), or a POP3 account which labels incoming mail. In this case the filter's order does not matter.

Here is a list of criteria you can use:

  • is:starred: if a previous filter has starred the message, this can be used.
  • is:spam: if the message was automatically marked as spam, this criteria can be used.
  • is:read: if the message's read property was not modified (i.e. it stays unread), this will not match it. If a previous filter marked a message as read, this will match it.
  • is:unread: the opposite of is:read.
  • label:example: if a previous filter has labeled a message this can be used. (Note that mailboxes such as the inbox will work. That is, label:inbox will work.)
  • label:[email protected]: if your mail account is set to read another account via POP3 and is set it to automatically label all email from that account, the label: criteria can be used since it will first label the message and only then run the filter.
  • in:trash: you would think that if a message is trashed from an earlier filter, the other filters would stop working, however, that is not the case.
  • in:inbox: the two things that affect this are "Skip the inbox" and "Delete it".
  • in:anywhere: it's pointless, but it works.

Criteria you cannot use:

  • in:sent: When you send a message, it will first process the filters and only then be considered sent, thus, you cannot use the in:sent criteria in a filter.

Untested (I will update this as I test these):

  • is:muted
  • is:chat
  • is:important
3
  • Can you apply a filter on outgoing messages before they are sent?? Can you give an example?
    – d-b
    Commented Jul 9, 2018 at 10:54
  • So If I understand you correctly then: Filter: Apply Label Filter: Use Label ... works, but then if you later add: Filter 2: apply same label ... then this will be broken until you delete the "use label" filter and recreate. Is that about right?
    – sf_jeff
    Commented Jan 1, 2020 at 4:50
  • For me doing a filter with is:spam and then forward to external email, doesn't work...
    – Nathan G
    Commented Jan 4, 2023 at 20:15
1

It's probably just a warning message for people unaware that those keywords are reserved and have special behavior.

2
  • 2
    I don't think it is, because of the part that says these criteria will never match incoming mail... meaning you are using these expressions to filter Gmail on purpose. I understand why it most likely won't match, since when a new email arrives, it won't have a label. But what if you have another filter that adds a label?
    – Senseful
    Commented Jul 7, 2010 at 22:37
  • 1
    Doesn't a new message have the label:inbox associated with it? Commented Jul 7, 2010 at 22:58

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.