MBF Knowledge Base

How do I enable and configure DSPAM to be used with Zimbra?

Zimbra comes with DSPAM pre-installed. All you need to do is enable and configure it.

Enabling DSPAM for ZCS 5.0.11+:

zmlocalconfig -e amavis_dspam_enabled=true

The zmmtaconfig will automatically reload amavis within 2 minutes or you can run "zmamavisdctl reload" to have it take effect immediately.


Enabling DSPAM for ZCS 3.1+:

/opt/zimbra/conf/amavisd.conf.in

uncomment

#$dspam = '/opt/zimbra/dspam/bin/dspam';

zmamavisdctl stop

zmamavisdctl start

 

Adjusting the scoring:

With the default configuration amavis will use DSPAM to add a score of -1 for ham and positive 10 for spam. If you'd like to change that, here's how. Note that these changes may not persist across Zimbra upgrades, so be sure to back up any modifications you make.


Method 1:

Edit /opt/zimbra/conf/amavisd.conf.in

Locate the line %%uncomment LOCAL:amavis_dspam_enabled%% mail_body_size_limit => 64000, score_factor => 1

Change the value of score_factor from 1 to something else. Changing the score_factor to e.g. .1 will cause DSPAM to add a score of -0.1 (ham) or positive 1 (spam).

After you save the file, stop and start amavisd as above.


Method 2:

Let's say you want to change the scoring so that it uses -2 for ham and positive 4 for spam.

Edit /opt/zimbra/amavisd/sbin/amavisd

Locate the line: $spam_score = $dspam_result eq 'Spam' ? 10 : -1; # fabricated

and change to: $spam_score = $dspam_result eq 'Spam' ? 4 : -2; # fabricated

You may need to stop & start amavisd for this to take effect.