====== dspam v3.0 for qmail =====
./configure --enable-long-usernames --enable-large-scale --enable-virtual-users --with-dspam-home=/var/qmail/maildirs/dspam --with-dspam-home-owner=vmail --with-dspam-home-group=vmail --with-storage-driver=mysql_drv --with-mysql-includes=/usr/include/mysql
make && make install
Download gadoyanspam v0.3
Change the Makefile to match your location of the dspam source
DSPAM3_DIR = ../dspam-3.0.0
Compile with:
make
and copy gadoyanspam to /var/qmail/bin (or some other convenient place in your path).
Configure your mysql database according to the instructions in dspam-3.0.0/tools.mysql_drv. You may want to change the table type from MyISAM to InnoDB to try and improve on the default full-table locking.
Create the file /var/qmail/maildirs/dspam/mysql.data with the values you used to set up the mysql database/user.
127.0.0.1
3306
dspam3
password
dspam3
I use qmail-ldap, so I add gadoyanspam to the DeliveyProgramPath of my LDAP record. You can also add gadoyanspam to your .qmail file. You will also want to create user.spam@domain.com and user.notspam@domain.com email aliases for your account which will be used to train the global DSPAM corpus.
Use watch dspam_stats as mail passes through to see if DSPAM/gadoyanspam are being hit.
Set up a cron entry to clean the dspam corpus. Copy tools.mysql/purge.sql to /var/qmail/maildirs/dspam and add an entry to cron like the following:
<code>
0 0 * * * mysql -h 127.0.0.1 -u dspam -ppassword dspam < /var/qmail/maildirs/dspam/purge.sql; /usr/local/bin/dspam_clean -s0 -p -u
</code>
You may want to add root (and maybe others) to the trusted.users file
echo root > /var/qmail/maildirs/dspam/trusted.users