The Will Will Web

記載著 Will 在網路世界的學習心得與技術分享

Ubuntu 8.04 設定 Mail Filtering 的注意事項

最近在看 Ubuntu 線上手冊Mail Filtering 章節,這文章寫的真好,淺顯易懂,以前在設定 Postfix, Amavisd-new, Spamassassin, ClamAV 的時候,都要看一堆文件才安裝的起來,而現在都有人整理好標準作業流程(SOP)了。

我原本想說一步一步照著安裝、設定就會成功的,結果卻發生問題,我從 /var/log/mail.info 查出來的訊息是:

Jun 12 10:04:34 ubuntu804 postfix/smtpd[4705]: connect from unknown[10.0.0.29]
Jun 12 10:04:52 ubuntu804 postfix/smtpd[4705]: 90F9815E27B: client=unknown[10.0.0.29]
Jun 12 10:05:02 ubuntu804 postfix/cleanup[4710]: 90F9815E27B: message-id=<20080612020452.90F9815E27B@ubuntu804>
Jun 12 10:05:02 ubuntu804 postfix/qmgr[4703]: 90F9815E27B: from=<testaccount@yahoo.com>, size=356, nrcpt=1 (queue active)
Jun 12 10:05:02 ubuntu804 amavis[4637]: (04637-03) (!!)ask_av (ClamAV-clamd) FAILED - unexpected result: /var/lib/amavis/tmp/amavis-20080612T100502-04637/parts: lstat() failed. ERROR\n
Jun 12 10:05:02 ubuntu804 amavis[4637]: (04637-03) (!!)WARN: all primary virus scanners failed, considering backups
Jun 12 10:05:02 ubuntu804 amavis[4637]: (04637-03) (!!)TROUBLE in check_mail: virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED:
Jun 12 10:05:02 ubuntu804 amavis[4637]: (04637-03) (!)PRESERVING EVIDENCE in /var/lib/amavis/tmp/amavis-20080612T100502-04637
Jun 12 10:05:02 ubuntu804 postfix/smtp[4711]: 90F9815E27B: to=<test@test.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=17, delays=17/0.01/0.01/0.1, dsn=4.5.0, status=deferred (host 127.0.0.1[127.0.0.1] said: 451 4.5.0 ERROR in processing, id=04637-03, virus_scan FAILED: virus_scan: ALL VIRUS SCANNERS FAILED:  (in reply to end of DATA command))
Jun 12 10:05:04 ubuntu804 postfix/smtpd[4705]: disconnect from unknown[10.0.0.29]

在文件的 Configuration 小節的 ClamAV 部分有提到要將 amavis 使用者加入到 clamav 群組:

sudo adduser amavis clamav

不過好像也要將 clamav 使用者加入到 amavis 群組才能正常運作,不知道是文件寫反了?還是少寫了這一段?

反正最後只要多下個指令將 clamav 使用者加入到 amavis 群組就可以了:

sudo adduser clamav amavis

最後,還需要重新啟動 ClamAV 與 Amavis-new 服務才會生效:

/etc/init.d/clamav-daemon restart
/etc/init.d/amavis restart

不知道這個問題有沒有人可以反應給 Ubuntu 團隊知道的?