Tue. Jul 7th, 2020

SharkServers Blog

DMCA Ignored Hosting

Configuring Spamassassin on DirectAdmin

2 min read

A customer of ours has been complaining about receiving too much spam, and asked us to take a look. He’s a gas engineer, and his website is advertising his services. The site is running on one of our offshore VPS hosting plans with DirectAdmin. As we absolutely love this control panel, we had no problem taking a look. However, taking a look is one thing. Actually getting the spam filter working is another. We followed the instructions set out by the DirectAdmin staff, but got the following error:

dependency check complete...

REQUIRED module missing: HTML::Parser
REQUIRED module missing: Net::DNS
REQUIRED module missing: NetAddr::IP
REQUIRED module missing: Time::HiRes
REQUIRED module missing: Archive::Tar
REQUIRED module missing: IO::Zlib

So, we’re missing some Perl modules. Let’s install them:

cpan -i Archive::Tar Digest::SHA Mail::SPF IP::Country Net::Ident IO::Socket::INET6 Compress::Zlib Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect ExtUtils::MakeMaker

While this would normally work, it didn’t this time, and we got the error:

Catching error: "Can't locate object method \"data\" via package \"CPAN::Modulelist\" (perhaps you forgot to load \"CPAN::Modulelist\"?) at (eval 28) line 1.\cJ at /usr/share/perl5/CPAN/Index.pm line 518\cJ\cICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl5/CPAN/Index.pm line 85\cJ\cICPAN::Index::reload('CPAN::Index', 1) called at /usr/share/perl5/CPAN/Index.pm line 15\cJ\cICPAN::Index::force_reload('CPAN::Index') called at /usr/share/perl5/CPAN/Shell.pm line 561\cJ\cICPAN::Shell::reload('CPAN::Shell', 'index') called at /usr/share/perl5/CPAN.pm line 375\cJ\cIeval {...} called at /usr/share/perl5/CPAN.pm line 372\cJ\cICPAN::shell() called at /usr/bin/cpan line 198\cJ" at /usr/share/perl5/CPAN.pm line 391
        CPAN::shell() called at /usr/bin/cpan line 198

Alright, Perl is playing tricks. We’re running CentOS 6 64bit on this VPS, so let’s just try and see if we can use RPM instead:

yum install perl-HTML-Parser perl-Net-DNS perl-NetAddr-IP perl-Time-HiRes perl-Archive-Tar perl-IO-Zlib 

Trying to compile again, and another error:

Can't locate HTTP/Date.pm in @INC (@INC contains: /usr/share/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5) at /usr/bin/sa-update line 91.
BEGIN failed--compilation aborted at /usr/bin/sa-update line 91.

OK, this is not too bad, and we should be ok after this. Let’s fix it:

yum -y install perl-libwww-perl.noarch

This did the trick! Let’s try to compile Spamassassin again:

./build spamassassin

Voila! Spamassassin is now installed and running!

Leave a Reply

Your email address will not be published. Required fields are marked *