A tutorial for installing spamassassin and clam (av)


This tutorial aim to protect your mail server against spam and virus

First, Original of this document is available at http://www.pipeline.com.au/staff/mbowe/isp/webmail-server.htm

The one I give you is the same but I change somethings to do it works fine on our Interworx box.

We will install :
Tnef unpacker

On my box everything si working fine, but it doesn’t mean it will work on yours. Be carreful, do it only if you understand what you are doing.

For any questions I can try to help you or maybe Paul could to

The file attached is a zip file containing a html page

So good install


Thanks, I’ll take a look at this later and let you know how it works out.

I’m very curious to see how well this works.

Im hoping this makes it onto the user docs page.

User docs page ???

Not sure to understand

I remember all of you that a new spamassassin has been released :
SpamAssassin 3.0

I install it and change the tutoriel as well to reflete the last release (the config files is modified a little)



I have upgraded my spamassassin release to the spamassasin 3.00 release without pbm. (I followed up this tutorial). The only thing is about the local.cf configuration file

I added :
NOTE for VERSION = 3.00 owner

  • The “rewrite_subject” and “subject_tag” configuration options were deprecated and are now removed.
    Instead, using “rewrite_header Subject [your desired setting]”.
    e.g. rewrite_subject 1 subject_tag SPAM(SCORE)
    becomes rewrite_header Subject SPAM(SCORE)

For VERSION < 3.00 owner

Allow SpamAssassin to rewrite the subject line of any messages it classifies as spam

rewrite_subject 1

This is the value that will prepended to the subject line of messages classified as spam

subject_tag [SPAM]

That all

Hope it will help you


Sago now allows users to submit “whitepapers” for publication on the websitee. Go to Support => Documentation

I have a tutorial there (the InterWorx DNS Tutorial), and my FAQ will go there arfer InterWorx 1.8.1 is released and Chris or someone has the chance to check it for facts.

I have a couple others in the system that are draft (NOT PUBLISHED or viewable on the site), as does Chris.

You said you modified this from someone else’s work so Chris would probably want that person’s permission to put it here on the site.

Yep and it’s why for I do not put it on my faq page, or something like that.
I Only give the links and write modifications to make it working on an iworx box.

let us return to cesar what belongs to cesar (heu maybe not like that in english :rolleyes: )

Hey all.

Sqailto, thanks so much for the SA tutorial. I tried the QmailRocks tutorial, but couldn’t manage to get it working; with your tutorial, on the other hand, I was up and running in three hours – very cool.

Question(s) for you, and anyone else who wants to chime in:

Is there a way to prevent Qmail-scanner/SpamAssassin/ClamAv from processing non-existent messages?

90% of the Spam/Virii my server processes is going to mail accounts that don’t exist!

Furthermore, of these emails sent to non-existent accounts, I routinely receive messages from qmail-scanner (I believe), informing me, the administrator, that there was a problem with the email:

“problem ‘Disallowed characters found in MIME headers’”

What do I care?!!! First of all, the message was sent to a non-existent account; secondly, it’s very likely a virus of some sort; thirdly, I’m getting notified about these “problem” emails, which is essentially spam as far as I’m concerned.

OK, I’m sure I’m not alone here. Anyone found a solution?

Definitely let me know…


I try to install this tutorial on my new box (I already successfuly install it on my old one)

but I have some pbm.
I begin with razor.

As I had some pbm with MCPAN I decid to install the razor-agent-sdk (which one contains all prerequisites) and not to use cpan

When I launch the Perl Makefile.pl I have a warning

[root@padawan razor-agents-sdk-2.03]# perl Makefile.PL
Warning: prerequisite Digest::SHA1 1 not found.

but it goes on

The pbm is that I have error in make test

make[1]: Entering directory `/usr/local/src/razor-agents-sdk-2.03/Digest-MD5-2.20’
PERL_DL_NONLAZY=1 /usr/bin/perl “-MExtUtils::Command::MM” “-e” “test_harness(0, ‘…/blib/lib’, ‘…/blib/arch’)” t/*.t
t/files…Wide character in subroutine entry at t/files.t line 108.
Test returned status 25 (wstat 6400, 0x1900)
DIED. FAILED tests 1-5
Failed 5/5 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed

t/files.t 25 6400 5 5 100.00% 1-5
Failed 1/4 test scripts, 75.00% okay. 5/266 subtests failed, 98.12% okay.
make[1]: *** [test_dynamic] Error 29
make[1]: Leaving directory `/usr/local/src/razor-agents-sdk-2.03/Digest-MD5-2.20’
make: *** [test] Error 2

If I look in MCPAN (perl -MCPAN -e shell) and try to install the famous Digest::SHA1 it says :

CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
  Database was generated on Wed, 06 Oct 2004 01:18:53 GMT
Digest::SHA1 is up to date.

More I found the Digest::SHA1 in the razor-agent-sdk library
So I decided to try to install it manually

perl Makefile.pl without pbm
Make without pbm
but the Make test failed

[root@padawan Digest-SHA1-2.01]# make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0,
'blib/lib', 'blib/arch')" t/*.t
t/badfile....Digest::SHA1 object version 2.01 does not match bootstrap parameter
 2.10 at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 249.
Compilation failed in require at t/badfile.t line 6.
BEGIN failed--compilation aborted at t/badfile.t line 6.
        Test returned status 255 (wstat 65280, 0xff00)
t/sha1.......Digest::SHA1 object version 2.01 does not match bootstrap parameter
 2.10 at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm line 249.
Compilation failed in require at t/sha1.t line 3.
BEGIN failed--compilation aborted at t/sha1.t line 3.
        Test returned status 255 (wstat 65280, 0xff00)
FAILED--2 test scripts could be run, alas--no output ever seen
make: *** [test_dynamic] Error 2

[B]Erffff I'm really becoming crazy [/B] !!!!

I gave you a tutorial on how install razor/clamav/spamassassin, it worked on my previous box, but on this one nothing to do !!!!!!!!!

I'm not going to reinstall the box again :\

If somebody could help me I will very appreciate :)

Was your old box a different OS than your new one (RH9, CentOS)? A different OS will sometimes behave differently. I’ve been getting similar errors and am looking into MCPAN and if I fine anything that helps I will let you know.



Maybe you already know how to uninstall a perl module,

I mean I think there is to time the disgest::SHA1 perl module.

One time installed by MCPAN and one time tried to install by razor-agents-sdk
So I’d like to uninstall which one installed by mcpan

Thanks Tim

Actually I haven’t figured THAT out yet. I’m more looking for a way to refresh perl’s database of installed modules (sort of like you refresh your RPM database) because I’m installing modules (or at least I think I am) but when I try to install an RPM that wants them it says they aren’t there. I’ll keep you posted.


Perl modules works like that
for example Digest::SHA1 will install SHA1.pm in /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Digest/
and in /usr/lib/perl5/site_perl/5.8.0/Digest/

so you can look in these perl directories

When you use CPAN, it saves the files you installed (or try to) in /root/.cpan/build/

Sometimes if it is only a .pm to install without C compilation you could move the .pm file directly in the perl directory

For our example I could move SHA1.pm directly in /usr/lib/perl5/site_perl/5.8.0/Digest/ and /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Digest/

(not sure for this last)

Here is what I know

Good luck, and I let yu inform too :slight_smile:

ok for my problem

it seems that SHA1 is installed with version 2.10 and razor-agent-sdk try to install the version 2.01

In /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Digest/SHA1.pm , SHA1 is version 2.10
In /usr/lib/perl5/site_perl/5.8.0/Digest/SHA1.pm , SHA1 is version 2.01

Could I copy/replace directly SHA1.pm version 10 in /usr/lib/perl5/site_perl/5.8.0/Digest/SHA1.pm

I have copied all files from /usr/lib/perl5/site_perl/5.8.0/Digest/
to /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Digest/

And now it seems to be ok. (??? !!! ??? erf )

Ok I continue…

Well I have installed DCC (take this one : http://www.rhyolite.com/anti-spam/dcc/source/dcc-dccproc-1.2.54.tar.Z) without pbm

H?h? a new PBM…
I get spamassassin 3.0
perl Makefile.PL said me that it doesn’t find POD2MAN
I have POD2MAN in /bin/

I know this pod2man pbm, you have to enter
[root@padawan Mail-SpamAssassin-3.0.0]# export LANG=en_US

Well I remimber you I am on CentOS, so I’ll not continue to create 1 bilion posts but I promise that I’ll update the Tutorial to install all the last versions of razor/dcc/clam/spamassassin/… on a CentOS distrib

Next stage


Ok it’s finish, 6:00 am french time and everything is up and running :slight_smile:

It was very difficult at the beginning but when we have all the perls modules it’s OK

I’ll update the tutorial for CentOS but for spamassassin 3.0 too and all the others last versions !!!

Stay tuned

ps could a modo move this thread in Hack / tips / trick forum

Pascal, do you even need the razor-sdk? It was my understanding that it was only necessary to get all the perl mods in a bundle as opposed to having to download them individually. I’d say either get all the perl mods yourself or uninstall SHA1 and have the razor sdk reinstall an older one.


Well chris, in fact, I began to install all perl modules individualy because I didn’t know razor-sdk

As it didn’t work, and as I found the razor-sdk, I decided to install this last one.

The fact is, by doing that, I have installed two differents SHA1 version (I don(I didn’t know how uninstall a perl module, only delete the pm files ?)

It’s why I had a lot of pbm with perl
I deleted all pm files in /Digest and installed razor-sdk. And now everything is fine

Now I have another pbm on a CGI perl module but it’s in an other thread ( here )