PIPE(8postfix) | PIPE(8postfix) |
pipe - Postfix delivery to external command
pipe [generic Postfix daemon options] command_attributes...
The pipe(8) daemon processes requests from the Postfix queue manager to deliver messages to external commands. This program expects to be run from the master(8) process manager.
Message attributes such as sender address, recipient address and next-hop host name can be specified as command-line macros that are expanded before the external command is executed.
The pipe(8) daemon updates queue files and marks recipients as finished, or it informs the queue manager that delivery should be tried again at a later time. Delivery status reports are sent to the bounce(8), defer(8) or trace(8) daemon as appropriate.
Some destinations cannot handle more than one recipient per delivery request. Examples are pagers or fax machines. In addition, multi-recipient delivery is undesirable when prepending a Delivered-to: or X-Original-To: message header.
To prevent Postfix from sending multiple recipients per delivery request, specify
transport_destination_recipient_limit = 1
in the Postfix main.cf file, where transport is the name in the first column of the Postfix master.cf entry for the pipe-based delivery transport.
The external command attributes are given in the master.cf file at the end of a service definition. The syntax is as follows:
This feature is available as of Postfix 2.3.
This feature is available as of Postfix 2.2.
The D flag also enforces loop detection (Postfix 2.5 and later): if a message already contains a Delivered-To: header with the same recipient address, then the message is returned as undeliverable. The address comparison is case insensitive.
This feature is available as of Postfix 2.0.
This feature is available as of Postfix 2.0.
This feature is available as of Postfix 2.5.
The result is compatible with the address parsing of command-line recipients by the Postfix sendmail(1) mail submission command.
The q flag affects only entire addresses, not the partial address information from the $user, $extension or $mailbox command-line macros.
If the null sender replacement text is a non-empty string then it is affected by the q flag for address quoting in command-line arguments.
The null sender replacement text may be empty; this form is recommended for content filters that feed mail back into Postfix. The empty sender address is not affected by the q flag for address quoting in command-line arguments.
Caution: a null sender address is easily mis-parsed by naive software. For example, when the pipe(8) daemon executes a command such as:
Wrong: command -f$sender -- $recipient
Right: command -f $sender -- $recipient
Specify "{" and "}" around command arguments that contain whitespace (Postfix 3.0 and later). Whitespace after the opening "{" and before the closing "}" is ignored.
In the command argument vector, the following macros are recognized and replaced with corresponding information from the Postfix queue manager delivery request.
In addition to the form ${name}, the forms $name and the deprecated form $(name) are also recognized. Specify $$ where a single $ is wanted.
This feature is available as of Postfix 2.2.
This feature is available as of Postfix 2.2.
This feature is available as of Postfix 2.2.
This feature is available as of Postfix 2.5.
This feature is available as of Postfix 2.2.
This information is modified by the h flag for case folding.
This feature is available as of Postfix 2.5.
A command-line argument that contains ${extension} expands into as many command-line arguments as there are recipients.
This information is modified by the u flag for case folding.
A command-line argument that contains ${mailbox} expands to as many command-line arguments as there are recipients.
This information is modified by the u flag for case folding.
This information is modified by the h flag for case folding.
A command-line argument that contains ${original_recipient} expands to as many command-line arguments as there are recipients.
This information is modified by the hqu flags for quoting and case folding.
This feature is available as of Postfix 2.5.
This feature is available as of Postfix 2.11.
A command-line argument that contains ${recipient} expands to as many command-line arguments as there are recipients.
This information is modified by the hqu flags for quoting and case folding.
This feature is available as of Postfix 2.2.
This feature is available as of Postfix 2.2.
This feature is available as of Postfix 2.2.
This information is modified by the q flag for quoting.
A command-line argument that contains ${user} expands into as many command-line arguments as there are recipients.
This information is modified by the u flag for case folding.
RFC 3463 (Enhanced status codes)
Command exit status codes are expected to follow the conventions defined in <sysexits.h>. Exit status 0 means normal successful completion.
In the case of a non-zero exit status, a limited amount of command output is logged, and reported in a delivery status notification. When the output begins with a 4.X.X or 5.X.X enhanced status code, the status code takes precedence over the non-zero exit status (Postfix version 2.3 and later).
After successful delivery (zero exit status) a limited amount of command output is logged, and reported in "success" delivery status notifications (Postfix 3.0 and later). This command output is not examined for the presence of an enhanced status code.
Problems and transactions are logged to syslogd(8) or postlogd(8). Corrupted message files are marked so that the queue manager can move them to the corrupt queue for further inspection.
This program needs a dual personality 1) to access the private Postfix queue and IPC mechanisms, and 2) to execute external commands as the specified user. It is therefore security sensitive.
Changes to main.cf are picked up automatically as pipe(8) processes run for only a limited amount of time. Use the command "postfix reload" to speed up a change.
The text below provides only a parameter summary. See postconf(5) for more details including examples.
In the text below, transport is the first field in a master.cf entry.
Implemented in the qmgr(8) daemon:
Available in Postfix version 3.0 and later:
Available in Postfix version 3.3 and later:
qmgr(8), queue manager bounce(8), delivery status reports postconf(5), configuration parameters master(5), generic daemon options master(8), process manager postlogd(8), Postfix logging syslogd(8), system logging
The Secure Mailer license must be distributed with this software.
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA