maybe if you are running with #!/usr/bin/suidperl, your suidperl
cannot read fd 1 to pull the envelope information correctly. Try
switching to #!/usr/bin/perl which should invoke suidperl if your
qmail-scanner-queue.pl is setuid properly.