postfix反垃圾邮件

postfix反垃圾邮件

#安装spamassassin 软件包

rpm -qa|grep spamassassin
 

yum install spamassassin*


chkconfig spamassassin on

#spamassassin 与 postfix 整合编辑postfix 主配置文件


vim /etc/postfix/main.cf

mailbox_command = /usr/bin/procmail -a "EXTENSION"

stict_rfc821_envelopes = yes

smtpd_helo_required = yes

smtpd_client_restrictions = reject_rbl_client cblless.anti-spam.org.cn #增加中国反垃圾邮件黑名单列表

head_checks = regexp:/etc/postfix/header_checks  #开启邮件头检查功能

header_checks = pcre:/etc/postfix/header_checks.pcre #开启邮件过滤表达式

vim /etc/postfix/header_checks #去掉如下注释

/etc/postfix/header_checks.pcre:
        /^Content-(Disposition|Type).*name\s*=\s*"?(.*(\.|=2E)(
        ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|
        hlp|ht[at]|
        inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|
        \{[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}\}|
        ops|pcd|pif|prf|reg|sc[frt]|sh[bsm]|swf|
        vb[esx]?|vxd|ws[cfh]))(\?=)?"?\s*(;|$)/x
        REJECT Attachment name "$2" may not end with ".$4"

 /etc/postfix/main.cf:
        body_checks = regexp:/etc/postfix/body_checks

 /etc/postfix/body_checks:
        /^<iframe src=(3D)?cid:.* height=(3D)?0 width=(3D)?0>$/
         REJECT IFRAME vulnerability exploit

#新加  /^Subject: reject-me /REJECT You asked for it



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值