Skip to main content

How to enable SpamAssassin on DirectAdmin

Source

To enable Spamassassin on your server, you need to first need to install it. Once installed a few minor changes are needed in your /etc/exim.conf file.

1) Install spamd and spamc:

cd /usr/local/directadmin/scripts
./spam.sh

2) Start the spamd: /usr/bin/spamd -d -c -m 5

3) In order to get exim to use the spamd program, you'll need to make some changes in your /etc/exim.conf. Change: # Spam Assassin
#spamcheck_director:
# driver = accept
# condition = "${if and { \
# {!def:h_X-Spam-Flag:} \
# {!eq {$received_protocol}{spam-scanned}} \
# {!eq {$received_protocol}{local}} \
# {exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \
# {<{$message_size}{100k}} \
# } {1}{0}}"
# retry_use_local_part
# transport = spamcheck
# no_verify

to # Spam Assassin
spamcheck_director:
driver = accept
condition = "${if and { \
{!def:h_X-Spam-Flag:} \
{!eq {$received_protocol}{spam-scanned}} \
{!eq {$received_protocol}{local}} \
{exists{/home/${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}/.spamassassin/user_prefs}} \
{<{$message_size}{100k}} \
} {1}{0}}"
retry_use_local_part
transport = spamcheck
no_verify

4) Restart exim:
Redhat: /sbin/service exim restart

FreeBSD: /usr/local/etc/rc.d/exim restart

The global spamassassin config file is in /etc/mail/spamassassin/local.cf

You'll want to make sure that you have the correct call to spamc in the spamcheck transport in your exim.conf: transport_filter = /usr/bin/spamc -u ${lookup{$domain}lsearch*{/etc/virtual/domainowners}{$value}}

If you run debian and are missing perl or some pm files, type: apt-get install perl-base perl-modules

How to Upgrade SpamAssassin on DirectAdmin

First install INET6 libraries (which latest spamassassin will complain about):
# yum install INET6

Kill current spamd process:
# pkill -9 spamd

Go here and get updatescript and follow directions on how to install it:
[tools] update.script

# cd /usr/local/updatescript
# ./update.script UPDATEME

then install:
# ./update.script SPAMASSASSIN

******
if you get errors
******

try to restart spamd:

# killall -9 spamd
# /usr/bin/spamd -d -c -m 5

then/or ...

Try 'ps aux |grep spamd ' to see if it is not already running.

if you get: warn: server socket setup failed, retry 1: spamd: could not create INET socket on 127.0.0.1:783: Address already in use
# netstat -apt | grep '783'

Comments

Quite a few people have asked

Quite a few people have asked me about this in the past. If you have a file how can you open it in the default associated application without querying the registry or using some other Windows API? Or if you program in Java how can you do it without using JDIC?

Post new comment

The content of this field is kept private and will not be shown publicly.