procmail
[Top] [All Lists]

Re: Sorting senders

1999-07-10 08:18:39
Raden Oktova <oktova(_at_)itp(_dot_)uni-hannover(_dot_)de> writes:
Hi, I'm new with procmail. I've set up a mailing list using procmail and
it's fine except that I can't get rid of all uninvited email senders. That
part of .procmailrc which I expect can filter out unregistered persons
is:
**************************************
:0
* ^To(_dot_)*oktova(_at_)my(_dot_)students(_dot_)domain(_dot_)name
* ^From.*member1            
* ^From.*member2
 ...
* ^From.*memberx
!member1,\
member2,\
member3,\
...
memberx
************************************************* 

works just as if all of the * ^From's were not there, the mails get sent
no matter if the senders are member1...x or not.
Would someone please explain why, and how to make it work?

First of all, recipe conditions are 'and'ed, such that the above recipe
should only match if the message matches _all_ of those regexps.  If
you want it to match when the message is from member1 OR member2 OR ..
memberN, then you should use a condition like this:

    * ^From[: ](.*[^-a-z0-9_])?(member1|member2|...|memberN)([^-a-z0-9_]|$)

The "[: ]" makes the recipe only match against the From: and "From "
lines in the header.  The "(.*[^-a-z0-9_])?" restricts the character
right before the member's address to be something besides a letter,
number, minus sign, or underbar.  The trailing "([^-a-z0-9_]|$)"
restricts the character immeadiately after the member's address to be
something besides a letter, number, minus sign, or underbar, or to be
the end of the header field.


Philip Guenther

<Prev in Thread] Current Thread [Next in Thread>
  • Re: Sorting senders, Philip Guenther <=