So I get a lot of mails from recruiters.

To begin with I created a filter with tests for all the domains of all the agencies who mail me, this filter expression is getting unmanageable.

What I would like to do is create contacts for all my recruiters, apply a label/category to those contacts, and then write a filter that says if the sender is a contact with this label-category then apply a label-category to the email.

However I can't see an easy way to write the expression to test the label-cat.

1 Answer 1


There is no Easy Way

You cannot do what you want directly from within Gmail's GUI.

Your existing approach maintaining a filter with a list of mail domains (or emails, or names) is the way to do it in Gmail. Keep it as short as possible.


from:({recruiter.com yournextopp.com getajob.com})

rather than

from:(recruiter.com) OR from:(yournextopp.com) OR from:(getajob.com)

You can do more complex tasks by creating a Google App Script (script.google.com) if you have some coding experience.

  • Since this is the answer on question on filtering in Gmail, can you elaborate further on how to actually use an existing Google App Script in an Inbox or Gmail in general?
    – trejder
    Apr 15 at 11:08
  • My answer was targeted at the problem space (filtering messages in Gmail). If there exists a question related to your comment please link it in the comments and I will take a look.
    – Blind Spots
    Apr 15 at 20:45
  • Since your answer says about using Google App Script and it is an answer to the question that asks about filtering messages in Gmail then I allowed myself to combine these two and ask you, if you can elaborate on how can I use Google App Scripts for filtering messages in Gmail. But... never mind.
    – trejder
    Apr 15 at 21:14
  • Elaborating further on using Google Apps- Script: If you are willing to invest some effort and run into problems, I and others would be happy to help you out. Simply write your own question. Maybe first start with searches of this site like '[google-apps-script] Gmail filter'. You will find scripts that you can use and or modify.
    – Blind Spots
    Apr 16 at 3:00

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.