环境在centos5.2 键盘的安装手册环境下。extmail1.05b
一安装,主要参考疯狂老头的部分
./configure \
--enable-daemon \
--enable-clamav \
--enable-debug \
--enable-syslog \
--enable-preferences-extension \
--enable-long-usernames \
--enable-domain-scale \
--enable-virtual-users \
--with-dspam-home-owner=dspam \
--with-dspam-home-group=postfix \
--with-dspam-mode=2510 \
--with-dspam-owner=dspam \
--with-dspam-group=postfix \
--with-storage-driver=mysql_drv \
--with-mysql-includes=/usr/include/mysql \
--with-mysql-libraries=/usr/lib/mysql \
--with-logdir=/var/log/dspam \
--prefix=/usr/local/dspam \
--with-delivery-agent=/usr/sbin/sendmail
# make
# make install
# 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_objects-4.1.sql
# mysql -u dspam -p < virtual_users.sql
# cp purge-4.1.sql /usr/local/dspam/var/dspam/purge.sql
# crontab -e
15 23 * * * /usr/bin/mysql -u dspam -p'123456' dspam < /usr/local/dspam/var/dspam/purge.sql
30 23 * * * dspam /usr/local/dspam/bin/dspam_logrotate -a 30 -d /usr/local/dspam/var/dspam/data
(二)配置 dspam
# vi /usr/local/dspam/etc/dspam.conf (以下只写出修改或增加的部分)
-------------------------------------------------------------------------------------------------------------
Trust dspam
Trust postfix
Preference "spamAction=quarantine"
Preference "signatureLocation=headers" # 'message' or 'headers'
Preference "showFactors=on"
Preference "spamAction=tag"
Preference "spamSubject=**SPAM**"
AllowOverride localStore
MySQLServer /var/lib/mysql/mysql.sock
MySQLUser dspam
MySQLPass 123456
MySQLDb dspam
MySQLCompress true
MySQLUIDInSignature on
#LocalMX 127.0.0.1
ParseToHeaders on
#ChangeModeOnParse on
#ChangeUserOnParse on
ChangeUserOnParse user
ClamAVPort 3310
ClamAVHost 127.0.0.1
ClamAVResponse accept
(三) 配置 postfix
# vi /etc/postfix/master.cf (以下只写出修改或增加的部分)
-------------------------------------------------------------------------------------------------------------
smtp inet n - n - - smtpd
-o content_filter=dspam:
dspam unix - n n - 10 pipe
flags=Rhqu user=dspam argv=/usr/local/dspam/bin/dspam --deliver=innocent --user $user -i -f $sender -- $recipient
spam unix - n n - 10 pipe
flags=Ru user=dspam argv=/usr/local/dspam/bin/dspam --class=spam --source=error --user dspam
notspam unix - n n - 10 pipe
flags=Ru user=dspam argv=/usr/local/dspam/bin/dspam --class=innocent --source=error --user dspam
# vi /etc/postfix/main.cf (以下只写出修改或增加的部分)
transport_maps = hash:/etc/postfix/transport
smtpd_client_restrictions = check_client_access hash:/etc/postfix/dspam_filter_access 这里是hash 他用的估计是正则表达
local_recipient_maps = proxy:unix:passwd.byname $transport_maps $alias_maps
dspam_destination_recipient_limit = 1
# vi /etc/postfix/dspam_filter_access (建立新的文件,空格用 tab 键)
/./ FILTER dspam:dspam
# vi /etc/postfix/transport (建立新的文件,空格用 tab 键)
icaot.com spam
notspam
# postmap transport
重新启动 postfix 服务
/etc/rc.d/init.d/postfix restart
二web界面的配置
mkdir /var/www/dspam
chown dspam:vgroup/var/www/dspam -R
这里需要看你的postfix用的是什么帐户 我的apache用的是vuser vgroup
把dspam源码中webui下的cig-bin整个目录拷贝到/var/www/dspam下拷贝webui htdocs 的base.css
和login.gif到cgi哪里
chown dspam:vgroup cgi-bin -R
htpasswd -c /var/www/dspam/htpasswd
echo "user@domain.com" >>/var/www/dspam/cgi-bin/admins
配置apache
DocumentRoot /var/www/dspam/cgi-bin
DirectoryIndex dspam.cgi
Options +ExecCGI
Addhandler cgi-script .cgi
Order deny,allow
Allow from all
AuthType Basic
AuthName "DSPAM Control Center"
AuthUserFile /var/www/dspam/passwd
Require valid-user
当时想用虚拟主机跑dspam但是配置也出了。不过用这种也行。。比较简单容易理解一点
阅读(1649) | 评论(0) | 转发(0) |