PIPE(8) PIPE(8)
[1mNAME[0m
pipe - Postfix delivery to external command SYNOPSIS [1mpipe[0m
[generic Postfix daemon options] command_attributes...
[1mDESCRIPTION[0m
The [1mpipe[22m(8) daemon processes requests from the Postfix
queue manager to deliver messages to external commands.
This program expects to be run from the [1mmaster[22m(8) process
manager.
Message attributes such as sender address, recipient
address and next-hop host name can be specified as com-
mand-line macros that are expanded before the external
command is executed.
The [1mpipe[22m(8) daemon updates queue files and marks recipi-
ents 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 [1mbounce[22m(8), [1mdefer[22m(8) or
[1mtrace[22m(8) daemon as appropriate. SINGLE-RECIPIENT DELIVERY
Some external commands cannot handle more than one recipi-
ent per delivery request. Examples of such transports are
pagers, fax machines, and so on.
To prevent Postfix from sending multiple recipients per
delivery request, specify
[4mtransport[24m[1m_destination_recipient_limit = 1[0m
in the Postfix [1mmain.cf [22mfile, where [4mtransport[24m is the name
in the first column of the Postfix [1mmaster.cf [22mentry for the
pipe-based delivery transport. COMMAND ATTRIBUTE SYNTAX
The external command attributes are given in the [1mmaster.cf[0m
file at the end of a service definition. The syntax is as
follows:
[1mdirectory=[4m[22mpathname[24m (optional, default: [1m$queue_directory[22m)
Change to the named directory before executing the
external command. Delivery is deferred in case of
failure.
This feature is available as of Postfix 2.2.
[1meol=string [22m(optional, default: [1m\n[22m)
The output record delimiter. Typically one would
use either [1m\r\n [22mor [1m\n[22m. The usual C-style backslash
escape sequences are recognized: [1m\a \b \f \n \r \t[0m
[1m\v \[4m[22mddd[24m (up to three octal digits) and [1m\\[22m.
[1mflags=BDFORhqu.> [22m(optional)
Optional message processing flags. By default, a
message is copied unchanged.
[1mB [22mAppend a blank line at the end of each mes-
sage. This is required by some mail user
agents that recognize "[1mFrom [22m" lines only
when preceded by a blank line.
[1mD [22mPrepend a "[1mDelivered-To: [4m[22mrecipient[24m" message
header with the envelope recipient address.
Note: for this to work, the [4mtransport[24m[1m_desti-[0m
[1mnation_recipient_limit [22mmust be 1.
This feature is available as of Postfix 2.0.
[1mF [22mPrepend a "[1mFrom [4m[22msender[24m [4mtime_stamp[24m" envelope
header to the message content. This is
expected by, for example, [1mUUCP [22msoftware.
[1mO [22mPrepend an "[1mX-Original-To: [4m[22mrecipient[24m" mes-
sage header with the recipient address as
given to Postfix. Note: for this to work,
the [4mtransport[24m[1m_destination_recipient_limit[0m
must be 1.
This feature is available as of Postfix 2.0.
[1mR [22mPrepend a [1mReturn-Path: [22mmessage header with
the envelope sender address.
[1mh [22mFold the command-line [1m$recipient [22mdomain name
and [1m$nexthop [22mhost name to lower case. This
is recommended for delivery via [1mUUCP[22m.
[1mq [22mQuote white space and other special charac-
ters in the command-line [1m$sender [22mand [1m$recip-[0m
[1mient [22maddress localparts (text to the left of
the right-most [1m@ [22mcharacter), according to an
8-bit transparent version of RFC 822. This
is recommended for delivery via [1mUUCP [22mor
[1mBSMTP[22m.
The result is compatible with the address
parsing of command-line recipients by the
Postfix [1msendmail[22m(1) mail submission command.
The [1mq [22mflag affects only entire addresses,
not the partial address information from the
[1m$user[22m, [1m$extension [22mor [1m$mailbox [22mcommand-line
macros.
[1mu [22mFold the command-line [1m$recipient [22maddress
localpart (text to the left of the right-
most [1m@ [22mcharacter) to lower case. This is
recommended for delivery via [1mUUCP[22m.
[1m. [22mPrepend "[1m.[22m" to lines starting with "[1m.[22m". This
is needed by, for example, [1mBSMTP [22msoftware.
[1m> [22mPrepend "[1m>[22m" to lines starting with "[1mFrom [22m".
This is expected by, for example, [1mUUCP [22msoft-
ware.
[1mnull_sender[22m=[4mreplacement[24m (default: MAILER-DAEMON)
Replace the null sender address, which is typically
used for delivery status notifications, with the
specified text when expanding the [1m$sender [22mcommand-
line macro, and when generating a From_ or Return-
Path: message header.
If the null sender replacement text is a non-empty
string then it is affected by the [1mq [22mflag 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 [1mq [22mflag for address quoting in
command-line arguments.
Caution: a null sender address is easily mis-parsed
by naive software. For example, when the [1mpipe[22m(8)
daemon executes a command such as:
command -f$sender -- $recipient
the command will mis-parse the -f option value when
the sender address is a null string. For correct
parsing, specify [1m$sender [22mas an argument by itself.
This feature is available with Postfix 2.3 and
later and was backported to Postfix 2.2.x for use
with Kolab2.
[1msize[22m=[4msize_limit[24m (optional)
Messages greater in size than this limit (in bytes)
will be bounced back to the sender.
[1muser[22m=[4musername[24m (required)
[1muser[22m=[4musername[24m:[4mgroupname[0m
The external command is executed with the rights of
the specified [4musername[24m. The software refuses to
execute commands with root privileges, or with the
privileges of the mail system owner. If [4mgroupname[0m
is specified, the corresponding group ID is used
instead of the group ID of [4musername[24m.
[1margv[22m=[4mcommand[24m... (required)
The command to be executed. This must be specified
as the last command attribute. The command is exe-
cuted directly, i.e. without interpretation of
shell meta characters by a shell command inter-
preter.
In the command argument vector, the following
macros are recognized and replaced with correspond-
ing information from the Postfix queue manager
delivery request.
In addition to the form ${[4mname[24m}, the forms $[4mname[0m
and $([4mname[24m) are also recognized. Specify [1m$$ [22mwhere
a single [1m$ [22mis wanted.
[1m${client_address[22m}
This macro expands to the remote client net-
work address.
This is available in Postfix 2.2 and later.
[1m${client_helo[22m}
This macro expands to the remote client HELO
command parameter.
This is available in Postfix 2.2 and later.
[1m${client_hostname[22m}
This macro expands to the remote client
hostname.
This is available in Postfix 2.2 and later.
[1m${client_protocol[22m}
This macro expands to the remote client pro-
tocol.
This is available in Postfix 2.2 and later.
[1m${extension[22m}
This macro expands to the extension part of
a recipient address. For example, with an
address [4muser+foo@domain[24m the extension is
[4mfoo[24m.
A command-line argument that contains
[1m${extension[22m} expands into as many command-
line arguments as there are recipients.
This information is modified by the [1mu [22mflag
for case folding.
[1m${mailbox[22m}
This macro expands to the complete local
part of a recipient address. For example,
with an address [4muser+foo@domain[24m the mailbox
is [4muser+foo[24m.
A command-line argument that contains
[1m${mailbox[22m} expands into as many command-line
arguments as there are recipients.
This information is modified by the [1mu [22mflag
for case folding.
[1m${nexthop[22m}
This macro expands to the next-hop hostname.
This information is modified by the [1mh [22mflag
for case folding.
[1m${recipient[22m}
This macro expands to the complete recipient
address.
A command-line argument that contains
[1m${recipient[22m} expands into as many command-
line arguments as there are recipients.
This information is modified by the [1mhqu[0m
flags for quoting and case folding.
[1m${sasl_method[22m}
This macro expands to the SASL authentica-
tion mechanism used during the reception of
the message. An empty string is passed if
the message has been received without SASL
authentication.
This is available in Postfix 2.2 and later.
[1m${sasl_sender[22m}
This macro expands to the SASL sender name
(i.e. the original submitter as per RFC
2554) used during the reception of the mes-
sage.
This is available in Postfix 2.2 and later.
[1m${sasl_username[22m}
This macro expands to the SASL user name
used during the reception of the message. An
empty string is passed if the message has
been received without SASL authentication.
This is available in Postfix 2.2 and later.
[1m${sender[22m}
This macro expands to the envelope sender
address. By default, the null sender address
expands to MAILER-DAEMON; this can be
changed with the [1mnull_sender [22mattribute, as
described above.
This information is modified by the [1mq [22mflag
for quoting.
[1m${size[22m}
This macro expands to Postfix's idea of the
message size, which is an approximation of
the size of the message as delivered.
[1m${user[22m}
This macro expands to the username part of a
recipient address. For example, with an
address [4muser+foo@domain[24m the username part is
[4muser[24m.
A command-line argument that contains
[1m${user[22m} expands into as many command-line
arguments as there are recipients.
This information is modified by the [1mu [22mflag
for case folding.
[1mDIAGNOSTICS[0m
Command exit status codes are expected to follow the con-
ventions defined in <[1msysexits.h[22m>.
Problems and transactions are logged to [1msyslogd[22m(8). Cor-
rupted message files are marked so that the queue manager
can move them to the [1mcorrupt [22mqueue for further inspection.
SECURITY
This program needs a dual personality 1) to access the
private Postfix queue and IPC mechanisms, and 2) to exe-
cute external commands as the specified user. It is there-
fore security sensitive. CONFIGURATION PARAMETERS
Changes to [1mmain.cf [22mare picked up automatically as [1mpipe[22m(8)
processes run for only a limited amount of time. Use the
command "[1mpostfix reload[22m" to speed up a change.
The text below provides only a parameter summary. See
[1mpostconf[22m(5) for more details including examples. RESOURCE
AND RATE CONTROLS
In the text below, [4mtransport[24m is the first field in a [1mmas-[0m
[1mter.cf [22mentry.
[4mtransport[24m[1m_destination_concurrency_limit ($default_destina-[0m
[1mtion_concurrency_limit)[0m
Limit the number of parallel deliveries to the same
destination, for delivery via the named [4mtransport[24m.
The limit is enforced by the Postfix queue manager.
[4mtransport[24m[1m_destination_recipient_limit ($default_destina-[0m
[1mtion_recipient_limit)[0m
Limit the number of recipients per message deliv-
ery, for delivery via the named [4mtransport[24m. The
limit is enforced by the Postfix queue manager.
[4mtransport[24m[1m_time_limit ($command_time_limit)[0m
Limit the time for delivery to external command,
for delivery via the named [4mtransport[24m. The limit is
enforced by the pipe delivery agent. MISCELLANEOUS
CONTROLS
[1mconfig_directory (see 'postconf -d' output)[0m
The default location of the Postfix main.cf and
master.cf configuration files.
[1mdaemon_timeout (18000s)[0m
How much time a Postfix daemon process may take to
handle a request before it is terminated by a
built-in watchdog timer.
[1mexport_environment (see 'postconf -d' output)[0m
The list of environment variables that a Postfix
process will export to non-Postfix processes.
[1mipc_timeout (3600s)[0m
The time limit for sending or receiving information
over an internal communication channel.
[1mmail_owner (postfix)[0m
The UNIX system account that owns the Postfix queue
and most Postfix daemon processes.
[1mmax_idle (100s)[0m
The maximum amount of time that an idle Postfix
daemon process waits for the next service request
before exiting.
[1mmax_use (100)[0m
The maximal number of connection requests before a
Postfix daemon process terminates.
[1mprocess_id (read-only)[0m
The process ID of a Postfix command or daemon
process.
[1mprocess_name (read-only)[0m
The process name of a Postfix command or daemon
process.
[1mqueue_directory (see 'postconf -d' output)[0m
The location of the Postfix top-level queue direc-
tory.
[1mrecipient_delimiter (empty)[0m
The separator between user names and address exten-
sions (user+foo).
[1msyslog_facility (mail)[0m
The syslog facility of Postfix logging.
[1msyslog_name (postfix)[0m
The mail system name that is prepended to the
process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd". SEE ALSO
qmgr(8), queue manager bounce(8), delivery status
reports postconf(5), configuration parameters mas-
ter(5), generic daemon options master(8), process
manager syslogd(8), system logging LICENSE
The Secure Mailer license must be distributed with
this software. AUTHOR(S) Wietse Venema IBM T.J.
Watson Research P.O. Box 704 Yorktown Heights, NY
10598, USA
PIPE(8)