Filter: Multiple Root Domains

1,294 views
Skip to first unread message

Sabian

unread,
Mar 8, 2017, 1:54:40 PM3/8/17
to GMail Power Users
I want to create a filter that adds a label to all emails that are received from more than one specific domain name.

So for example any emails from:


How do i add such a filter? Can i do it using the "from" field or does it have to be filtered using the "Includes the words" option. 

If the latter is the only option, what is the best filter to use?

from:(*@domain1.com OR *@domain2.com)

Thanks

Andy

unread,
Mar 8, 2017, 5:50:12 PM3/8/17
to [gmail-power-users]
On Wed, Mar 8, 2017 at 10:45 AM, Sabian <sabia...@gmail.com> wrote:
I want to create a filter that adds a label to all emails that are received from more than one specific domain name.

So for example any emails from:


​I have never seen an email sent from two senders at once.  I don't think it is possible.

Is that really what you meant?  Or did you mean that you want to filter emails sent from EITHER of those two domains?  That would be "or," not "and".

from:(*@domain1.com OR *@domain2.com)

​That would find emails sent from either domain.  Make sure the "OR" is with capital letters, as you used.

Don't use "*" as a wildcard.  Gmail doesn't use wildcards.  (Fortunately, I think it ignores "*" if you used it in a filter.)

You can filter like that using either the "From" field or the "Has the words" field.  In other words, you could write this into the "From" field:

   "@domain1.com" OR "@domain2.com"

or you could write this in the "Has the words" field:

   from:("@domain1.com" OR "@domain2.com")

and they should do the same exact thing.  In fact, if you go back to the filter and check it later, you might find that it has converted your filter from one form to the other, because they really are equivalent.

I have a habit of using quotes around email addresses, because (long ago) I found that Gmail sometimes didn't keep them together.  e.g., filtering with @domain1.com would also match @domain1.org.  Quotes seemed to fix that.  But Gmail's filters might have improved since then and the quotes might be unnecessary.  But they don't hurt.

Regards,
Andy


Reply all
Reply to author
Forward
0 new messages