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



發佈了26 篇原創文章 · 獲贊 4 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章