Blog

Okay, at times SpamAssassin can be a bit hard to correctly make it work on some environments if you’re not using a commercial product like CPanel

Okay, let’s go over the basics, we need to make sure plugins are installed correctly and its dependencies ofc.

Lets do some installing of Pearl and Spam Assassin.

perl -MCPAN -e shell
o conf commit prerequisites_policy ask
install Mail::SpamAssassin
quit
perl -MCPAN -e shell
o conf prerequisites_policy ask

force install Socket6 IO::Socket IO::Socket::INET6 LWP MD5 CPAN::DistnameInfo Mail::DKIM
force install Test::More MIME::Base64 Digest::MD5 Digest::HMAC_MD5 Net::IP
force install Net::Ping Net::DNS Time::HiRes Digest::SHA1 Getopt::Long Digest::Nilsimsa URI::Escape HTML::Parser HTTP::Date IO::Zlib Archive::Tar  Mail::SPF
force install Mail::SPF::Query Net::Ident IO::Socket::SSL Mail::DomainKeys Mail::DKIM LWP::UserAgent HTTP::Date Encode::Detect
install Storable DB_File Net::SMTP IP::Country::Fast BerkeleyDB
force install  Mail::SpamAssassin Mail::SpamAssassin::Plugin::Razor2

Once this has finished our dependencies should be met, let’s go over the config file for spam assassin. Find the INIT.PRE file:

# RelayCountry - add metadata for Bayes learning, marking the countries
# a message was relayed through
#
# Note: This requires the IP::Country::Fast Perl module
#
loadplugin Mail::SpamAssassin::Plugin::RelayCountry

# URIDNSBL - look up URLs found in the message against several DNS
# blocklists.
#
loadplugin Mail::SpamAssassin::Plugin::URIDNSBL

# Hashcash - perform hashcash verification.
#
loadplugin Mail::SpamAssassin::Plugin::Hashcash

# SPF - perform SPF verification.
#
loadplugin Mail::SpamAssassin::Plugin::SPF

Uncomment the plugins so they get loaded correctly, and update the rules by running:

sa-update

I’d also recommend adding that to your crontab to get periodically updated.

# spamassassin update
30 3 * * * /usr/bin/sa-update --nogpg -v &

-v will send mail to postmaster [selected upon installation]

user@user(link sends e-mail):~# service spamassassin restart ##Its always good to restart the service upon maintenance.

ddemuro
administrator

Sr. Software Engineer with over 10 years of experience. Hobbist photographer and mechanic. Tinkering soul in an endeavor to better understand this world. Love traveling, drinking coffee, and investments.

You may also like

Compiling Qemu-KVM

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: