Once You Know, You Newegg
Home FAQ Qmail-Scanner How to disable/enable SA, Clam AV or both in qmail-scanner
How to disable/enable SA, Clam AV or both in qmail-scanner PDF Print E-mail
Sunday, 12 April 2009 01:55

How to disable/enable SA, Clam AV or both in qmail-scanner.

At times you may want to disable/enable ClamAV or Spamassissin for a period of time without taking
the whole mailserver offline. An example of when you might want to do this is when upgrading to a
new version of either program, but doing it during normal hours rather than the middle of the
night. Of course, with this method if you disable or enable ClamAV for an upgrade you have no
antivirus/SA for incoming mail other than the simple checks that qmail-scanner makes.

To disable/enable SA, Clam or both:

Make a backup copy of qmail-scanner since editing it can be sometimes be touchy.
cp /var/qmail/bin/qmail-scanner-queue.pl /var/qmail/bin/qmail-scanner-queue.pl.old

Open the file:
pico (or vi) /var/qmail/bin/qmail-scanner-queue.pl

Find the section that looks like the following:
my @scanners_installed=("clamdscan_scanner","spamassassin","perlscan_scanner");
The next section looks like this:
my @scanners_default=("clamdscan_scanner","spamassassin","perlscan_scanner");

Change the line to look like the follwing to run SA only:
my @scanners_installed=("spamassassin");
The next section should look like this:
my @scanners_default=("spamassassin");

Change the line to look like the follwing to run clamd only:
my @scanners_installed=("clamdscan_scanner");
The next section should look like this:
my @scanners_default=("clamdscan_scanner");

Save the file and run the following commands for your OS to update qmail-scanner.

Redhat/Fedora/RHEL:
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -g, and
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z

Debian:
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -g, and
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z

Slackware:
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -g, and
setuidgid qscand /var/qmail/bin/qmail-scanner-queue.pl -z

Test and then you should be all set.