SuperScript::Software::qtools

The filterto program


Interface

In .qmail:
  | filterto address prog
where address is an email address, and prog is one or more arguments specifying a program to run for each message.

For each email message it processes, filterto runs prog with the message on standard input. If prog exits 0, filterto forwards the standard output from prog to address, and then exits 99, so that further commands in .qmail are ignored. If prog exits 111, filterto exits 111, so delivery will be retried later. If prog exits with any other exit code, or does not exist, filterto exits 0, so the rest of .qmail is processed.

Note that it is not safe for prog to fork a child that reads the message in the background.

NB: If you use filterto in a .qmail file, make sure to add a line specifying delivery to your normal mailbox.