Once You Know, You Newegg
Home FAQ Qmail-Scanner Troubleshooting the 451 qq Temporary Problem
Troubleshooting the 451 qq Temporary Problem PDF Print E-mail
Sunday, 12 April 2009 01:56

Updated 2/9/10: I fixed the links on this page and also updated the look and corrected some enteries.

The most common cause of this error is a problem with the ClamAV installation. First check to make sure it's running by running the following:

# ps -auxw | grep clam

and you should get an output similar to

user   673  0.0  4.5 25320 21628  ??  Is   13Nov06   1:50.16 /usr/local/sbin/clamd

The user above can be anything. I personally use user qscand to run clamav as well as SpamAssassin.

Try running freshclam and see if you get any errors when running it. If you do, It could be due to the ownership/permissions on /var/db/clamav.

Most of these issues can be resolved by cleaning out the entire clamav installation. I would remove the following folders/files and then doing a clean install of clamav. Please also note that if you do not have these types of paths/files on your system, they may vary from distro to distro:

Files:
/usr/local/etc/rc.d/clamav-clamd (could also be startup scripts in /etc/rc.d or /etc/init.d in other systems)
/usr/local/etc/rc.d/clamav-freshclam (could also be startup scripts in /etc/rc.d or /etc/init.d in other systems)

Folders:
/usr/local/share/doc/clamav
/var/db/clamav
/var/log/clamav
/var/mail/clamav
/var/run/clamav

References:
For FreeBSD users, remove all the clamav references from /etc/rc.conf
Take freshclam out of crontab This may not exist if you are running clamav from daemontools.

If you are running the non-setuid install, run the following commands and then run the test_install.sh -doit script:

cd /var/qmail/bin

For setuid installs:

chmod 4755 qmail-scanner-queue.pl
chown qscand:qscand qmail-scanner-queue.pl

For NON-setuid installs:

chmod 4755 qmail-scanner-queue
chown qscand:qscand qmail-scanner-queue

vi qmail-scanner-queue.pl

Please note: If you are using the NON-SETUID version of qmail-scanner, your QMAILQUEUE variable will not have a .pl at the end. So instead of having

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

you will have

QMAILQUEUE="/var/qmail/bin/qmail-scanner-queue"; export QMAILQUEUE

The first thing you will want to troubleshoot when getting this error is to find out if this is a qmail related problem or a qmail-scanner issue. In most cases, it's either qmail-scanner, clamav or spamassassin causing the problem.

Go to /var/qmail/supervise/qmail-smtpd/run and comment out the following line so it looks like this:

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

Restart qmail and then try sending a test message. If it goes through, We can proceed with the next step. Skip the next paragraph and continue with the next.

If you don't get your test message, it is a qmail delivery problem. What you will want to run is qmailctl stat and make sure ALL SERVICES are up FOR MORE than one second. If something is running around 0-1 seconds consistantly, Something is wrong with that service. Take a look at the logs for that service and troubleshoot from there. If you need more help, Join us on the IRC Freenode Server in channel #qmr, search the qmr mailing list archives , or try searching Google or the qmr forums.

Now we know that it's qmail-scanner related issue. Lets take a quick look at the QMAILQUEUE line in /var/qmail/supervise/qmail-smtpd/run:

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

The Major hint here is to make sure you used quotation marks ( " ) and not an Apostrophe ( ' )

Now to check perl dependancies. Run the following command as a NON-ROOT USER:

/downloads/qmailrocks/scripts/util/check_perlmods.script

It is very important that the Perl versions are the same. So if one perl module is 5.8.5 and the rest are 5.8.8, It would be in your best interest to update that perl module to 5.8.8 as well. Please refer to step 14 of the guide for instructions on how to reinstall those modules.

Another thing we will check is to make sure clamav and spamd are running.

The way to check this is by running

ps -auxw | grep clamd and
ps -auxw | grep spamd

You should get an output similar to the ones below:

Please note: On some systems, You way want to run the ps aux | grep command without the - in it on the next 2 commands.

# ps -auxw | grep spamd

qscand   27003  0.0  9.6 38460 36392  ??  I     7:00AM   0:02.13 spamd child (perl)
qscand   27002  0.0  9.0 36044 34128  ??  Is    7:00AM   0:02.48
/usr/local/bin/spamd -u qscand -d -x -r /var/run/spamd/spamd.pid (perl 5.8.6)

# ps -auxw | grep clamd

qscand     191  0.0  2.7 11772 10328  ??  Ss   Thu09AM   0:20.11 /usr/local/sbin/clamd

The spamd processes will vary from system to system. The default is 5 child processes.

Make sure your softlimit in /var/qmail/supervise/qmail-smtpd/run is 40MB (40000000) or more (If you are using the original qmail-rocks qmail-smtpd-run file)

One other thing that will cause this is if a file system is mounted with the
nosuid option. Take a look at /etc/fstab nosuid option. I found the entry in
/etc/fstab that was causing the problem.

Check to see if you are running perl with setuid. Click on the link below for the setuid related issues with perl and qmail-scanner.

http://goodcleanemail.com/index.php?option=com_content&view=article&id=102:correcting-spamassassin-and-qmail-scanner-problems-&catid=41:qmail-scanner&Itemid=41

Suse has a setuid problem. Click the following link for more information.

http://goodcleanemail.com/index.php?option=com_content&view=article&id=100:setuid-on-suse&catid=41:qmail-scanner&Itemid=41

You can also check the log files at the following locations to look for a more descriptive error:

/var/log/maillog
/var/spool/qmailscan/qmail-queue.log
/var/log/qmail/qmail-smtpd/current

Also try chmod 4755 /var/qmail/bin/qmail-scanner-queue.pl

See Disabling SpamAssassin or Clamav from qmail-scanner below:

http://goodcleanemail.com/index.php?option=com_content&view=article&id=101:how-to-disableenable-sa-clam-av-or-both-in-qmail-scanner-&catid=41:qmail-scanner&Itemid=41

If you use the clamav ownership, rather than qscand, the perl wrapper ends up
owned as qscand, rather than clamav.

Also check out John Simpsons post about getting qmail-scanner to work with clamav.

http://www.jms1.net/qmail/clamav-qms.shtml

Make sure that /var/spool/qmailscan/quarantine-attachments.db is being owned by qscand:qscand. Running /var/qmail/bin/qmail-scanner-queue.pl -g as root (w/o setuidgid) will change the db ownership

Last Updated on Tuesday, 15 February 2011 04:39