2\建立mysql用户及数据库
cd src/tools.mysql_drv
mysql -u root -p -e "create database dspam"
mysql -u root -p -e "grant all on dspam.* to dspam@localhost identified by '123456'"
vi mysql_objects-4.1.sql
增加一行内容到最上面:
use dspam;
vi virtual_users.sql
增加一行内容到最上面:
use dspam;
mysql -u dspam -p
mysql -u dspam -p
cp purge-4.1.sql /usr/local/dspam/var/dspam/purge.sql
crontab -e
15 23 * * * /usr/bin/mysql -u dspam -p'123456' dspam
30 23 * * * dspam /usr/local/dspam/bin/dspam_logrotate -a 30 -d /usr/local/dspam/var/dspam/data
3\配置 dspam
vi /usr/etc/dspam.conf
TrustedDeliveryAgent /usr/sbin/sendmail
Trust dspam
Trust postfix
Preference "spamAction=quarantine"
Preference "signatureLocation=headers" # 'message' or 'headers'
Preference "showFactors=on"
#Preference "spamAction=tag" //此参数注释掉,否则不能更改message handling.
Preference "spamSubject=SPAM"
ServerMode auto
ServerParameters "--deliver=innocent"
ServerIdent "localhost.localdomain"
ServerPID /var/run/dspam.pid
ServerDomainSocketPath "/tmp/dspam.sock"
Start dspam : /usr/bin/dspam --daemon &
Configure Postfix to use a content filter
修改master.cf
smtp inet n - n - - smtpd
To:
smtp inet n - n - - smtpd
-o content_filter=dspam:
# -o content_filter=lmtp:unix:/tmp/dspam.sock