7

I would like to apply a particular label to all incoming messages. Gmail filters apply to both outgoing and incoming messages. So I've added a condition that says Doesn't have from:me. This prevents the filter from matching outgoing messages in Sent. However, it also (undesirably) prevents it from matching incoming messages that I send to myself or that someone else has sent to me “from” my own address. Is there a way to only exclude my own outgoing messages?

I’ve seen mention of using in:sent and label:sent, but when creating the filter Gmail warns against this saying that they aren’t applied yet at the time the filter is evaluated. I guess they are only for searching after the fact.

1
  • 1
    Why not make the condition "to:me" rather than "Doesn't have from:me"? If you filter on "to:me", that will only capture incoming mail but will not filter out mail you've sent to yourself.
    – Mark
    Aug 28, 2018 at 21:08

4 Answers 4

4
+100

Use the condition "to:me" instead of "Doesn't have from:me". This will capture incoming mail and exclude outgoing mail unless you've sent it to yourself.

To include e-mails sent to a mailing list of which you are a recipient, you need to use the "deliveredto:" operator. We can take advantage of the fact that the Has the words: field accepts search operators. Leaving the other fields blank, put the following text in the Has the words: box: {(to:[email protected]) (deliveredto:[email protected])} The inner parenthesis mean that the field is optional (e.g., the mail can be to: this address OR it can be deliveredto: this address). This is what your filter should look like:

Filter settings window

I believe you only need "to:" in order to capture e-mails sent to yourself, although I'd have to test it more to be sure. Regardless, putting both should capture all incoming e-mail.

8
  • 1
    I don’t think that will match messages where my address is not in the To field, e.g. mailing list messages. Also, it will match both copies of messages that I send to myself. Aug 30, 2018 at 0:39
  • Very true. To include those, we can take advantage of the fact that the Has the words: field accepts search operators. Leaving the other fields blank, put the following text in the Has the words: box: {(to:[email protected]) (deliveredto:[email protected])} The inner parenthesis mean that the field is optional (e.g., the mail can be to: this address OR it can be deliveredto: this address). It makes sense that it would match both copies of email sent to yourself, I'm not sure how you'd avoid that particular edge case.
    – Mark
    Aug 30, 2018 at 0:41
  • Actually, to be honest I'm not sure what you mean when you say it matches "both copies". When I test sending an e-mail to myself in Gmail, only 1 copy seems to be generated (which is both the sent and received e-mail).
    – Mark
    Aug 30, 2018 at 0:53
  • Hi @MichaelTsai, if this answers your question please mark it as correct, or if not let me know what it does not accomplish based on your original question
    – Mark
    Aug 31, 2018 at 11:43
  • I'm in the process of testing your suggestion. Thanks for your help. Aug 31, 2018 at 14:38
2

I think you have a few options.

For each example just paste into the Gmail search bar, hit enter to return results and then click the "Show search options" icon on the right hand side which will allow you to create a filter from your search.

  1. After early date: after:1984/04/01
  2. Doesn't contain random string: -fc1e258c565f4574a2c15b33c63b521a
  3. Larger than zero bytes: {size:0 is:chats} (chats have no size)
  4. Collectively exhaustive OR filter: {has:nouserlabels has:userlabels}
  5. All of the above. Create multiple filters, just in case.

I would also be tempted to create a second version of each filter with in:anywhere added. This is because there is conflicting info about how these work so best to hedge your bets:

  1. after:1984/04/01 in:anywhere

  2. -fc1e258c565f4574a2c15b33c63b521a in:anywhere

  3. {size:0 is:chats} in:anywhere

  4. {has:nouserlabels has:userlabels} in:anywhere

List and explanation of available search terms here

#1 and #3 in the first list will warn that the filter won't match incoming mail and yet they do for me without fail. Perhaps it depends on what actions you choose to take.

1
  • I love the idea to create a completely exhaustive OR filter. That is the most robust and complete solution I've found anywhere online and works perfectly. Dec 12, 2022 at 23:51
0

Filters apply labels to incoming messages but if you are using the conversation view it could appear that the label was assigned to the whole conversation instead of a single message.

If you want to check the above by yourself by using the Gmail web app, first turn off the conversation view as is explained on How to filter by messages, not by conversation?

1
  • I don’t think the problem I’m seeing is related to conversations. Filters really do seem to apply to lone outgoing messages with a unique subject. Aug 30, 2018 at 0:44
0

I do not have a solid solution for your older e-mails but a concrete one for your future ones.

You mention:

However, it also (undesirably) prevents it from matching incoming messages that I send to myself or that someone else has sent to me “from” my own address. Is there a way to only exclude my own outgoing messages?

For future e-mails

We will reverse the whole idea. Instead of excluding your own outgoing messages you can create a new address you will be using to send e-mails to yourself. Even better you can have friends send or anyone else to it as well.

We can do that because Gmail will not acknowledge periods as characters in addresses.

Example:

Let us say your Gmail account is under [email protected].

Starting now, you can e-mail yourself to [email protected] or have someone else send an e-mail to you “from” your own address. Filter, star, label these messages with ease. You can find more information about using dots in Gmail addresses here.

As for older messages, find them (or whenever you come across one) and forward them to your new address. Your corresponding filters will be automatically applied to them as well.

Note

Some people may get confused by using dots in the e-mails. If this is the case please use a different approach to a possible solution for your issue described here.

2
  • Thanks for trying to help. I only need it to work for future messages, but I need a solution that doesn’t require changing my address. Sep 3, 2018 at 14:35
  • @MichaelTsai "...but I need a solution that doesn’t require changing my address". I am afraid you misunderstood. You wouldn't change your address for anyone else. It would be just you who would email yourself to the same address with an extra point in it. Anyway. Please let us know if the solution provided by Mark works. Sep 4, 2018 at 17:57

Your Answer

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

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