http://www.clues.ltd.uk/howto/debian-sa-fprot-HOWTO.txt
小弟的server是testing的也可以使用不一定非要使用unstable
首先取得相關套件
#apt-get install spamassassin spamc sa-exim
接著修改/etc/exim4/sa-exim.conf這個檔案
裡頭都有註解依照想要設定的規則做修改
接著安裝相關軟體,小弟是以clamav做為主要的掃瞄引擎
再搭配f-prot之病毒碼
#apt-get install f-prot-installer amavisd-new clamav
clamav之設定可以參考
#man 5 clamav.conf
病毒碼更新請修改/etc/crontab加入
- 代碼: 選擇全部
#新f-prot病毒碼
27 4,16 * * * root /usr/local/f-prot/tools/check-updates.pl -cron -quiet
#更新clamav病毒碼
0 8 * * * root /usr/local/bin/freshclam --quiet -l /var/log/clamav/clamav.log
由於小弟的clamav是使用tarball安裝的所以路徑有所不同
(若版本在0.70以下則更新病毒碼會有問題,小弟當時安裝時是0.67所以才用tarball)
再來增加二個檔案
#vi /etc/exim4/conf.d/router/01_exim4-config_amavis
- 代碼: 選擇全部
amavis:
driver = manualroute
condition = "${if eq {$interface_port}{10025} {0}{1}}"
# if scanning incoming mails, uncomment the following line and
# change local_domains accordingly
domains = +local_domains
transport = amavis
route_list = "* localhost byname"
self = send
#vi /etc/exim4/conf.d/transport/01_exim4-config_amavis
- 代碼: 選擇全部
amavis:
driver = smtp
port = 10024
allow_localhost
並修改/etc/exim4/exim4.conf.template
在相關地方增加相同的東西,這應該是bug吧
不論dpkg-reconfigure exim4-config時選擇使用
/etc/exim4/exim4.conf.template這個檔案
或是/etc/exim4/conf.d/*它二個地方都會去檢查滿奇怪的
再修改/etc/exim4/update-exim4.conf.conf
將這一行dc_local_interfaces
改成
- 代碼: 選擇全部
dc_local_interfaces='0.0.0.0.25 : 127.0.0.1.10025'
再來修改/etc/spamassassin/local.cf
- 代碼: 選擇全部
rewrite_subject 1
report_safe 0
use_terse_report 0
use_bayes 1
bayes_path /var/amavisd/.spamassassin/bayes
auto_learn 1
skip_rbl_checks 1
use_razor2 1
use_dcc 1
use_pyzor 0
dcc_add_header 1
dns_available yes
header LOCAL_RCVD Received =~ /.*\(\S+\.example\.com\s+\[.*\]\)/
describe LOCAL_RCVD Received from local machine
score LOCAL_RCVD -50
## Optional Score Increases
score DCC_CHECK 4.000
score RAZOR2_CHECK 2.500
score BAYES_99 4.300
score BAYES_90 3.500
score BAYES_80 3.000
接下來啟動spamassassin
#/etc/init.d/spamspam start
(若/etc/spamassassin/local.cf沒設定正確就不會有反應)
接著修改/etc/amavis/amavisd.conf
- 代碼: 選擇全部
$mydomain = "example.com"
$forward_method = 'smtp:127.0.0.1:10025';
$notify_method = $forward_method;
再啟動amavis-new
#/etc/init.d/amavis start
重新載入exim4設定
#/etc/init.d/exim4 reload
這樣就大功告成啦,寄個病毒信來測試看看
這樣用起來廣告信和病毒信可以過濾掉90%以上