Orange is my favorite color

DSPAM is a Bayesian-based server-side spam filtering software. It learns based upon user input to be deadly accurate with almost zero false matches. It is free and integrates with a number of mail servers.

On our servers, we use Qmail with vpopmail for virtual domain mail handling. This setup is widely used and very robust.

Unfortunately, there are no public webpages describing how to make Dspam work with Qmail that can be found via Google. This post provides Qmail users with the bits they need to get up to speed.

The secret sauce is in installing safecat as the mail delivery agent and using the following build syntax for DSPAM:

./configure --with-local-delivery-agent='/usr/local/bin/safecat Maildir/tmp Maildir/new' --with-userdir=/var/dspam --with-db4-includes=/usr/local/BerkeleyDB.4.1/include --with-dspam-owner=vpopmail --with-dspam-group=vchkpw --with-userdir-owner=vpopmail --with-userdir-group=vchkpw

Once installed, each user directory can have a .qmail file with the following syntax to use DSPAM:

|/usr/local/bin/dspam --user $EXT

This approach allows you to place the .qmail file into each user directory. Each user should also have a <username>-spam alias they can forward spam to so that DSPAM learns what each user considers spam:

|/usr/local/bin/dspam --user $EXT --addspam

Remember, Bayesian filters define spam on a per-user basis. If one user thinks that email from Amazon is spam and flags it as such, that user will stop receiving Amazon mail and the rest of the users on the system will be unaffected. If you aren’t using vpopmail and want just normal delivery, you can use the following build syntax (provided by Doug Miller and Tom Hartley):

./configure --with-local-delivery-agent='/usr/local/bin/safecat $HOME/Maildir/tmp $HOME/Maildir/new' --with-userdir=/var/dspam --with-db4-includes=/usr/local/BerkeleyDB.4.1./include

These tips should bridge the gap between the DSPAM documentation and Qmail documentation.

Update 7/24/03: It seems as though including preline in the .qmail file may break certain clients such a Lotus Notes. Removing the preline command should work just fine:

|/usr/local/bin/dspam --user $EXT

Comments are closed.