To configure DSPAM we need to edit the default configuration file dspam.conf
in /usr/local/etc/
. I’m only showing you the changes i made to the default settings otherwise it would be a long list of settings. You can always download my dspam.conf from the bottom of the page.
# to insert the email back into postfix: DeliveryHost 127.0.0.1 DeliveryPort 10026 DeliveryIdent localhost DeliveryProto SMTP Trust dspam Trust postfix Trust www # get all the info we need to check if it all works. # You can comment this out when it works as expected Debug * Preference "signatureLocation=headers" Preference "showFactors=on" Preference "spamAction=tag" Preference "spamSubject=[SPAM]" # access to the database: MySQLServer /tmp/mysql.sock MySQLPort 3306 MySQLUser dspam MySQLPass yourpassword MySQLDb dspam MySQLCompress true MySQLVirtualTable dspam_virtual_uids MySQLVirtualUIDField uid MySQLVirtualUsernameField username MySQLUIDInSignature on SystemLog on UserLog on ParseToHeaders on ChangeModeOnParse on ChangeUserOnParse full ServerPID /var/run/dspam.pid ServerParameters "--deliver=innocent, spam" ServerIdent "localhost.local"
I’ve decided, until I get the webgui or some other solution working, every email will be delivered. Spam email will be tagged in the subject with [SPAM] which you can filter out with your email client to be put into the Trash or a separate directory.
Next we need to administer the proper rights to the executable, please execute the following command:
sudo chmod o+x /usr/local/bin/dspam
Now we can continue to configure Postfix to use DSPAM
as a filter.
Resources:
dspam.conf, download and copy into /usr/local/etc/ and change the database password.