Postfix -> DSPAM -> Amavis/Spamassassin -> Postfix
Spamassassin can add scores depending on the DSPAM output by reading the headers that DSPAM adds.
These rules can be added to local.cf. They read confidence and result headers. Edit the scores to suit your setup.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# DSPAM RULES ############### # Confidence # header DSPAM_CONFIDENCE_8X X-DSPAM-Confidence =~ /^0.8/ describe DSPAM_SPAM_8X DSPAM is moderately confident score DSPAM_CONFIDENCE_8X 0.001 header DSPAM_CONFIDENCE_9X X-DSPAM-Confidence =~ /^0.9[0-8]/ describe DSPAM_SPAM_9X DSPAM is very confident score DSPAM_CONFIDENCE_9X 0.001 header DSPAM_CONFIDENCE_99 X-DSPAM-Confidence =~ /^0.99/ describe DSPAM_SPAM_99 DSPAM is extremely confident score DSPAM_CONFIDENCE_99 0.001 # Spam # header DSPAM_SPAM X-DSPAM-Result =~ /^Spam$/ describe DSPAM_SPAM DSPAM claims it is spam score DSPAM_SPAM 5 meta DSPAM_SPAM_8X (DSPAM_SPAM && DSPAM_CONFIDENCE_8X) score DSPAM_SPAM_8X 1.5 meta DSPAM_SPAM_9X (DSPAM_SPAM && DSPAM_CONFIDENCE_9X) score DSPAM_SPAM_9X 3.0 meta DSPAM_SPAM_99 (DSPAM_SPAM && DSPAM_CONFIDENCE_99) score DSPAM_SPAM_99 5.0 # Ham # header DSPAM_HAM X-DSPAM-Result =~ /^Innocent$/ describe DSPAM_HAM DSPAM claims it is ham score DSPAM_HAM -0.1 meta DSPAM_HAM_9X (DSPAM_HAM && DSPAM_CONFIDENCE_9X) score DSPAM_HAM_9X -1.5 meta DSPAM_HAM_99 (DSPAM_HAM && DSPAM_CONFIDENCE_99) score DSPAM_HAM_99 -5.0 # Whitelist # header DSPAM_WHITELIST X-DSPAM-Result =~ /^Whitelisted$/ describe DSPAM_WHITELIST DSPAM has whitelisted this mail score DSPAM_WHITELIST -2.0 meta DSPAM_WHITELIST_9X (DSPAM_WHITELIST && DSPAM_CONFIDENCE_9X) score DSPAM_WHITELIST_9X -1.5 meta DSPAM_WHITELIST_99 (DSPAM_WHITELIST && DSPAM_CONFIDENCE_99) score DSPAM_WHITELIST_99 -5.0 |
Thanks for the tip. What is your default SPAM cutoff score? Is it greater than 5.0? Otherwise, “score DSPAM_SPAM 5” will always trigger spam (unless negative factors kick in), and the rules like DSPAM_SPAM_9X won’t have any additional effect, except to drive the score higher?
Debian installation of Spamassassin defaulted to a hit score of 6.31. Seems a bit random, but thats what I worked from.