User Tools

Site Tools


doc:appunti:linux:sa:spamassassin

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:linux:sa:spamassassin [2021/04/21 16:02] – [Regole personalizzate] niccolodoc:appunti:linux:sa:spamassassin [2021/07/08 12:19] (current) – [Verifica punteggio] niccolo
Line 192: Line 192:
 I test network sono disabilitati se il demone **spamd** viene avviato con l'opzione **''%%-L%%''** oppure **''%%--local%%''**. I test network sono disabilitati se il demone **spamd** viene avviato con l'opzione **''%%-L%%''** oppure **''%%--local%%''**.
  
 +===== Verifica punteggio =====
 +
 +Con il seguente script dovrebbe essere possibile verificare il punteggio associato per ciascun test:
 +
 +<code bash>
 +#!/bin/sh
 +TESTS="$1"
 +if [ -z "$TESTS" ]; then
 +    echo "Usage: $(basename $0) [rule1,rule2,...]"
 +    exit 1
 +fi
 +cat << EOF
 +
 +=== Punteggio SpamAssassin ===
 +
 +  * Test Bayes e network disabilitati
 +  * Test Bayes disabilitati, test network abilitati
 +  * Test Bayes abilitati, test network disabilitati
 +  * >>> Test Bayes e network abilitati
 +
 +EOF
 +TESTS="$(echo "$TESTS" | sed 's/,/ /g')"
 +for TEST in $TESTS; do
 +    find /var/lib/spamassassin/ -name "*scores.cf" | while read file; do
 +        SCORE="$(egrep "^score\s+${TEST}\b" "$file")"
 +        if [ -n "$SCORE" ]; then
 +            #echo "$SCORE"
 +            RULE="$(echo "$SCORE" | awk '{print $2}')"
 +            SCORE1="$(echo "$SCORE" | awk '{print $3}')"
 +            SCORE2="$(echo "$SCORE" | awk '{print $4}')"
 +            SCORE3="$(echo "$SCORE" | awk '{print $5}')"
 +            SCORE4="$(echo "$SCORE" | awk '{print $6}')"
 +            printf '%-25s %7.2f %7.2f %7.2f %7.2f\n' "$RULE" "$SCORE1" "$SCORE2" "$SCORE3" "$SCORE4"
 +        fi
 +    done
 +done
 +</code>
 +
 +Ecco un esempio di utilizzo:
 +
 +<code>
 +./spamassassin-score-print HELO_NO_DOMAIN,HTML_MESSAGE,NICE_REPLY_A,RDNS_NONE,SPF_FAIL
 +
 +=== Punteggio SpamAssassin ===
 +
 +  * Test Bayes e network disabilitati
 +  * Test Bayes disabilitati, test network abilitati
 +  * Test Bayes abilitati, test network disabilitati
 +  * >>> Test Bayes e network abilitati
 +
 +HELO_NO_DOMAIN               0.00    4.40    0.00    4.40
 +HTML_MESSAGE                 0.00    0.00    0.00    0.00
 +NICE_REPLY_A                -0.25   -0.00   -0.25   -0.00
 +RDNS_NONE                    2.40    1.27    1.23    0.79
 +SPF_FAIL                     0.00    0.92    0.00    0.00
 +</code>
 ==== Client spamc e IPv6 ==== ==== Client spamc e IPv6 ====
  
doc/appunti/linux/sa/spamassassin.1619013729.txt.gz · Last modified: 2021/04/21 16:02 by niccolo