postfix反垃圾邮件

来源:互联网 发布:北大青鸟java培训课程 编辑:程序博客网 时间:2024/06/06 13:01
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



0 0
原创粉丝点击