Dovecot Anti-Spam Plugin

Credits

Various bits of code, scripts, and procedures were put together with information from John Simpson's qmail.jms1.net website. It's an excellent resource on managing and setting up a Qmail server.

The antispam plugin allows you to retrain the spam filter by simply moving emails in and out of the Spam folder.

cd /extra/src
wget -O dovecot-antispam-plugin.tar.gz http://hg.dovecot.org/dovecot-antispam-plugin/archive/tip.tar.gz
tar zxf dovecot-antispam-plugin.tar.gz
cd dovecot-antispam-plugin-5ebc6aae4d7c

Configure and build it:

ACLOCAL='aclocal -I /usr/local/share/aclocal' ./autogen.sh
./configure --prefix=/usr/local
make
make install

To configure it, edit /usr/local/etc/dovecot/conf.d/90-plugin.conf:

antispam_backend = dspam
antispam_spam = Spam.MissedSpam
antispam_trash = trash;Trash;Deleted Items;Deleted Messages
antispam_dspam_binary = /usr/local/bin/dspam
antispam_signature = X-DSPAM-Signature

To enable the plugin, edit /usr/local/etc/dovecot/conf.d/20-imap.conf and add it to the mail_plugins list:

protocol imap {
  mail_plugins = $mail_plugins antispam
}

To enable debugging, add to /usr/local/etc/dovecot/conf.d/90-plugin.conf:

antispam_debug_target = stdout
antispam_verbose_debug = 1

Recent Updates

  • 6 months 3 weeks ago
    1.27.2 update
  • 7 months 5 days ago
    Drupal 10/11 config
  • 7 months 6 days ago
  • PHP
    7 months 6 days ago
    PHP 8.3.11 and AlmaLinux
  • 7 months 6 days ago
    New version of Pound