This page describes how I integrate my spam filter (dspam) into my IMAP server (dovecot) and the more generic plugin for dovecot I developed. More historic information is on the dovecot/dspam integration page.

Rationale

We all want spam filtering, I want it on my server, so my webmail is already filtered. I get approximately 2500 spam mails per month, and many more that don't make it through my SMTP front lines. I use dspam because it has a much lower footprint than SpamAssassin, and also because it succeeds in catching almost all of my spam with virtually no false positives.

Additionally, most spam filters need training. In order to be able to train with as little overhead as possible, I want to simply be able to move false positives out of the spam folder and false negatives into it. This leads to the concept of integrating the spam retraining process into the IMAP server.

Even if I'm using dspam, the antispam plugin now has the concept of backends with different ways to call the spam filter retraining so it should be easy to adopt for other spam filters. In fact, there is a backend that simply sends the misclassified messages to two email addresses for reclassification, this is simple to use with existing setups.

Usage for end users

move mail into SPAM folder to classify as spam

move mail out of SPAM folder to classify as not spam

Backends

The plugin internally supports different backends. Please see the BACKENDS section in the man page for the full list of backends.

Using the plugin

Other requirements

This project is a tool to train a mail classifier. It is absolutely necessary to also run the classifier, which is out of scope. Please try to understand exactly what this plugin does, and also what it does not do. Note that the classifier must be run before the email reaches dovecot, typically as part of the mail delivery process. The setup for this depends on the MDA you use.