1、安装dspam

以下为软件的存放目录:/root/rpm ,安装和配置全部以root身份进行

shell

# cd /root/rpm
# rpm -ivh libdspam-3.8.0-10ext.i386.rpm
# rpm -ivh dspam-3.8.0-10ext.i386.rpm
# rpm -ivh dspam-mysql-3.8.0-10ext.i386.rpm

2、创建dspam所需的数据库

shell

# cd /usr/share/dspam/sql/mysql/
# mysql -u root -p -e "create database dspam"
# mysql -u root -p -e "grant all on dspam.* to dspam@localhost identified by 'dspam'"
# mysql -u dspam -pdspam dspam < mysql_objects-4.1.sql
# mysql -u dspam -pdspam dspam < virtual_users.sql

3、DSPAM的token数据库的定时清理:

shell

# crontab -e

加入以下内容:

0 0 * * * /usr/bin/mysql -u dspam -p'dspam' dspam < /usr/share/dspam/sql/mysql/purge-4.1.sql
0 0 * * * /usr/bin/dspam_logrotate -a 30 -d /var/spool/dspam/data

4、配置 dspam.conf 文件

shell

# vi /etc/dspam/dspam.conf

内容如下:

Home /var/spool/dspam
StorageDriver /usr/lib/libmysql_drv.so
TrustedDeliveryAgent "/usr/sbin/sendmail"
OnFail error
DeliveryHost        127.0.0.1
DeliveryPort        10024
DeliveryIdent       localhost
DeliveryProto       SMTP
Trust root
Trust dspam
Trust extmail
TrainingMode teft
TestConditionalTraining on
Feature whitelist
Algorithm graham burton
Tokenizer chain
PValue bcr
WebStats on
Preference "signatureLocation=headers"  # 'message' or 'headers'
Preference "showFactors=off"
AllowOverride trainingMode
AllowOverride spamAction spamSubject
AllowOverride statisticalSedation
AllowOverride enableBNR
AllowOverride enableWhitelist
AllowOverride signatureLocation
AllowOverride showFactors
AllowOverride optIn optOut
AllowOverride whitelistThreshold
MySQLUIDInSignature    on
MySQLServer     /var/lib/mysql/mysql.sock
MySQLUser               dspam
MySQLPass               dspam
MySQLDb                 dspam
MySQLCompress           true
MySQLConnectionCache   10
Notifications   off
PurgeSignatures 14          # Stale signatures
PurgeNeutral    90          # Tokens with neutralish probabilities
PurgeUnused     90          # Unused tokens
PurgeHapaxes    30          # Tokens with less than 5 hits (hapaxes)
PurgeHits1S     15          # Tokens with only 1 spam hit
PurgeHits1I     15          # Tokens with only 1 innocent hit
LocalMX 127.0.0.1
SystemLog on
UserLog   on
Opt out
MaxMessageSize 1048576
ServerHost             127.0.0.1
ServerPort              10028
ServerQueueSize 32
ServerPID               /var/spool/dspam/dspamd.pid
ServerMode              auto
ServerPass.Relay1       "secret"
ServerParameters        "--user extmail --deliver=innocent,spam"
ServerIdent             "localhost.localdomain"
ClientHost      127.0.0.1
ClientPort      10028
ClientIdent     "secret@Relay1"
ProcessorURLContext on
ProcessorBias on

5、启动 dspam 后台进程:

shell

# chkconfig dspamd on
# /etc/init.d/dspamd start

查看dspam启动进程

shell

# ps aux |grep dspam

是否返回以下信息

dspam    18407  0.0  0.5  5452 1344 pts/0    S    19:16   0:00 /usr/sbin/dspamd --daemon
root     18412  0.0  0.2  5140  668 pts/0    S+   19:17   0:00 grep dspamd
 
二、配置_dspam.txt · 最后更改: 2013/04/10 17:29 由 shaobo
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki