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 dscl . -create /Users/_dspam
sudo dscl . -create /Users/_dspam UserShell /usr/bin/false
sudo dscl . -create /Users/_dspam UniqueID 101
sudo dscl . -create /Users/_dspam PrimaryGroupID 101
sudo dscl . -create /Users/_dspam NFSHomeDirectory /usr/local/var/dspam
sudo dscl . -passwd /Users/_dspam ”

Get the source code from the DSPAM project site and extract the archive and you can start compiling (instructions have been tested with 3.9.0):

For 64 bits systems use:

CFLAGS="-g -arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="" \
./configure \
  --with-storage-driver=hash_drv,mysql_drv \
  --with-mysql-includes=/usr/local/mysql/include/mysql \
  --with-mysql-libraries=/usr/local/mysql/lib/mysql \
  --enable-preferences-extension \
  --with-dspam-home-owner=_dspam \
  --with-dspam-home-group=_postfix \
  --with-dspam-home=/usr/local/var/dspam \
  --enable-long-usernames \
  --with-dspam-group=postfix \
  --enable-domain-scale \
  --enable-virtual-users \
  --enable-debug \
  --enable-verbose-debug \
  --enable-daemon \
  --enable-syslog \
  --disable-large-scale \
  --disable-external-lookup \
  --disable-clamav \
  --disable-homedir \

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

sudo make install