Before we start there are some preliminaries to take care of. DSPAM needs a user account to run, but instead of creating a full user account using the preference pane we will create a simple user via the Terminal:

sudo niutil -create / /users/dspam
sudo niutil -createprop / /users/dspam uid 101
sudo niutil -createprop / /users/dspam gid 101
sudo niutil -createprop / /users/dspam shell “/usr/bin/false”
sudo niutil -createprop / /users/dspam home “/usr/local/var/dspam”
sudo niutil -createprop / /users/dspam passwd “*”

Get the source code from the DSPAM site and extract the archive and you can start compiling:

./configure --enable-daemon \
  --with-storage-driver=mysql_drv \
  --with-mysql-includes=/usr/local/mysql/include \
  --with-mysql-libraries=/usr/local/mysql/lib/mysql \
  --enable-preferences-extension \
  --with-dspam-home-owner=dspam \
  --with-dspam-home-group=postdrop \
  --with-dspam-home=/usr/local/var/dspam \
  --enable-long-usernames \
  --with-dspam-group=postdrop \
  --enable-mysql4-initialization \
  --enable-domain-scale \
  --enable-virtual-users \
  --enable-debug \

This configure, if everything went allright, can be followed by:

sudo make install

Next step: Creating the database for DSPAM