PDA

View Full Version : MailScanner duplicating mails - unlink error



djberriman
30th October 2006, 01:55 PM
Hi,

I've recently installed FC2 (unfortunately I run a piece of software that limits me to FC2 at max for the moment).

I've installed MailScanner and Clamav with SpamAssassin as I had on my last setup before I reinstalled the server from scratch.

Everything works ok except Mail Scanner sometimes process an incoming mail twice which is annoying in itself as the 2nd mail isn't always complete.

It appears to be a locking issue or similar in that MailScanner kicks off 2 threads to process the same email by mistake as can be seen here.

Oct 30 12:29:49 xxx sendmail[10710]: k9UCTnfJ010710: from=<yyy@xxx.co.uk>, size=2697, class=0, nrcpts=1, msgid=<200610301229.k9UCTmiX022699@zzz.co.uk>, proto=ESMTP, daemon=MTA, relay=zzz.co.uk [192.168.12.3]
Oct 30 12:29:49 xxx MailScanner[11845]: New Batch: Scanning 1 messages, 3256 bytes
Oct 30 12:29:50 xxx MailScanner[12857]: New Batch: Scanning 1 messages, 3256 bytes
Oct 30 12:29:50 xxx MailScanner[11845]: Virus and Content Scanning: Starting
Oct 30 12:29:50 xxx MailScanner[12857]: SpamAssassin cache hit for message k9UCTnfJ010710
Oct 30 12:29:50 xxx MailScanner[12857]: Virus and Content Scanning: Starting
Oct 30 12:29:52 xxx MailScanner[11845]: Uninfected: Delivered 1 messages
Oct 30 12:29:52 xxx MailScanner[12857]: Unlinking /var/spool/mqueue.in/qfk9UCTnfJ010710 failed: No such file or directory
Oct 30 12:29:52 xxx MailScanner[12857]: Unlinking /var/spool/mqueue.in/dfk9UCTnfJ010710 failed: No such file or directory
Oct 30 12:29:52 xxx MailScanner[12857]: Uninfected: Delivered 1 messages

As you can see the 2nd thread fails to unlink the message as the 1st thread has already done this.

Sometimes its just duplicate, sometimes the 2nd mail is blank as its already gone before the 2nd thread can process it.

Any ideas what is causing this? Doesn't seem to be much on google.

Doesn't seem to be sender or relay related just pretty random.

Thanks
Duncan

djberriman
30th October 2006, 06:20 PM
Just an update.

Its nothing to do with spamassassin or clamav.

Its the child MailScanner processes that are causing the problem it appears and picking the same email from the in mqueue.in directory to process.

I'm setting children to 1 (instead of the default 5) to see what happens.

Looks like clamav module is bust as well, it doesn't build with the latest version of clamav and even after modifying clamav.h to get it to compile it falls over with library errors. Appears its been broken nearly a year as the clamav library was changed in November 2005 to remove the definition that causes the compile to break.