> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > ODHIAMBO Washington > Sent: Monday, August 11, 2003 10:16 PM > To: Spam Assassin > Subject: Re: [SAtalk] SA - Seems to not want to work :( > > > * Steve Thomas <[EMAIL PROTECTED]> [20030811 20:59]: wrote: > > On Mon, Aug 11, 2003 at 05:04:58PM +0100, Angel Gabriel is > rumored to have said: > > > > > > 2) Edited ~/.procmail file > > > > That should be ~/.procmailrc. > > > > > > > I still get all the spam I can handle. What have I missed, if > anything? > > > > > > > Also, remember that SA doesn't remove spam, it just adds > headers and such. > > Based on the above statement, I'm not sure if you're expecting > it to delete > > messages that it considers to be spam. > > > > While you guys are at it, does anyone have a procmail recipe that > would delete > spam based on numerical score???? >
The easiest way is to just look for X-Spam-Status, and set the cutoff appropriately in your user_prefs file, :0: * ^X-Spam-Status: Yes spam.mbox If you want to do different things with different levels of spam, the next easiest thing is to look for the number of '*'s in the X-Spam-Level header. # # file spams with a score of 15 or more into spam-for-sure. # :0: * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* spam-for-sure.mbox Just remember to backslash quote the '*'s. More difficult, is to parse the 'hits' value out of the X-Spam-Status header. :0: * ^X-Spam-Status:.*hits=\/[0-9.]+ * $ ? perl -e "exit !($MATCH > 4.5 && $MATCH < 6.5)" marginal-mail.mbox Above, everything to the right of \/ goes into the $MATCH variable. The $-sign on the perl invocation line tells procmail to honor shell quoting of double quotes, etc. The perl is expression is negated because a zero value of the exit status means 'success'. This pattern is a little contrived - to show that it is doing something that couldn't be done with just counting '*'s on X-Spam-Level. Note: these recipes haven't been checked out. I'd recommend putting the procmail commands you want to test in a small file, call it test.rc, for example that looks like this: MAILDIR=$HOME/test # Make sure this directory exists LOGABSTRACT=YES VERBOSE=YES DEFAULT=in.mbox # Something besides my real mailbox, it will be under $MAILDIR SENDMAIL= # To avoid accidentally sending stuff LOGFILE=$MAILDIR/spam.log # Look in this log file to see what happened NL=" " # Short-hand for newline, used in log messages. SA=/usr/bin/spamassassin # # Invoke Spamassassin # :0fw | $SA # Try your recipes :0: * ^X-Spam-Status:.*hits=\/[0-9.]+ * $ ? perl -e "exit !($MATCH > 4.5 && $MATCH < 6.5)" marginal-mail.mbox Then run your test.rc scipt on a single mail message: procmail test.rc < mail-test.msg And if that didn't destroy anything, you can try it on an mbox like this: formail -s procmail test.rc < mail-test.mbox ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk