Skip to content

replier.1

Manvendra Bhangui edited this page Feb 25, 2024 · 7 revisions

NAME

replier - In dot-qmail, run a program to reply to an address

SYNOPSIS

in .qmail: |replier dir address program [ arg ... ]

where dir is a directory, address is an email address, and program is one or more arguments specifying a program to run.

For each email message it processes, replier changes the working directory to dir, executes program with the same message on standard input, and forwards the standard output from program to address.

replier adds a Mailing-List field to the message headers with the contents of dir/mailinglist. It rejects the message if there is already a Mailing-List field.

replier adds to the message all fields listed in dir/headeradd, followed by an appropriate Delivered-To line. replier deletes from the message any fields with names listed in dir/headerremove. replier performs its header editing on the output from program.

If program exits 0, then replier forwards the message to address and exits 99, so that further commands in .qmail are ignored. If program exits 111, replier exits 111, so that delivery is retried later. If program exits anything else, or does not exist, replier exits 0, so the rest of .qmail is processed. If it encounters a permanent error in handling a message, replier exits 100. If it encounters a temporary error a message, replier exits 111. replier does not distribute bounce messages: if the environment variable $SENDER is set, and is either empty or #@[], then replier rejects the message.

To create a replier that handles email sent to an address, use replier-config.

Environment variables

replier supplies several environment variables to program. The recipient address that caused message processing by replier has one of two forms: inlocal-request@domain, where inlocal matches the first line of dir/inlocal, or request@domain, when dir/inlocal has an empty first line. In either case, replier sets the following environment variables:

$REQUEST is request in the recipient address.

$REQUEST2 is the portion of request in the recipient address that follows the first hyphen.

$REQUEST3 is the portion of request in the recipient address that follows the second hyphen.

$REQUEST4 is the portion of request in the recipient address that follows the third hyphen.

NB: These environment variables are not quoted. They are under the control of the sender.

If running as non-root, replier uses environment set according to files in $HOME/.defaultqueue directory. You can skip $HOME/.defaultqueue if SKIP_LOCAL_ENVIRONMENT is set. If QUEUE_BASE environment variable is not set, it additionally uses environment set according to files in /etc/indimail/control/defaultqueue directory (for any uid).

SEE ALSO

ifaddr(1), iftocc(1), iftoccfrom(1), bouncesaying(1), condredirect(1), condtomaildir(1), dot-qmail(5), dot-forward(1), fastforward(1), forward(1), printforward(1), setforward(1), filterto(1), except(1), preline(1), qmail-command(8), qnotify(1), qreceipt(1), rrforward(1), qmail-queue(8)

Clone this wiki locally