MailScanner相关规则设置

1、垃圾邮件白名单

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Is Definitely Not Spam = /etc/MailScanner/rules/whitelist.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/whitelist.rules
##添加被列入白名单的地址:
From:    [email protected]    yes
From:    *@domain.com    yes
##添加被列入黑名单的IP的地址
From:    192.168.1.    yes
From:    /^192\.168\.13[4567]\./    yes
FromOrTo:    default    no


2、垃圾邮件黑名单

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Is Definitely Spam = /etc/MailScanner/rules/blacklist.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/blacklist.rules
##添加被列入名单的地址:
From:    [email protected]    yes
From:    *@domain.com    yes
##添加被列入黑名单的IP的地址
From:    192.16.8.1.    yes
FromOrTo:    default    no

 

3、对发送的邮件进行签名

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Sign Clean Messages = /etc/MailScanner/rules/signing.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/signing.rules
##添加发送的域名
From:    *@domain.com    yes
##添加IP地址
From:    192.168.1.    yes
FromOrTo:    default    no


4、对不同的域使用不同的签名

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Inline Text Signature = /etc/MailScanner/rules/sig.text.rules
Inline HTML Signature = /etc/MailScanner/rules/sig.html.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/sig.text.rules
##添加不同的域
From:    *@domain1.com    /etc/MailScanner/reports/domain1.sig.txt
From:    *@domain2.com    /etc/MailScanner/reports/domain2.sig.txt
设置不同的域使用的HTML签名
# vi /etc/MailScanner/rules/sig.html.rules
##添加不同的域
From:    *@domain1.com    /etc/MailScanner/reports/domain1.sig.html
From:    *@domain2.com    /etc/MailScanner/reports/domain2.sig.html


5、只对某些域进行病毒扫描

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Virus Scanning = /etc/MailScanner/rules/virus.scanning.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/virus.scanning.rules
FromOrTo:    *@domain.com    yes
FromOrTo:    default    no


6、给多个人发送管理员通知

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Notices To = /etc/MailScanner/rules/notices.to.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/notices.to.rules
##增加地址
To: @domain1.com [email protected] [email protected]
To: @domain2.com [email protected] [email protected]
FromOrTo:    default    [email protected]


7、只隔离某些病毒

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Quarantine Infections = /etc/MailScanner/rules/quarantine.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/quarantine.rules
##增加病毒名称
Virus: sobig    no
Virus: default    yes


8、在规则中使用两个条件

编辑Mailscanner配置文件
# vi /etc/Mailscanner/Mailscanner.conf
Spam Actions = /etc/MailScanner/rules/spam.actions.rules
规则文件格式如下:
# vi /etc/MailScanner/rules/spam.actions.rules
##增加条件
From:    domain.com and To: user@*    deliver
FromOrTo:    domain1.com and FromOrTo:    domain2.com    deliver
FromOrTo:    default    store notify


9、使用perl匹配更高级的规则:

规则文件格式如下:
##匹配 [email protected]以及[email protected]
From:    /[\@\.]domain\.com$/    yes
##匹配所有 .gov 
From:    /\.gov$/    yes
##匹配德国或丹麦的域
From:    host:/(de|dk)$/    yes


10、设置邮件大小

规则文件格式如下:
# vi /etc/MailScanner/rules/max.message.size.rules
To:    *@domain1.com    10M
To:    *@domain2.com    20M
From:    [email protected]    5M
From:    *@domain3.com    500K
FromOrTo:    default    0

你可能感兴趣的:(Scanner)