Gmail – When to Use ‘label:’, ‘in:’, or ‘is:’ in Filters

gmailgmail-filters

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?

Best Answer

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:user@example.com: 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