diff --git a/plugins/dspam/dspam_ b/plugins/dspam/dspam_ index f1771a06..5f95927e 100755 --- a/plugins/dspam/dspam_ +++ b/plugins/dspam/dspam_ @@ -234,13 +234,17 @@ update_statefile() { debug starting $dspam_stats -t -S local t_start=$(date +%s) - $dspam_stats -t -S | while read a b c d e f g h i j k l x; do + $dspam_stats -t -S | while read a b c d e f g h i j k l m x; do # example of output format (3.9.1 rc1) for each user: #username@example.org # TP: 0 TN: 2147 FP: 0 FN: 53 SC: 0 NC: 0 # SHR: 0.00% HSR: 0.00% OCA: 97.59% + # or for short user names: + #vmail TP: 1141 TN: 459 FP: 0 FN: 5 SC: 0 NC: 0 + # SHR: 99.56% HSR: 0.00% OCA: 99.69% + case $a in TP:) # the 2nd line @@ -262,6 +266,8 @@ update_statefile() { *) # the 1st line local uid=$a + # data from 2nd line is also here + [ "$b" = "TP:" ] && local tp=$c tn=$e fp=$g fn=$i sc=$k nc=$m ;; esac done @@ -495,7 +501,7 @@ print_fetch() { if [ -n "$pattern" ]; then debug env.pattern was set, so use it: $pattern continue - elif [ $target == "ALL" ]; then + elif [ $target = "ALL" ]; then local pattern="-v TOTAL" debug target=ALL: need pattern for all users, but not for TOTAL: $pattern else