当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 1 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : amavisd-new+spamassassin
帖子发表于 : 2009-06-06 15:38 

注册: 2008-10-09 10:04
帖子: 63
送出感谢: 0 次
接收感谢: 0 次
反病毒/内容过滤配置



安装amavisd-new

# aptitude install amavisd-new



开启内容过滤功能,去掉注释符

# nano /etc/amavis/conf.d/15-content_filter_mode

@bypass_spam_checks_maps = (

\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);

1; # insure a defined return


安装spamassassin

# aptitude install spamassassin

# nano /etc/spamassassin/local.cf

# How many hits before a message is considered spam.

required_score 6.0

rewrite_header Subject ****SPAM****



whitelist_from *163.com *@anti-lie.com

score USER_IN_BLACKLIST 20.00

#score USER_IN_WHITELIST -1200.0



header RCVD_IN_PBL eval:check_rbl('pbl', 'pbl.spamhaus.org.', '127.0.0.11')

describe RCVD_IN_PBL Received via a relay in pbl.spamhaus.org

tflags RCVD_IN_PBL net

score RCVD_IN_PBL 20



#CBL-#

header RCVD_IN_CBLLESS eval:check_rbl('cblless', 'cblless.anti-spam.org.cn.', '127.0.8.5')

describe RCVD_IN_CBLLESS Received via a relay in cblless.anti-spam.org.cn

tflags RCVD_IN_CBLLESS net

score RCVD_IN_CBLLESS 4.5

header RCVD_IN_XBL eval:check_rbl('sbl-xbl', 'xbl.spamhaus.org.', '127.0.0.4')

describe RCVD_IN_XBL Received via a relay in xbl.spamhaus.org

tflags RCVD_IN_XBL net

score RCVD_IN_XBL 15.5

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)

report_safe 0



# Enable the Bayes system

use_bayes 1

# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)

report_safe 0



# 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




增加Chinese_rules.cf支持

wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf

由于该规则每周更新一次,为了达到最好效果,最好在crontab里增加自动更新的内容,输入:

/usr/bin/crontab -e

然后输入如下的内容:

0 0 1 * * wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf; /etc/init.d/amavisd restart



配置Postfix 集成amavisd-new

# nano /etc/postfix/master.cf

增加如下内容:

127.0.0.1:10025 inet n - n - - smtpd
-o content_filter=
-o local_recipient_maps=
-o relay_recipient_maps=
-o smtpd_restriction_classes=
-o smtpd_client_restrictions=
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o mynetworks=127.0.0.0/8
-o strict_rfc821_envelopes=yes
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o receive_override_options=





编辑/etc/postfix/main.cf

# Content-Filter
content_filter = smtp:[127.0.0.1]:10024
receive_override_options = no_address_mappings






重启postfix amavis


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 1 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译