分类:
2009-12-29 11:45:16
这个文章转自:http://blog.chinaunix.net/u/21067/showart_162994.html
还需要安装另外一个软件包:
rpm -Uvh perl-Razor-Agent-2.40-2.i386.rpm
[root@linuxas3 src]# cd Mail-SpamAssassin-2.63
[root@linuxas3 Mail-SpamAssassin-2.63]# export LC_ALL=C
[root@linuxas3 Mail-SpamAssassin-2.63]# perl Makefile.PL
[root@linuxas3 Mail-SpamAssassin-2.63]# make
[root@linuxas3 Mail-SpamAssassin-2.63]# make test
[root@linuxas3 Mail-SpamAssassin-2.63]# make install (as root) |
chmod 755 /usr/share/spamassassin
/usr/bin/make install — OK
cpan>
vi /etc/sysconfig/spamassassin
SPAMDOPTIONS=”-d -c -m5 -H -x -u spamd -v”
下图是我在安装SpamAssassin时所列出的perl模块,SpamAssassin所要用到的一些Perl模块是:
perl-Time-HiRes
perl-Digest-SHA1
perl-HTML-Parser
perl-DB_File
perl-HTML-Tagset
perl-Razor-Agent
perl-DBI
perl-Net-DNS
perl-URI
这些模块请安装上。
#spamassassin的过滤模板在/etc/mail/spamassassin/local.cf,修改为:
vi /etc/mail/spamassassin/local.cf
required_score 5.0
rewrite_header Subject ********SPAM********
report_safe 1
use_bayes 1
skip_rbl_checks 0
ok_languages zh en
ok_locales en ko
score HEAD_ILLEGAL_CHARS 0
score SUBJ_ILLEGAL_CHARS 0
score DATE_IN_PAST_03_06 0
score UPPERCASE_25_50 0
score UPPERCASE_50_75 0
score UPPERCASE_75_100 0
score X_MSMAIL_PRIORITY_HIGH 0
score X_PRIORITY_HIGH 0
score TO_TXT 100
score RATWARE_HASH_2 100
score RATWARE_HASH_2_V2 100
score BAYES_99 0.1
score BAYES_80 0.1
score BAYES_60 0.1
score FROM_ILLEGAL_CHARS 0.1
score MIME_BASE64_TEXT 0.1
score NO_RDNS_DOTCOM_HELO 0.1
score CHINA_HEADER 0.1
score NO_REAL_NAME 0.2
score HTML_MESSAGE 0.2
score MIME_HTML_ONLY 0.2
score MIME_HTML_ONLY_MULTI 0.2
score FORGED_MUA_OUTLOOK 0.2
score FORGED_HOTMAIL_RCVD 0.2
score FORGED_OUTLOOK_TAGS 0.2
score MAILTO_TO_SPAM_ADDR 0.2
#黑白名单
whitelist_from *@domain.com
# —————————————————————————
# 使用中国反垃圾邮件联盟的CBL/CDL
# URL:
header RCVD_IN_CBL eval:check_rbl(‘cbl’, ‘cbl.anti-spam.org.cn.’)
describe RCVD_IN_CBL Received via a relay in cbl.anti-spam.org.cn
tflags RCVD_IN_CBL net
header RCVD_IN_CDL eval:check_rbl(‘cdl-notfirsthop’, ‘cdl.anti-spam.org.cn.’)
describe RCVD_IN_CDL CDL: dialup sender did non-local SMTP
tflags RCVD_IN_CDL net
#SCORE
score RCVD_IN_CBL 4.0
score RCVD_IN_CDL 3.0
#运行ntsysv,将spamassassin设定的为开机运行
#使用CCERT 中文垃圾邮件过滤规则集Chinese_rules.cf
wget -N -P /usr/share/spamassassin
#启动SpamAssassin
service spamassassin start
#定期自动更新中文反垃圾邮件规则
crontab –e
#加入
0 0 1 * * wget -N -P /usr/share/spamassassin ….d/spamassassin restart;/etc/init.d/spamassassin restart;
#建立SpamAssassin的学习系统
sa-learn –sync -D -p user_prefs
#查看自学习的数据信息
sa-learn –dump all