mailscanner配置笔记

3.vi /etc/MailScanner/rules/spam.whitelist.rules
From: 192.168.0.1 yes
From: aiobox.net yes
From: 127.0.0.1 yes
FromOrTo: default no
把自己的domain加入白名單中,無論如何自己的Domain都不會被判定為是spam,但還是會受到其他檢驗程序的檢查,例如ClamAV。

4.vi /etc/MailScanner/rules/scan.messages.rules (若檔案不存在就自己加)
From: 192.168.0.1 no
From: example.com.tw no
From: 127.0.0.1 no
FromOrTo: default yes
讓自己的Domain發出的信件,不用受到任何MailScanner檢驗程序的檢查。

5.vi /etc/MailScanner/MailScanner.conf
%org-name% = www.aiobox.net
%org-long-name% = www.aiobox.net
%web-site% = www.aiobox.net
Scan Messages = %rules-dir%/scan.messages.rules
Virus Scanning = yes
Virus Scanners = clamav
Still Deliver Silent Viruses = no
Monitors for ClamAV Updates = /var/lib/clamav/*.cvd
(ClamAV所使用的防毒資料庫所在位置)

Sign Clean Messages = no (不在任何正常的郵件中簽署MailScanner標記)
Mark Unscanned Messages = no (不在任何未經掃瞄的郵件中簽署MailScanner標記)
Notify Senders = no (不傳送spam rejection message 給sender)
Virus Subject Text = {病毒信}
Filename Subject Text = {檔名有誤}
Content Subject Text = {內含危險程式碼}
Size Subject Text = {檔案大小不合規定}
Disarmed Subject Text = {已去除危險程式碼}
Phishing Modify Subject = yes <= 此功能預設是關閉
Phishing Subject Text = {詐騙郵件}
Spam Subject Text = {可能是廣告信}
High Scoring Spam Subject Text = {廣告信}
Archive Mail = /var/spool/mail/backup
(將所有的郵件以mbox格式備份至檔案,檔案必須事先建立)

Send Notices = no <= 發現有問題的信件時,不通知管理員。
Use SpamAssassin = yes
Required SpamAssassin Score = 5
High SpamAssassin Score = 10

以下選項是為了之後可以使用MailScanner-MRTG繪製圖表:
Log Speed = yes
Log Spam = yes
Log Silent Viruses = yes
Log Dangerous HTML Tags = yes

6.啟動MailScanner:
service sendmail stop
chkconfig sendmail off
service MailScanner start
chkconfig MailScanner on

Comments are closed.