欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SpamAssassin的簡單應(yīng)用

 更新時(shí)間:2007年01月13日 00:00:00   作者:  
這里我們只講SpamAssassin的簡單應(yīng)用,就是利用SpamAssassin的規(guī)則集把垃圾郵件標(biāo)注為垃圾郵件,然后在客戶端outlook用策略把帶有垃圾郵件字符的郵件自動轉(zhuǎn)移到垃圾郵件目錄。

參看文章
CCERT中文垃圾郵件過濾規(guī)則集
(http://www.ccert.edu.cn/spam/sa/Chinese_rules.htm)

試驗(yàn)環(huán)境:redhat9.0
前提條件:已經(jīng)安裝好qmail,本文已經(jīng)搭建的環(huán)境是qmail+vpopmail+igeus

1:安裝SpamAssassin
安裝方法1:直接通過CPAN安裝
perl -MCPAN -e shell 
install Mail::SpamAssassin

2:自己編譯安裝
去http://spamassassin.apache.org下載最新版本的軟件

解壓后:# perl Makefile.PL
# make
# make install

# 進(jìn)行一個(gè)spam和non-spam的測試
在spamassassin源文件目錄:
spamassassin -t < sample-spam.txt > spamtest.txt
less spamtest.txt
spamassassin -t < sample-nonspam.txt > nospamtest.txt
less nospamtest.txt 
spamtest.txt文件在主題一段中將包含"*****SPAM*****" 這一行, 而nospamtest.txt文件中則沒有.
(默認(rèn)讀取/etc/mail/spamassassin/local.cf配置.)

如果make過程中報(bào)錯(cuò),可以參看此文解決相關(guān)問題http://blog.5ilinux.com/archives/2005/07/spamassassin.html 

3:配置local.cf文件
# vi /etc/mail/spamassassin/local.cf

# How many hits before a message is considered spam.
required_hits           9.5

# Text to prepend to subject if rewrite_subject is used
rewrite_header Subject  *****垃圾郵件*****

# Encapsulate spam in an attachment
report_safe             1

# Enable the Bayes system
use_bayes               1

# Enable Bayes auto-learning
bayes_auto_learn        1

# Enable or disable network checks
skip_rbl_checks         1
use_razor2              0
use_dcc                 0
use_pyzor               0

# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_languages            all

# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales              all

關(guān)于SpamAssassin的配置文件,可參考SpamAssassin 3.x 配置指南(中文版)
(http://anti-spam.org.cn/references/index.php?Action=Show&ID=9)

4:下載垃圾郵件中文規(guī)則集
wget -N -P /usr/share/spamassassin www.ccert.edu.cn/spam/sa/Chinese_rules.cf

5:qmail和SpamAssassin的結(jié)合

在SpamAssassin 3.x 的spamc 目錄下編譯qmail-spamc
# cc -O -o qmail-spamc qmail-spamc.c
# install -m 755 qmail-spamc /var/qmail/bin

# ln -s /var/qmail/bin/qmail-queue /usr/bin/qmail-queue

編輯 /etc/tcp.smtp 如下
127.:allow,RELAYCLIENT=""
:allow,QMAILQUEUE="/var/qmail/bin/qmail-spamc"

然后:
tcprules tcp.smtp.cdb tcp.smtp.tmp < tcp.smtp

在編譯目錄spamd目錄下
mv  redhat-rc-script.sh /etc/rc.d/init.d/spamd

啟動spamd
/etc/rc.d/init.d/spamd start

這樣SpamAssassin會根據(jù)規(guī)則集自動判斷垃圾郵件,把認(rèn)為潛在可能的垃圾郵件打上****垃圾郵件****的標(biāo),一目了然,至于客戶端outlook怎么設(shè)置策略自動轉(zhuǎn)移垃圾郵件,就不用我說了吧。

相關(guān)文章

最新評論