usage: qscanq [PROG] [ARG1] ...

qscanq replaces qmail-queue. It initiates a scan on an incoming email, and returns the exit status of the scanner or of qmail-queue to the caller.

qscanq needs no arguments. It may be called with optional arguments, which will then be treated as a program to be called instead of qmail-queue. The arguments will be passed on to qmail-stdin, which actually calls qmail-queue.

Like qmail-queue, qscanq reads an email message on file descriptor 0, reads its envelope on file descriptor 1, and generates no output. The return codes are interpreted by the caller, which in turn generates any user output.

qscanq runs setuid to the qscanq user. When invoked, it changes to the spool directory and creates a working directory based on a timestamp, the PID, and a counter, with the sticky bit set. It then changes to that directory and invokes qscanq-stdin.

After qscanq-stdin returns, qscanq unsets the sticky bit on its working directory, invokes run-cleanq and then returns the exit status of qscanq-stdin without waiting for run-cleanq to return.

Environment Variables

qscanq sets no environment variables. It does pass its environment to qscanq-stdin, which in turn passes them to qmail-queue (or PROG, if supplied instead). This means that any qmail-queue wrapper called by qscanq must be able to handle its environment safely.

If the DEBUG environment variable is set to any value whatsoever, then qscanq will print diagnostic messages to stderr whenever an error occurs. This is for use in debugging a new configuration, and should never be used to capture "extra log information" during runtime. If DEBUG is set, then qscanq will set DEBUG=1 when calling qscanq-stdin.

It should be stressed that the value of DEBUG is ignored. Setting DEBUG to "1", "TRUE", "yes", etc., will turn on debug messages. Setting it to "0", "FALSE", "no", "N", etc., will also turn on debug messages. If you don't want debug messages, don't set DEBUG at all.

Return Codes

qscanq can return any code returned by qmail-queue. In addition, it returns 71 (temporary refusal) if any runtime error occurs. The caller may also receive exit status 31 from qscanq-stdin, which is called by qscanq.

 

Top


Len Budney
lbudney@pobox.com
Copyright © 1998 - 2004
Page generated: 20:40:02 21-Dec-2004