您的位置:首页 > 运维架构 > Linux

postfix反垃圾邮件

2015-06-11 17:08 666 查看
[align=center]postfix反垃圾邮件
[/align]

[align=left]#安装spamassassin 软件包
[/align]

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

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息