前情提要:郵件伺服器Part-3:MailScanner-mrtg
郵件伺服器全系列:Postfix+Dovecot+SASL+Procmail+Postgrey+Mailscanner+Spamassassin+ClamAV+Mailscanner-mrtg+MailWatch+Openwebmail+MySPAM
MailWatch蒐集MailScanner郵件過濾的判定紀錄,可用於分析、管理規則的設定
1.安裝MYSQL及相關元件
2.安裝PHP及相關元件
3.設定啟動服務
chkconfig mysqld on
4.啟動服務
service httpd start
5.設定MYSQL密碼
6.設定PHP
safe_mode = Off
register_globals = Off
magic_quotes_gpc = On
magic_quotes_runtime = Off
session.auto_start = 0
7.安裝MailWatch
下載http://sourceforge.net/project/showfiles.php?group_id=87163
8.建立資料庫
mysql -p < create.sql
產生mailscanner資料庫並建立資料表
9.修改MailWatch資料庫設定
my($db_host) = ‘localhost’; (資料庫位置)
my($db_user) = ‘root’; (使用者名稱)
my($db_pass) = ‘xxxxxx′; (使用者密碼)
10.複製設定檔
11.新增網頁使用者
11.設置網頁檔案
12.修改網頁權限
chown root:apache images
chmod ug+rwx images
chown root:apache images/cache
chmod ug+rwx images/cache
12.複製設定檔
13.設定conf.php
define(DB_USER, ‘root’);
define(DB_PASS, ‘xxxxxx');
define(DB_HOST, ‘localhost’);
define(DB_NAME, ‘mailscanner’);
14.設定MailScanner
Quarantine Group = apache (this should be the same group as your web server)
Quarantine Permissions = 0660
Quarantine Whole Message = yes
Quarantine Whole Message As Queue Files = no
Detailed Spam Report = yes
Include Scores In SpamAssassin Report = yes
Always Looked Up Last = &MailWatchLogging
15.設定黑白名單
my($db_host) = 'localhost';
my($db_user) = 'root';
my($db_pass) = '!Q@W#E$R';
Is Definitely Spam = &SQLBlacklist
16. 修改SpamAssassin設定
加入
bayes_file_mode 0660
17.建立新的bayes目錄
chown root:apache /etc/MailScanner/bayes
chmod g+rws /etc/MailScanner/bayes
18.複製已經存在的bayes資料庫
chown root:apache /etc/MailScanner/bayes/bayes_*
chmod g+rw /etc/MailScanner/bayes/bayes_*
19.測試SpamAssassin
20.重新啟動MailScanner
備註:
◎網頁中文化
檔案 http://csc.ocean-pioneer.com/docum/mailscanner.tar.gz
下載後覆蓋即可,中文測試時有些設定功能會失效,可能是版本不同造成的。
◎改網頁編碼
若顯示Big5中文會出現亂碼,可以在/etc/httpd/conf.d下建立設定檔案
<Location /mailscanner>
Order allow,deny
allow from all
AddDefaultCharset Big5
</Location>
下集預告:郵件伺服器 Part-5:OpenWebMail