You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "Reginaldo O. Andrade" <re...@totalalimentos.com.br> on 2005/06/02 13:37:32 UTC

Score an entire cf file

Hi, list!

    I'm developing a custom cf file to block messages with specific strings and I would like to know if is it possible to score an entire file with the same value without using the command "score RULE_NAME X.XX" for each rule in the archive.

    Thanks in advance.

Reginaldo O. Andrade
Network Administrator

Re: Score an entire cf file

Posted by Loren Wilton <lw...@earthlink.net>.
>    I'm developing a custom cf file to block messages with specific strings
and I would like to know if is it possible to score an entire file with the
same value without using the command "score RULE_NAME X.XX" for each rule in
the archive.

No.  You need a score per rule.  If you think about it, different rules hit
on different things, so they shouldn't all have the same score.

If you are feeling lazy, there are two things you might do:

1.    Don't give any scores.  All rules with names that don't start with
"__" get a default score of 1.

2.    Change all of the rule names to start with two underscores, and then
make one or several absolutely huge meta rules at the end that gather up all
of the rules into a single rule, then score it.

I don't recommend either of these actions.

        Loren


Re: Score an entire cf file

Posted by Rich Puhek <rp...@etnsystems.com>.
Reginaldo O. Andrade wrote:
> Hi, list!
>  
>     I'm developing a custom cf file to block messages with specific 
> strings and I would like to know if is it possible to score an entire 
> file with the same value without using the command "score RULE_NAME 
> X.XX" for each rule in the archive.
>  
>     Thanks in advance.
>  
> Reginaldo O. Andrade
> Network Administrator

One way to get the desired effect would be to do something like:

perl -ne 'next if /(^#)|(^describe)|(^score)|(^$)/; @a = split; print 
"score\t$a[1] 5.00\n";' somefile.cf >> local.cf

where "somefile.cf" is the rule file. Replace my sample score of 5.00 
with your desired score, and local.cf with your actual local.cf file 
location.

(actually, for your case, a temp file might be in order, then paste back 
into your file).

--Rich