procmail
[Top] [All Lists]

Re: Newbie question

2003-04-24 15:26:35
On Thu, Apr 24, 2003 at 10:20:31PM +0100, Anders Karlsson wrote:

SpamAssassin kindly scores the messages it filters, and I wanted to
sort spam after a specific fashion. I consider things with a score
between 5 and 12 to be a possible false positive, so I want to look
through them.  I also consider things with a high score a source of
amusement, so I want to look through them as well. Things between a
low and high watermark I don't mind showing in a folder and forget
about until every sunday afternoon when I have time to scan through
subjects in case there was something that sneaked through.

As I thought of this and found it useful, I thought I should share.


# Recepie to filter out spam between Score 12 and 50
:0
* ^X-Spam-Flag:.*YES
{
  SCORE=`formail -c -xX-Spam-Level | tr -d ' ' | wc -c`
  :0
  * ? [ $SCORE -gt 12 ] && [ $SCORE -lt 60 ]
  CrapMail.mbox
}


Okay, your wish is laudable enough.  Let's do it all inside
procmail rather than forking a shell and doing formail, tr,
and wc.


        :0
        * ^X-Spam-Status: Yes, hits=\/[0-9.]+
        {
            SCORE = $MATCH
            THRESHOLD = 60  # reset this value as you wish

            :0:
            * $      $SCORE^0
            *     0.0000001^0
            * $ -$THRESHOLD^0
            funnyspam


            THRESHOLD = 12  # reset this value as you wish

            :0:
            * $      $SCORE^0
            *     0.0000001^0
            * $ -$THRESHOLD^0
            unfunnyspam


            :0:
            seemstobespam
        }

-- 
dman

_______________________________________________
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>