Here we only talk about the simple application of SpamAssassin, using SpamAssassin's rule set to label spam as spam, and then using policy to automatically transfer messages with spam characters to the junk e-mail directory in client Outlook.
Refer to the article
Ccert chinese spam Filtering rule set
(http://www.ccert.edu.cn/spam/sa/Chinese_rules.htm)
Test environment: redhat9.0
Prerequisite: Already installed qmail, this article has built the environment is Qmail+vpopmail+igeus
1: Install SpamAssassin
Installation Method 1: Directly through the CPAN installation
PERL-MCPAN-E Shell
Install Mail::spamassassin
2: Compile and install yourself
Go to http://spamassassin.apache.org to download the latest version of the software
After decompression: # Perl makefile.pl
# make
# make Install
# for a spam and non-spam test
In SpamAssassin source files directory:
Spamassassin-t < Sample-spam.txt > Spamtest.txt
Less spamtest.txt
Spamassassin-t < Sample-nonspam.txt > Nospamtest.txt
Less nospamtest.txt
The Spamtest.txt file will contain the "*****spam*****" line in the topic section, but not in the Nospamtest.txt file.
(Default read/ETC/MAIL/SPAMASSASSIN/LOCAL.CF configuration.)
If you have an error during make, refer to this article to resolve the problem http://blog.5ilinux.com/archives/2005/07/spamassassin.html
# Mail using languages used in country codes won't be marked
# as being possibly spam in a foreign language.
Ok_languages All
# Mail using locales used in country codes won't be marked
# as being possibly spam in a foreign language.
Ok_locales All
For spamassassin configuration files, refer to the SpamAssassin 3.x configuration Guide (Chinese version)
(http://anti-spam.org.cn/references/index.php?Action=Show&ID=9)
4: Download the Chinese rule set for junk mail
Wget-n-p/usr/share/spamassassin WWW.CCERT.EDU.CN/SPAM/SA/CHINESE_RULES.CF
The combination of 5:qmail and SpamAssassin
Compiling QMAIL-SPAMC in the SPAMC directory of SpamAssassin 3.x
# Cc-o-O QMAIL-SPAMC qmail-spamc.c
# install-m 755 Qmail-spamc/var/qmail/bin
Edit/etc/tcp.smtp as follows
127.:allow,relayclient= ""
: allow,qmailqueue= "/VAR/QMAIL/BIN/QMAIL-SPAMC"
And then:
Tcprules tcp.smtp.cdb Tcp.smtp.tmp < TCP.SMTP
In the compiled directory SPAMD directory
MV REDHAT-RC-SCRIPT.SH/ETC/RC.D/INIT.D/SPAMD
Start SPAMD
/ETC/RC.D/INIT.D/SPAMD start
This spamassassin will automatically judge the spam according to the rule set, and put the spam messages that are considered potentially possible into the junk mail * * * * * * * * * * * * * * * * * *, at a glance, as for client Outlook how to set policy to automatically transfer spam, I don't need to say.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.