2

How can I filter all the messages sent to *@domain.com except for those sent exclusively to user@domain.com?

I tried to:domain.com AND -to:user@domain.com and to:(domain.com -user@domain.com) but it shows all the messages sent to *@domain.com that do not have user@domain.com as the recipient.

2

Was playing around with Gmail search. The syntax for what you want is as follows:

to:*@domain.com -to:user@domain.com

This also works for the "from" section as well, so it's good if you want to filter out unwanted sales and promo emails.

  • The asterisk isn't required. – Rubén Dec 1 '18 at 23:19
  • Oh, thanks. I never really checked, and assumed that the asterisk was needed, considering it's widespread use as an identifier for "anything goes here". – Ben Does Gaming Dec 29 '18 at 10:59
0

I was able to do this by first creating a Label and a Filter for the user in which you do not want to see emails to.

  1. Go to settings
  2. Filters and Blocked Addresses
  3. Create a new filter
  4. Put the users email address in the To field
  5. In the bottom right click Create filter with this search
  6. Tick Apply the label - New Label...
  7. Tick Also apply filter to X matching conversations
  8. Create filter

Now all emails to that user will have a label attached to them.

For your search query: to:domain -is:LabelCreatedAbove

Just note that is your label has spaces like this I am a label the spaces will convert to - in the search box: I-am-a-label

  • 1
    But it still adds label to all messages sent to the user regardless of whether the user is the only recipient or not. – burtek Apr 23 '17 at 19:29
0

Unfortunately, what you want to do isn't currently possible in Gmail. You need a search operator like only or exclude, neither of which are among Gmail's list of operators.

It would be a nice feature to have; perhaps someone will develop a Gmail add-on with that capability.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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