procmail
[Top] [All Lists]

Re: Filter Question

2002-01-26 15:53:55

On Sat, Jan 26, 2002 at 05:30:16PM -0500, Tim Holmes wrote:

# This filter is for all mail I send myself.
:0:
*^From:.*(tim(h)|tdh)@(domain1.com|domain2.com|domain1.net|domain1.org|domain2.org)
tdh

This basically matches wither timh or tdh at any of the domains.

My main email address is timh(_at_)domain1(_dot_)net(_dot_)  But I also have 
another email
address that I use for consulting etc; which is this email address,
tim(_at_)unixtechs(_dot_)org(_dot_)

I *THOUGHT* I could just use tim(h) to capture timh(_at_)domain1(_dot_)com and
tim(_at_)unixtechs(_dot_)org(_dot_)  But it doesn't seem to work that way.  I 
have both
domains specified in my filter.

I later changed the filter to included both userIDs like so:

*^From:.*(tim|timh|tdh)@((domain1.com|domain2.com|domain1.net|domain1.org|domain2.org)

What you probably want is:

* 
^From:.*(timh?|tdh)@(domain1.com|domain2.com|domain1.net|domain1.org|domain2.org)

which basically says that the 'h' is optional.  Question marks indicate
that the preceding "atom" may be repeated 0 or 1 times.  An atom is
either a character, or a block of regexp enclosed in round brackets.
So "timh?" is the same as "tim(h)?", but "tim(h)" equals "timh".

-- 
  Paul Chvostek                                             
<paul(_at_)it(_dot_)ca>
  Operations / Development / Abuse / Whatever       vox: +1 416 598-0000
  it.canada                                            http://www.it.ca/

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>