Installing qmail-scanner with Plesk

A couple of notes... using psa-spamassassin will result in all messages being scanned twice, which creates a lot of overhead. There may be a way around that, but this guide is written assuming you will remove psa-spamassassin and use spamassassin instead (retaining psa-spamassassin should not be problematic, other than the aforementioned issue, and is necessary if you wish to retain Plesk control panel integration with spamassassin... just ignore the stuff related to spamassassin and psa-spamassassin).

Get and install the following from http://www.atomicorp.com/channels/atomic/redhat/4/i386/RPMS (you may need to remove psa-drweb):

daemontools
maildrop
perl-Archive-Tar
perl-HTML-Parser
perl-IO-Socket-INET6
perl-IO-Socket-SSL
perl-IO-Zlib
perl-Socket6
pyzor
qmail-scanner
razor-agents
spamassassin
tnef

run

service psa-spamassassin stop
service spamassassin start
chkconfig psa-spamassassin off
chkconfig spamassassin on
qmail-scanner-reconfigure

You now have qmail-scanner functionality for incoming mail. To set up qmail-scanner support for outgoing (smtp/s) mail edit the following files:
/etc/xinetd.d/smtp_psa
/etc/xinetd.d/smtps_psa
to include the line:

env = QS_SPAMASSASSIN="on"

This will filter all outgoing mail received via SMTP(S). Locally generated mail, as far as I can tell, will not be filtered unless you can find a way to set QS_SPAMASSASSIN in the environment of whatever app may be sending mail (someone please correct me if I'm wrong here... I tried just about everything, including setting it in the qmail init scripts and /etc/profile to no effect, and scoured google without finding a solution). In order get this working, edit /var/qmail/bin/qmail-scanner-queue.pl and comment out lines 3407-3411 as follows:

#  if ($QS_RELAYCLIENT && !defined($ENV{'QS_SPAMASSASSIN'})) {
#    &debug("Z0MGspamassassin: don't scan as RELAYCLIENT implies this was sent by a local user");
#    &minidebug("Z0MGSA: don't scan as RELAYCLIENT implies this was sent by a local user") if (!$scanned);
#    return;
#  }

Check /var/spool/qscan/qmail-queue.log to verify functionality. You can send test messages with the GTUBE spam test body to test (send a message containing only the following in the body... no spaces or newlines):

XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X

Submitted by jkelly on Thu, 2007-06-28 15:33. categories [ | | ] login or register to post comments