Okay, I havn't solved the issue yet, but I think I've come real close. I hope what I did her helps inspire the rest of the fixes.
As far as I understand, ART's version of qmail-scanner replaces the /var/qmail/bin/qmail-queue binary with his qmail-scanner-queue binary.
The qmail-scanner-queue is a simple C program to exec the qmail-scanner-queue.pl script. The reason I believe he does this in C, is so that the permissions of of the setuid ( 4755 ) stick with the child processes.
Anyway, I wasn't very sucessful in setting enviroment variables from his qmail-scanner-queue.c program, so I altered it a bit. I made that C program, instead, run my own script:
/var/qmail/bin/qmail-scanner-env
This reads:
#!/bin/sh
export LC_ALL=C LANGUAGE=C LC_MONETARY LC_NUMERIC=C LC_MESSAGES=C LC_COLLATE=C LC_TIME=C LANG=C
/var/qmail/bin/qmail-scanner-queue.pl
And it looks like this on the filesystem:
-rwsr-xr-x 1 qmailq qmail 147 Dec 16 07:28 /var/qmail/bin/qmail-scanner-env
So now when i telnet to localhost and do the SMTP routines, I get this:
telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 localhost.localdomain ESMTP
helo world
mail from:
corman@unstupid.com
rcpt to:
corman@unstupid.com
data
subject: test
from:
corman@unstupid.com
this is a test
. 250 localhost.localdomain
250 ok
250 ok
354 go ahead
/bin/rm: cannot remove `/var/spool/qmailscan/tmp/localhost.localdomain11032181336802695/': Permission denied
I believe this is happening on line 1763 of qmail-scanner-queue.pl, which reads:
system("$rm_binary -rf $ENV{'TMPDIR'}/ $scandir/$wmaildir/new/$file_id") if ($DEBUG < 100 && $file_id ne "");
Anyone got any ideas?
Thanks
-Corey