procmail
[Top] [All Lists]

Re: Procmail Newbie

2004-10-18 01:02:47
Bikrant Neupane wrote:

Hi

This is something I would like to implement using procmail. I would like to read the X-Spam-Score value and compare that value against some predefined value. Basically what I am trying to implement is to filter Mails based on X-Spam-Score value. I belive someone has done that before. Only thing I am not sure is how to do is 1. return value from an external script and save it in procmail variable.
2. Numerica test such as if ( x > 2)

my ~.procmail.rc

DIR="~bikrant/Maildir/"
MAILDIR=$HOME/Maildir/
DEFAULT=$MAILDIR/tmp

:0fw
| /usr/local/bin/getScore   #i can call script but how to read return value??
If you use :0fhw, then the script can modify the mail headers. This is how most spam filters get called.

:0:
* if [ $ScoreRead >= $MinScore ] #how to implement it in procmail ?
${DIR}.SPAM/
From the sample description it sounds like you may be using SpamAssassin, which includes multiple headers including an X-Spam-Status status header with a Yes/No flag (and you can tweak the threshold level at which SpamAssassin marks a mail as spam).

Or, you could use patterns that match the scores, for example assuming you want scores equal to or higher than 2.0 considered spam you could use

:0
* X-Spam-Score: [2-9]
spam

--
Klaus Johannes Rusch
KlausRusch(_at_)atmedia(_dot_)net
http://www.atmedia.net/KlausRusch/


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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