Page 1 of 1

Qmail-Scanner Race Condition

Posted: Wed Jan 18, 2006 1:58 am
by jjjheimer
Hey guys, I need some help solving an issue I've create with scott's clamd, spamassassin and the qmail-scanner. I was attempting to drive high scoring spam into the ground when I created a scenario that leads to a race condition in qmail. It spawns qmail-scanner-queue files like crazy. I've now got a backlog of email queueing up on the server so I figured this was normal until I noticed that over 1000 processes were running and the same messages where being clamd'd and spamd'd over and over. The qmail-scanner-queue.pl was configured with clamd_scan_scanner, spamassassin and perlscan_scanner. Thinking out loud - I wonder if perlscan may be the source of the problem.

Thanks, jjj


(edit - spelling)

Posted: Wed Jan 18, 2006 1:21 pm
by scott
Make sure you dont have duplicates of the qmail-queue wrapper. That could cause a loop like that.

Posted: Wed Jan 18, 2006 2:27 pm
by jjjheimer
I did at one point have a qmail-queue and a qmail-queue.orig and they appeared to be same size. These are created by the qmail-scanner-reconfiure script right? When I removed qmail-queue.orig and started qmail the logs recorded a problem because it was missing.

Posted: Wed Jan 18, 2006 5:17 pm
by jjjheimer
I found some info from another thread - I guess this is a common issue.

The plan is to:
Remove qmail-scanner and psa-qmail with:
rpm -e qmail-scanner psa-qmail --nodeps

Then re-install with yum
yum install psa-qmail
yum install qmail-scanner

Check permissions on the qmail-queue files and ensure the setguid for perl. I'll post the results when the box comes back to life.

Posted: Wed Jan 18, 2006 6:20 pm
by scott
A lot of things can make that happen. Dr. Web can do it, some strange upgrade conditions with PSA in other cases. Anyway, yeah its very common, if you ever get a high load inside of qmail then thats the first thing I'd look at. The good news is that you dont lose any mail in the process, it just sits there looping through the queue until you fix it.

Posted: Wed Jan 18, 2006 8:08 pm
by jjjheimer
Well the remove and reinstall seemed to have fixed the problem. I do have a lot of mail queued up /var/spool/qmailscan/tmp that isn't being reprocessed. Any thoughts on kick starting this?