procmail
[Top] [All Lists]

Re: Combining Recipes into One

1997-04-22 20:22:00
procmail 3.10 under SunOS 4.1.4.  The answer is probably staring me
right in the face even after reading the man pages, so please go easy
on me.  In the never-ending battle against spam, among other things I
have the following three recipes in sequence:

:0:
* !^TOpobart(_at_)access[1-5]*\(_dot_)digex\(_dot_)net
IN.xdiscard

:0:
* Subject:.*(\$|free|cash|money)
IN.xdiscard

:0:
* From:.*(@cyber|@interramp\.com|@hotmail\.com)
IN.xdiscard

Try this:

:0
* (!^TOpobart(_at_)access[1-5]*\(_dot_)digex\(_dot_)net|\
   ^Subject:.*(\$|free|cash|money)|\
   ^From.*(@cyber|@interramp\.com|@hotmail\.com))
IN.xdiscard

I don't think you need a local lockfile for this, so the :0: shouldn't
be necessary.  (Someone PLEASE correct me if I'm wrong about this.)
Otherwise, Procmail is quite happy to have headers included in 
situations where you are checking for alternate conditions like this,
and doesn't seem to mind nested () either.  I use them quite a bit.

These conditions do strike me as a bit overbroad, though -- I've had
legitimate mail from places with names beginning with "cyber" and
from hotmail, and certainly might with the words "free", "cash", or 
"money".  You might want to look into Procmail's scoring capabilities --


--
Catherine Hampton <ariel(_at_)tempest(_dot_)boxmail(_dot_)com>
============================================================
Human Rights Web:                       http://www.hrweb.org
Orthodox Christianity:   http://www.best.com/~ariel/orthodox
REVEAL:                                http://www.reveal.org
Personal Home Page:              http://www.best.com/~ariel/

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