經過實際上線後, 發覺 ClamAV Scan 的效能太慢, 導致帶有附件的信件會延遲兩小時左右才會寄到, 同時系統會佔用大量的 CPU 及 RAM, 造成惡性循環, 經過 By pass 防毒軟體測試, 送達速度可以大幅提升, 確認為防毒軟體 Scan 速度太慢導致塞車.
當然又透過 Google 搜尋一下找到 F-Prot 也有 Linux Workstation 的版本, MailScanner 也直接支援, 所要做的只是下載裝起來然後變更設定.
Step1 Download antivirus package
指令: #Wget files.f-prot.com/files/unix-trial/fp-Linux-i686-ws.tar.gz
說明:到該路徑去下載安裝套件
Step2 Extract compressed file
指令: #tar –xvf fp-Linux-i686-ws.tar.gz
說明:把壓縮檔在當前目錄解壓縮
Step3 Copy f-prot to /opt/.
指令: #cp –r f-prot /opt/.
cd /opt/f-prot
說明:把解開後的資料複製到 /opt 目錄下, 並跳到新的路徑下去
Step4 Install f-prot
指令: #./install-f-prot.pl
說明:開始執行安裝動作, 這個會稍微跑一下, 同時會執行第一次的病毒更新.
Step5 Test Virus Scan
指令: # ./fpscan /bin
說明:測試 /bin 內的所有壓縮檔案, 可以看到掃瞄結果的話那就是安裝正確, 請參考以下的畫面, 掃瞄 90 個檔案只要 1 秒, 不過執行該程式還真的有點久
—————————————————————
FRISK Software International (C) Copyright 1989-2009
Engine version: 4.5.1.85
Arguments: /bin
Virus signatures: 201X11241439e5139432d75b6ce4eccb650884123224
(/opt/f-prot/antivir.def)
Scanning: /
Results:
Files: 90
Skipped files: 0
MBR/boot sectors checked: 0
Objects scanned: 90
Infected objects: 0
Files with errors: 0
Disinfected: 0
Running time: 00:01
———————————————————–
Step6 Modify MailScanner.conf
指令: # vi /etc/MailScanner/MailScanner.conf
Virus Scanner = f-prot-6
Or Virus Scanner = clamav f-prot-6
說明: 變更病毒掃瞄軟體, 依照我的情況是 Clamav 吃掉太多的資源, 只選用 f-prot-6, 如果 MailGateway 的資源充足的話, 也可以直接開啟兩個病毒掃瞄軟體, 甚至於是 auto 讓系統找到多少個就掃多少次.
Step7 Service restart
指令: # service MailScanner restart
說明: 重新啟動 MailScanner 讓它讀入新的參數檔案,
最後利用 top 指令檢查一下是否有正常的呼叫 fpscan 來掃瞄病毒, 如果有就就是設定正常, 沒有的話就要檢查一下前列的步驟喔.
- check fpscan got started when mail received