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.


The filterto program runs prog with a message on standard input. If prog exits 0, filterto forwards the standard output from prog to address, and then exits 99. If prog exits 111, filterto exits 111. If prog exits with any other exit code, or does not exist, filterto exits 0.

NB: 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.


William Baxter <>