Bowie Bailey wrote:
Kris Deugau wrote:
Ken A wrote:
Is there any way to ask spamassassin what the score of a particular
rule is? I have rules here and there, and would like to be able to
easily look up the score of a rule without grepping all over the
place.
Pass a mail that you know triggers the rule in question through
spamassassin -t?

Obviously that doesn't help if you can't find such a message...

Most of the time though, "grep [rule name] /usr/share/spamassassin/*"
will turn up what you're looking for - unless it's a third-party rule,
in which case you'd need to search /etc/[mail/]spamassassin/* too.

-kgd

You could create a shell script to do it for you:

    #!/bin/sh
    grep -i -h ^score[[:space:]]*$1 \
        /usr/share/spamassassin/50_scores.cf \
        /etc/mail/spamassassin/*.cf

Drop it into your home directory, or /usr/local/bin, or wherever.

    $ ./findscore J_CHICKENPOX_91
    score    J_CHICKENPOX_91  0.6



That's pretty much what I'm doing now. I modified it a bit, so it just gives one score if there are several found, giving preference to the local rules in /etc/mail/spamassassin.

#!/bin/sh

grep -i -h ^score[[:space:]]*$1 /etc/mail/spamassassin/*.cf
if [ $? == 1 ]; then
grep -i -h ^score[[:space:]]*$1 /usr/share/spamassassin/50_scores.cf
fi

I was hoping there was a way to ask SA for this info, but this is usable.
Thanks,
Ken

Reply via email to