I have had dspam enabled for a year or so. Twice since I upgraded to 6.0.x, dspam began failing with segfaults. The first time, I reran zmtrainsa manually. Then, that didn't work. I tried cssclean, but it either did nothing, or gave a "cssclean failed on error -5" message. In /var/log/maillog, there was this error.
Code:
Jun 26 18:10:01 mail dspam[8943]: Unable to open file for reading: /usr/local/etc/dspam.conf: No such file or directory
I do not see an option to specify config file for cssclean, so it must be compiled in.
csscompress also failed to work. I tried the cssclean contained in the dspam 3.9.0 final release included with 6.0.7.1. Same error. (It looks like 6.0.8 is the same too.) I downloaded and manually compiled dspam 3.9.0, same problem. Finally, I got the head revisions for cssclean.c and csscompress.c and recompiled.
Those versions worked. And fixed the segfaults. They are newer than the versions contained in 3.9.0, and are available
here and
here.
I then made an entry in the Zimbra crontab, to run dspam css maintenance monthly:
Code:
# Monthly maintenance of dspam hash db
0 4 * * 7 [ $(date +\%e) -le 7 ] && /opt/zimbra/libexec/dspam_css_maintenance.sh
This runs the dspam maintenance script on the first Sunday of every month. Here is that script:
Code:
#!/bin/bash
# DSPAM maintenance script. It cleans and compresses the DSPAM hash db.
MAIL="it@somewhere.com"
# Disable dspam, temporarily
zmlocalconfig -u amavis_dspam_enabled
#zmamavisdctl restart
# Run cssclean and csscompress
/opt/zimbra/dspam/bin/cssclean /opt/zimbra/data/dspam/data/z/i/zimbra/zimbra.css > /var/log/dspam_css_maintenance.log
echo >> /var/log/dspam_css_maintenance.log
echo Compress >> /var/log/dspam_css_maintenance.log
echo -------- >> /var/log/dspam_css_maintenance.log
/opt/zimbra/dspam/bin/csscompress /opt/zimbra/data/dspam/data/z/i/zimbra/zimbra.css >> /var/log/dspam_css_maintenance.log
# Reenable dspam
zmlocalconfig -e amavis_dspam_enabled=true
#zmamavisdctl restart
# Run cssstats, and mail results
echo >> /var/log/dspam_css_maintenance.log
echo Stats >> /var/log/dspam_css_maintenance.log
echo ----- >> /var/log/dspam_css_maintenance.log
/opt/zimbra/dspam/bin/cssstat /opt/zimbra/data/dspam/data/z/i/zimbra/zimbra.css >> /var/log/dspam_css_maintenance.log
mail -s "Monthly dspam maintenance" "$MAIL" </var/log/dspam_css_maintenance.log
I know dspam is still not officially supported, but it seems like maintenance of the Zimbra dspam hash db's should be included in the Zimbra cronjob (commented out if necessary), and that the css hash utilities should work. There are already a few RFEs concerning dspam, not sure if I want to add one.