New experience on using SpamAssassin - 2

My bad day today. Here is my solution (hope) on fixing the problem of Spamassassin about a question that spamassassin cannot identify a spam:

At first, I try to identify the problem but no luck. The final decision I made was: uninstall the package.

So, firstly I type:

rpm –e spamassassin # success

then I type:

yum install spamassassin # success

The above install script ONLY install the Fedora 4 version, at writing time is 3.0.6-1. However, in the official website the latest stable version is 3.1.3.

Then I uninstall that old version. Reinstall the new version in tar.gz format.

Since I am not very familiar with using tar.gz to install (Well, actually I did the following:

perl –MCPAN –e

cpan> cpan Mail::SpamAssassin


make install

however no luck again), I just gave up using that method and using another rpm method: rpmbuild.

Please alert that: rpmbuild is, by default, NOT INSTALL together with Fedora 4. So to use the rpmbuild function, first install rpm-build by typing:

yum install rpm-build

then you can issue the command, which is copied from website:

rpmbuild -tb Mail-SpamAssassin-3.1.3.tar.gz

Once the process finished, go to : /usr/src/redhat/RPMS/i386 to find your built rpm(s), in this case, there are 2 rpm files:



The remaining install steps are easy, please install the Perl one first, otherwise you will be prompted an error:

rpm –ivh Perl-Mail-SpamAssassin—3.1.3-1-i386.rpm

rpm –ivh Mail-SpamAssassin—3.1.3-1-i386.rpm

The installation is now finished. Start the service than:

/etc/rc.d/init.d/spamassassin start

Check if it works by issuing this command:

netstat –aup | grep spamd

and testing the spamc by issuing this command:

spamc –R < (the directory where sample-nonspam/spam.txt exists)

If they are all okay, your spamassassin is about to go.

Try mail a sample-spam.txt to your account by issuing this command:

mail (your email address) < (directory where sample-spam.txt located)

Then watch these 2 log files;

/var/log/procmail.log # To see whether /etc/procmailrc work

/var/log/maillog # To see the process of spamd work.

There are one more important thing: spamassassin heavily (I think) depends on /etc/procmailrc file, which is a text file of finding whether an email match specific patterns. If match, send it to somewhere else.

To make spamassassin work well with procmailrc, some lines should be added to /etc/procmailrc:


* < style=""> # To specify the max size which should be processed

| /usr/bin/spamc


* ^X-Spam-Status: Yes

The old way:


| /usr/bin/spamc –s 80000000

seems not work as when I remove the –s switch, it can identify the spam again.


Popular posts from this blog

TCPDF How to show/display Chinese Character?

Using wget bypass htaccess username password 401 authorization

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services