1、Spam是一个让人讨厌的字眼. 大部分的人都不喜欢它. 如果你想保护自己免受spam, 你就需要安装SpamAssassin.
因我在安装系统的时候已经选择好了SpamAssassin。现在我们将其升级到最新版:
cd /home/pkg
rpm -Uvh spamassassin-3.0.2-2.1.el3.rf.i386.rpm
还需要安装另外一个软件包:
rpm -Uvh perl-Razor-Agent-2.40-2.i386.rpm
2、手动安装
[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) |
3、自动安装
[root@linuxas3 src]# perl -MCPAN -e shell
cpan> install Mail::SpamAssassin
default text: [the administrator of that system]
chmod 755 /usr/share/spamassassin
/usr/bin/make install -- OK
cpan>
#修改起动脚本使spamassassin支持vpopmail
#修改如下一行:
vi /etc/init.d/spamassassin
SPAMDOPTIONS="-d -c -m5 -H -x -u spamd -v"
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 restart;/etc/init.d/spamassassin restart;
#建立SpamAssassin的学习系统
sa-learn --sync -D -p user_prefs
#查看自学习的数据信息
sa-learn --dump all
#查看调试信息
spamassassin --lint –D
注:spamassassin要配合其它的邮件代理或服务器使用!
阅读(1384) | 评论(0) | 转发(0) |