Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I run a choir consisting of a few friends (12 to be precise) and we tend to communicate via mass email to each other.

I want to set up a filter in GMail so that it will label all emails to do with the choir.

My problem is that filtering based on a list of who the message was sent to doesn't work because each time exactly one name will be missing from the recipient list - the email sender!

Can I set up a GMail filter that triggers if a list of addresses contains the sender and recipients?


Edit:

I could do this with a series of filters such as:

  FROM: <Person1> TO: <Person2> .. <Person12>
  FROM: <Person2> TO: <Person1>, <Person3> .. <Person12>
  ...
  FROM: <Person12> TO: <Person1> .. <Person11>

But that seems overly laborious.

share|improve this question
3  
It's not strictly an answer to your query, but you may want to consider setting up a mailing list (e.g. Google Groups), and get everyone to send mail to that address. It would make it easier to apply filters in the future, but does require opt-in from the rest of the group. –  Margaret Jul 1 '10 at 8:43

4 Answers 4

up vote 3 down vote accepted

Here's a bit of generalization for a real-world scenario that's likely to occur...

I am a member in several groups that partially overlap. For some of those, setting up a Google group as suggested above is not applicable.

Some mails do not involve all the members, so simply including everyone in the to: section will not work either.

To differentiate and tag them I use filters with a disjunction of all group members in the from: section, and disjunction of partial-groups' conjunctions in the to: section, e.g:

If a group includes members {a,b,c,me}, I'll use:
  from:(a OR b OR c OR me) AND to:((a AND b) OR (a AND c) OR (a AND me) OR (b AND c) OR (b AND me) OR (c AND me))
Or shorthand:
  from:(a|b|c|me) to:((a b)|(a c)|(a me)|(b c)|(b me)|(c me))

Notes:

  1. The space char, of course, defaults to AND, but for some reason the vertical bar (|) also works as OR, even though I found no documentation for it on Gmail.

  2. For large groups I don't include all subgroups ("n choose k" can become quite big here :) ...in such cases I suggest using the most likely "sub-sub-groups":

    • those that have a specific function
    • or are more likely to interact with each other
    • or key members within the group that appear in most/all mails

    ...and then update your filter if you notice any mail that was not detected.

  3. In the specific case where all group members are included in every email, the only sub-group is the entire group... using the above example's definitions that would be:
    from:(a|b|c|me) to:(a b c me).

  4. Dropping the from: section altogether can be beneficial in cases where the group is contacted by "outsiders", i.e.: consultants/contributors/sources/dependents/etc.. in a specific project, for example:
    The (group of) event organizers is likely to stay largely constant from one project to the next, while the sub-contractors employed in any specific event may change.

    A word of caution! dropping the from: section can also lead to (more) false positives.

Hope that helps :)

share|improve this answer
    
Just seen this now, much more complete than my answer! Thanks –  Mark Pim Apr 2 at 21:05

Ah, according to Gmail's help 'Using advanced search' I should be able to write

(from:<Person1> OR to:<Person1>) (from:<Person2> OR to:<Person2>) ...

in the 'Has the words' field.

I shall try this...

share|improve this answer
    
This doesn't seem like a great solution. You should be able to be: (from:group[choir]) and if the sender is in the group:choir then it should filter appropriately (label it or whatever) –  Nathan Koop Jul 9 '10 at 16:15

the filter for the sender is "from:" ... combine that with the other recipients.

share|improve this answer
    
But I want to be able to say 'FROM or TO: <address1>, <address2> ...', not just 'FROM <address1>' and 'TO <address2>'. Is that possible? –  Mark Pim Jul 1 '10 at 9:12
    
"FROM: a1 OR a2 OR a3" "TO: a1 OR a2 OR a3" –  akira Jul 1 '10 at 9:29
    
That will find any email between me and any one of the people in the choir, not those between all of us. See my edit... –  Mark Pim Jul 1 '10 at 10:54

Try this (OR is not needed if we enclose the email addresses within braces and just use spaces between addresses). I think that akira's answer should have solved the problem.

FROM:{sender1 sender2 sender3 sender4 sender5 sender6 sender7 sender8 sender9 sender10 sender11 sender12}
TO:{recipient1 recipient2 recipient3 recipient4 recipient5 recipient6 recipient7 recipient8 recipient9 recipient10 recipient11 recipient12}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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