procmail
[Top] [All Lists]

Re: furrin character sets

2003-02-25 00:39:43
At 17:53 2003-02-24 -0800, Chuck Harding wrote:

OK, so the recipes at the end of furrin.rc set SPAMMISHNESS and ISSPAM to
possibly some value > 0 if the regexp matches - I am just now getting into
using scoring in some of my recipes and was wondering if making the condition
line be something like * ${SPAMMISHNESS}^0 or & ${ISSPAM}^0 would deliver the
message into the attendant folder if SPAMMISHNESS is indeed greater than zero, or am I off base B-( as to how to use it?

Note that what I'm doing there isn't inherently "scoring" - it's a number I'm collecting in the form of an equation: "+25+300+80-50" or whatever, and then resolving into a final value, and taking action on (and yea, THAT recipe uses scoring).

Well, as previously discussed in the "spammish" thread, there are different methods of collecting up a sum of spammish values. I utilize something which is straightforward and thus easy to maintain:

# resolve spammishness _only_ if the string is _set_
:0
* ! SPAMMISHNESS ?? ^^^^
{
        # First, we have some mailing lists which should get "adjusted"
        # (but only bother doing this if SPAMMISHNESS was even an issue,
        # since if it isn't, then we don't waste the extra cycles).
        # This is only intended to reduce spammishness on these lists,
        # because some technical discussions can end up looking pretty
        # spammish at times.  LISTNAME is extracted earlier.
        :0
        * LISTNAME ?? ^^(names|of|lists)^^
        {
                SPAMMISHNESS="${SPAMMISHNESS}-150"
        }

        # prefix the lot with zero to make it a proper equation
        # ie: 0+25+300  vs  +25+300
        SPAMMISHNESS=`echo "0${SPAMMISHNESS}" | bc`

        # Now, SPAMMISHNESS is a simple sum.  However, it could be negative
        # or zero, in which case, the message isn't spammy and we don't want
        # to even _see_ the score logging for it (in my case, "SPAM:" is
        # extracted from the logs for a daily report).

        :0
        * $ ${SPAMMISHNESS}^0
        {

SPAMNOTES="SPAM: Advisory - spammishness is ${SPAMMISHNESS}${NL}"

                # is it more than our (defined) threshold?
                :0
                * $ -${SPAMTHRESHOLD}^0
                * $ ${SPAMMISHNESS}^0
                {
                        ISSPAM=1
SPAMMNOTES="${SPAMNOTES}SPAM: Message exceeds threshold of ${SPAMTHRESHOLD}${NL}"
                }
        }
}

# Lastly, emit collected spam notes and if spam, toss it.
# any actual spam will have defined a spamnotes line.

:0
* ! SPAMNOTES ?? ^^^^
{
        LOG="${SPAMNOTES}${SPAMVER}"
}

:0:
* ISSPAM ?? ^^(1|yes)^^
| gzip -9fc >> spam.gz

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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