斩断Linux邮件服务器的垃圾邮件魔掌

互联网 | 编辑: 杨剑锋 2007-08-06 14:33:00转载 一键看全文

编辑配置文件
配置

就像大多数Linux应用程序一样,SpamAssasin需要对配置文件的编辑。这个配置文件位于/etc/mail/spamassassin/ ,名为local.cf。在你手动编辑配置文件之前,可注意一下,Michael Moncur 已经编写的一个出色的工具SpamAssassin Configuration Generator,它可以帮助用户创建local.cf文件。不过,这个工具目前只能在SpamAssasin 3.x中工作。

这个工具提供基于web的选项套件,可以帮助用户创建自己的配置文件。在选取了Mr. Moncur 创建的简单选项后,按下“Generate”:

# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)
# How many hits before a message is considered spam.
required_score 7.5
# Change the subject of suspected spam
rewrite_header subject *****SPAM*****
# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 1
# Enable the Bayes system
use_bayes 1
# Enable Bayes auto-learning
bayes_auto_learn 1
# Enable or disable network checks
skip_rbl_checks 0
use_razor2 1
use_dcc 1
use_pyzor 1
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages all
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales all

 

下面对我们逐一分析:

Score Threshold(评价界限 ): threshold的值越低,就会有更少的邮件通过。默认值为6。不过你要注意:如果你将此项设置过低,一些合法的电子邮件也会被当作垃圾邮件加以阻止。

Rewrite Message Subjects(重写消息主题):通过这个选项,你可以配置SpamAssassin用你选择的任何对象来编辑电子邮件的主题行。默认值设置为:*****SPAM*****

Use Auto Learning(使用自动学习): SpamAssassin可以通过分析具有一定评价的消息,去自动化地整理其Bayes(贝叶斯)数据库,这个评价强烈地显示了消息是垃圾还是非垃圾消息。

Enable RBL Checks(启用RBL检查):选择SpamAssassin是否应使用RBLS(DNS黑名单)。这有助于检测难于检测的垃圾信息,但需要消耗一些时间、网络带宽以及一个可用的DNS服务器。

Use Network Checksum Tests(使用网络检查和检验):选择是否使用将消息检查和(Checksum)与已知的垃圾邮件相比较的服务:这些服务有:Vipul's Razor 2.x、 DCC、 Pyzor等,不过只有当每种服务的客户端软件安装时这些服务才能正常工作。(即通过use_razor2, use_dcc, use_pyzor进行)。

Languages(语言):最后两种配置是关于语言的,第一个是哪些语言应检查。默认选项是所有的语言。笔者建议您不要修改。

如果你使用Mr.Moncur的应用程序创建你的.cf文件,请将其存放在/etc/mail/spamassassin/ ,然后启动spamassassin应用程序。要想运行spamassassin,必须以根用户身份运行如下的命令:

/etc/rc.d/init.d/spamassassin start

注意:根据你的发布版本的不同,spamassassin可能位于/etc/init.d/ 。

启动并运行spamassassin之后,你可能会想到在每次启动时此程序都会启动运行。你可以使用system-config-services这个应用程序,或者检查启用spamassassin选项。如果用户没有system-config-services这个软件,可以在/etc/rc.local文件中增加如下的内容:

/etc/rc.d/init.d/spamassassin start
或者
/etc/init.d/spamassassin start

这依赖于你可执行SpamAssassin所处的位置。(下一页)

提示:试试键盘 “← →” 可以实现快速翻页 

一键看全文

本文导航

相关阅读

每日精选

点击查看更多

首页 手机 数码相机 笔记本 游戏 DIY硬件 硬件外设 办公中心 数字家电 平板电脑