Revision of DSPAM from Thu, 05/10/2012 - 12:21

Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.

DSPAM is a scalable and open-source content-based spam filter designed for multi-user enterprise systems. DSPAM is an adaptive filter which means it is capable of learning and adapting to each user's email. Instead of working off of a list of "rules" to identify spam, DSPAM's probabilistic engine examines the content of each message and learns what type of content the user deems as spam (or nonspam).

Prerequisites

  • MySQL
  • Apache webserver, compiled with:
    ./configure \
    --enable-so \
    --enable-ssl \
    --enable-rewrite \
    --enable-suexec \
    --with-suexec-docroot=/var/websites

    Before you compile, edit support/suexec.h and change the AP_HTTPD_USER from the default "www" to the "nobody" that our Apache install instructions use:

    #define AP_HTTPD_USER "nobody"
    #define AP_UID_MIN 99
    #define AP_GID_MIN 99

Installation

cd /extra/src
wget http://cdnetworks-us-2.dl.sourceforge.net/project/dspam/dspam/dspam-3.10.2/dspam-3.10.2.tar.gz
tar zxf dspam-3.10.2.tar.gz
cd dspam-3.10.2

Configure it:

export LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql:${LD_LIBRARY_PATH}
./configure \
--with-storage-driver=mysql_drv \
--with-mysql-libraries=/usr/local/mysql/lib/mysql \
--with-mysql-includes=/usr/local/mysql/include/mysql \
--enable-preferences-extension \
--enable-virtual-users \
--enable-daemon \
--enable-debug \
--enable-verbose-debug \
--with-dspam-home=/var/dspam \
--with-dspam-home-owner=simscan \
--with-dspam-home-group=simscan \
--with-dspam-owner=simscan \
--with-dspam-group=simscan \
--enable-domain-scale \
--without-delivery-agent

Build and install the binaries:

make && make install

Set up MySQL database and tables:

cd src/tools.mysql_drv
/usr/local/mysql/bin/mysqladmin -u root -p create dspamdb
cat mysql_objects-speed.sql | /usr/local/mysql/bin/mysql -u root -p dspamdb
cat virtual_users.sql | /usr/local/mysql/bin/mysql -u root -p dspamdb

Log into MySQL and assign a password for simscan to us the dspam database:

/usr/local/mysql/bin/mysql -u root -p
grant all privileges on dspamdb.* to simscan@localhost identified by 'password';
flush privileges;
exit

Of course, change "password" to something meaningful.Be aware that the user simscan has ALL privileges (including the ability to delete the database) unless you do something otherwise.

Create the file that allows DSPAM to access the database:

cd /var/dspam

Create the following file called mysql.data, again changing "password":

/tmp/mysql.sock

simscan
password
dspamdb

Create the trusted.users file:

cd /var/dspam
echo "simscan" >trusted.users

If simscan hasn't been installed yet, add a user for it:

groupadd simscan
useradd -g simscan -s /bin/false -c "SimScan Content Filter" simscan

Change the permissions on the Dspam install so that the Simscan user can access it:

chown -R simscan:simscan /var/dspam
chown simscan:simscan /usr/local/etc/dspam.conf
chown simscan:simscan /usr/local/bin/dspam

No such feature 'chained'
The default configuration fo dspam gave a No such feature 'chained' error in the SMTP service logs. Edit /usr/local/etc/dspam.conf and change the tokenizer from chain to word:

Tokenizer word

NOTES
None of that stuff worked the latest time I did this. Had to add Trust simscan and Trust qmaild to /usr/local/etc/dspam.conf as well as putting the MySQL info in that conf file as well.
Additional References
http://hmonteiro.net/howtos:qmail:qmail_plus_dspam
http://hmonteiro.net/patches:dspam_external_lookup
http://www.wimble.info/articles/dspam-qmail-vpopmail.php
http://gentoo-wiki.com/Dspam_vpopmail
http://www.directadmin.com/forum/showthread.php?t=16015
http://wiki.lnxgeek.org/doku.php/howtos:mailserver#dspam_training_mode
http://www.easyweb.co.uk/Members/martin/blog/Blog_Post.2004-08-11.8452654600
http://mail.michscimfd.com/dspam/
http://switch.richard5.net/isp-in-a-box-v2/setting-up-dspam/training-dspam-with-scripts/

Recent Updates

  • 1 year 1 week ago
    1.27.2 update
  • 1 year 3 weeks ago
    Drupal 10/11 config
  • 1 year 3 weeks ago
  • PHP
    1 year 3 weeks ago
    PHP 8.3.11 and AlmaLinux
  • 1 year 3 weeks ago
    New version of Pound
Error | Production Monkeys

Error

The website encountered an unexpected error. Please try again later.