I Have installed spamassassin and clam BUT ...

Hello there

Ok, few interworx users liked to have spamassassin installed in interworx.

Faded up receiving spam and virus and waiting for a next interworx realease I decid to install spamassassin and clam (spamassassin, clam, razor, dcc, maildrop, qmail-scanner)

To do that I followed up the tutorial attache in this post

but I don’t know how interworx works and I’d like to know how to do this last step. Say to qmail to use qmail-scanner queue…

Next, make sure that your qmail-smtpd script allocates sufficient resources to support the needs of Qmail-Scanner + Antivirus + SpamAssassin
vi /var/qmail/supervise/qmail-smtpd/run
Change the softlimit from 2000000 to something a fair bit larger. We use 15000000.
Now define what mail is to be sent through the Qmail-Scanner.
At our site, we have configured Qmail-Scanner to virusscan all messages (ie inbound and outbound mail). We did this by setting up our our /var/qmail/supervise/qmail-smtpd/run file like this :

when QMAILQUEUE is set, all mail will be sent to the nominated script

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE

QMAILDUID=id -u qmaild
NOFILESGID=id -g qmaild

softlimit needs to be set at something large such as 15000000

to allow virusscanning software to run successfully

exec /usr/local/bin/softlimit -m 15000000
/usr/local/bin/tcpserver -v -x /etc/tcp.smtp.cdb -c 30 -R
-u “$QMAILDUID” -g “$NOFILESGID” 0 smtp
… and the rest of the file snipped …
However, if you don’t want to virusscan all mail, you can selectively nominate which IP ranges should or shouldn’t be checked by setting the QMAILQUEUE variable via your /etc/tcp.smtp file rather than inside the supervise/qmail-smtpd/run file. Refer to the Qmail-Scanner home page for setup examples.

or that

start() {
echo -n “D?marrage de Qmail”
export PATH="/usr/local/bin:/var/qmail/bin:/var/vpopmail/bin:/usr/local/bin/ezmlm:$PATH"
export QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"
/usr/bin/spamd -L -x -u spamc > /dev/null &
/var/qmail/rc > /dev/null &
/usr/local/bin/tcpserver -v -H -R -x /etc/tcp.smtp.cdb -c20 -u1033 -g103 0 smtp /usr/local/bin/recordio /var/qmail/bin/qmail-smtpd 2>&1 >/dev/null &
/usr/local/bin/tcpserver -v -H -R 0 pop3 /usr/local/bin/recordio /var/qmail/bin/qmail-popup exploz.com /var/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir > /dev/null &
echo " [ OK ]"
stop() {
echo -n “Arr?t de Qmail”
killall spamd
killall qmail-send
echo " [ OK ]"
case “$1” in
echo “Usage: qmail {start|stop|restart}”

chmod a+x /etc/init.d/qmail

ln -sf /etc/init.d/qmail /etc/rc0.d/K30qmail

ln -sf /etc/init.d/qmail /etc/rc1.d/K30qmail

ln -sf /etc/init.d/qmail /etc/rc2.d/S30qmail

ln -sf /etc/init.d/qmail /etc/rc3.d/S30qmail

ln -sf /etc/init.d/qmail /etc/rc4.d/S30qmail

ln -sf /etc/init.d/qmail /etc/rc5.d/S30qmail

ln -sf /etc/init.d/qmail /etc/rc6.d/K30qmail

In fact how to tell to qmail to use the qmail-scanner queue ?

thanks you


A very enjoyed interworx user

Regarding the first quoted section:
On an InterWorx Server, the above line would be:

Regarding the second quoted section, which appears to be someone’s qmail start up script, I’d recommend editing /etc/rc.d/init.d/smtp and adding the following two lines:
export PATH="/usr/bin:/var/qmail/bin:/var/vpopmail/bin:$PATH"
export QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl"

above the line:
$svc -u $dir

You may want to start up spamd in the start up script as well, in which case you’d put it after the two lines that start with export above.

In fact how to tell to qmail to use the qmail-scanner queue ?
This is done by setting the QMAILQUEUE variable, which is done in the examples you posted by the lines that start with: export QMAILQUEUE



in fact I just done that

1/ Update /etc/tcprules.d/tcp.smtp
to add
and do
tcprules /etc/tcprules.d/tcp.smtp.cdb /etc/tcprules.d/tcp.smtp.tmp < /etc/tcprules.d/tcp.smtp

2/ Update /service/smtpd/run
QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue.pl" export QMAILQUEUE
and change the softlimit to 10000000

ok, will try yours (I was really not sure what I done was fine)

Just to understand

are not doing the same thinks ? if yes which one I have to update ?

for the spamd, you right. I have added it in /etc/rc.d/init.d/spamd .So will add
/etc/rc.d/init.d/spamd start
after the 2 exports.
and do the same for the antivirus clam ( /etc/rc.d/init.d/clamd start )

and after I’m going to bed (06:33 french time : a full night to setup everything :o )

thanks Paul


A last think. There is one line I have not set up

Modify / create the spamd configuration file

vi /etc/sysconfig/spamassassin

Hint : if you want to enable SpamAssassin debugging

(the debug output goes to /var/log/maillog) then use :

SPAMDOPTIONS="-x -u spamd -H /home/spamd -d -D"

Don’t leave debugging turned on unnecessarily though,

because it will slow down a busy server.

Otherwise, for normal operation (debugging disabled) use :

SPAMDOPTIONS="-x -u spamd -H /home/spamd -d"

I don’t find this file :\

and when I’m looking in the maillog (/var/log/maillog)
I have this line

Jul 9 19:47:15 server1 spamd[23079]: Still running as root: user not specified with -u, not found, or set to root. Fall back to nobody.



Yesssss !!!

Ok everything use to work

When I stop and start smtp service under nodeworx, spamd and clamd are launch as daemon :slight_smile:

I will merge and update the few tutorials i used to install spmassassin and let it here in a future mail

thanks Paul for your help and do not hesitate to answers my post above :-p


A very happy interworx user

It does say to create the file if it doesn’t exist, did you try that?

Yes I did. And now everything is fine :slight_smile:

80 mails receveid, 46 virus blocked by clam/qmail-scanner and 22 spams receveid with the [SPAM] info in the object

Much better like that :smiley:

Roughly following these instructions I have successfully installed spamassassin as well. My only question is whether there is an easy way to have it filter only on known good addresses? Right now it filters every bit of mail even though 90% of it is destined for non-existent addresses.