How do I create a filter in gmail like the following :

from:amy OR to:amy

Is it possible to create this kind of filter using the "Create new filter wizard" or do I have to manually edit the filters. If so, how?

So, far what I am able to do is create something like following, which is AND operation.

from:amy to:amy
  • So your saying you want to know how to make the filter an OR condition rather then an and condition? – ComputerLocus Apr 29 '12 at 22:51
  • @fogest exactly. – Quazi Irfan Apr 29 '12 at 22:58

To make an or condition just simply make two filters. It's possible to use the or condition in one of the lines for example:

From: a@a.com OR b@b.com

But you cannot have an OR statement for two different fields such as From and To.

I believe creating two filters though one, containing only the from and the other containing only the to. Yes it may require a few more seconds of work but that's the best your going to get for now.

OR try this:

  1. Create or modify a filter.
  2. In the Has the words field, enter your OR condition. For example: to:user@example.com OR From:user@example.com
  • To make an or condition just simply make two filters, yep so far this is what I've been doing, i don't like it at all. That' why posted this question here. I'll leave the question open for some time any other answers. – Quazi Irfan Apr 29 '12 at 23:07
  • @iamcreasy I found another question similar to your but less specific. Will edit my question in with a answer that may help you more. – ComputerLocus Apr 29 '12 at 23:16
  • Noup, doesn't work. I guess, Has the words field doesn't take query. – Quazi Irfan Apr 30 '12 at 0:17
  • @iamcreasy so you made sure that you did it just like the example? If that doesn't work then unfortunately you will need to just create two filters. – ComputerLocus Apr 30 '12 at 0:22
  • I noticed something strange, GMail add up two condition like they were on their respective field. – Quazi Irfan Apr 30 '12 at 0:30

You can filter on any search query string at all. Simply type the search query

from:amy OR to:amy

into the search box, then click the dropdown arrow to open the options, and click the link to "create filter with this search."

Alternatively, you can enter any query with search operators in the "has the words" field. Feel free to get complicated:

((from:amy -to:mom) OR (to:amy -from:me)) -subject:halloween
  • When I click "create filter with this search" with from:amy OR to:amy, the query gets messed up, and becomes something like this, from:amy to:amy OR. – Quazi Irfan May 7 '12 at 20:46
  • 1
    I agree with @Sarah. These steps work as described for me. The filter ends up in the "Has the words" box. If yours is changing for some reason in an odd way, try just typing "from:amy OR to:amy" into the "Has the words" box at that point in the Create Filter wizard. I think that may help. – Shannon Wagner May 8 '12 at 10:14

You don't need the OR at all: simply put the a@a.com into "Has the words" field and it returns them all, both to: and from:

  • Yes, that's another way. :) Thank you. – Quazi Irfan Jun 23 '13 at 3:28

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.