qmail-qfilter(1) front end for qmail-queue that does filtering


qmail-qfilter filter [ -- filter ... ]


qmail-qfilter sends the message text through each of the filter commands named on the command line. Each filter is run seperately, with standard input opened to the input email, and standard output opened to a new temporary file that will become the input to either the next filter, or qmail-queue. Each filter on the command line in seperated with --.


Returns 51 (out of memory), 53 (write error), or 81 (internal error) if it can't create the temporary files or has problems executing the filters. Returns 91 (bad envelope data) if it can't read or parse the envelope data. If a filter returns anything other than 0 or 99, qmail-qfilter returns its exit code. If a filter returns 99, qmail-qfilter returns 0 immediately without running any other filters. Otherwise returns the exit code of qmail-queue.


qmail-qfilter sets QMAILUSER and QMAILHOST to the user and host portions of the envelope sender address, and unsets QMAILNAME. It also sets QMAILRCPTS to the list of envelope recipients, each followed by a newline.


If you are using qmail-inject -n as one of the filters, you may want to unset MAILUSER, USER, and LOGNAME by using env -u QMAILNAME -u MAILNAME -u NAME qmail-inject -n as the command to invoke qmail-inject. Note that some the env command with some OS's doesn't support the -u option.

A message with an excessive number of recipients (more than 64K bytes of recipient data on Linux) will cause execution of the filter programs to fail, and for the message to be rejected.