postfix 安裝設定..略
安裝clamav
/usr/ports/security/clamav/
make install
除了預設值外,另外再勾選 [X]MILTER Compile the milter interface
更新病毒碼
/usr/local/etc/rc.d/clamav-freshclam onestart
預設路徑 /var/db/clamav/
修改/usr/local/etc/postfix/main.cf
#anti virus
smtpd_milters = unix:/var/run/clamav/clmilter.sock
啟動clamav
/usr/local/etc/rc.d/clamav-clamd onestart
/usr/local/etc/rc.d/clamav-milter onestart
重啟postfix
/usr/local/etc/rc.d/postfix restart
修改/etc/rc.conf
clamav_freshclam_enable="YES"
clamav_clamd_enable="YES"
clamav_milter_enable="YES"
測試病毒信,可以在eicar下載測試樣本
發現有病毒的信件不會退信,會放在queue中
86F2111FDF24! 1201 Tue Mar 10 13:28:14 xxx@xxx.xxx.xx
xxx@xxx.xxx.xx
maillog會出現以下類似訊息
Mar 10 13:28:14 xxx postfix/smtpd[68336]: 86F2111FDF24: client=unknown[10.1.1.1]
Mar 10 13:28:14 xxx postfix/cleanup[68229]: 86F2111FDF24: message-id=<54FE80ED.7070108@xxx.xxx.xx>
Mar 10 13:28:14 xxx postfix/cleanup[68229]: 86F2111FDF24: milter-hold: END-OF-MESSAGE from unknown[10.1.1.1]: milter triggers HOLD action; from=<xxx@xxx.xxx.xx> to=<xxx@xxx.xxx.xx> proto=ESMTP helo=<[10.2.2.2]>
如果要清理queue的話,可以下指令清理
postsuper -d ALL ,清理全部queue
或是
postsuper -d QueueID ,清理單一封
留言列表