1 <!doctype html public
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <meta http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
5 <title> Postfix manual - pipe(
8)
</title>
10 pipe - Postfix delivery to external command
13 <b>pipe
</b> [generic Postfix daemon options] command_attributes...
16 The
<a href=
"pipe.8.html"><b>pipe
</b>(
8)
</a> daemon processes requests from the Postfix
17 queue manager to deliver messages to external commands.
18 This program expects to be run from the
<a href=
"master.8.html"><b>master
</b>(
8)
</a> process
21 Message attributes such as sender address, recipient
22 address and next-hop host name can be specified as com-
23 mand-line macros that are expanded before the external
26 The
<a href=
"pipe.8.html"><b>pipe
</b>(
8)
</a> daemon updates queue files and marks recipi-
27 ents as finished, or it informs the queue manager that
28 delivery should be tried again at a later time. Delivery
29 status reports are sent to the
<a href=
"bounce.8.html"><b>bounce
</b>(
8)
</a>,
<a href=
"defer.8.html"><b>defer
</b>(
8)
</a> or
30 <a href=
"trace.8.html"><b>trace
</b>(
8)
</a> daemon as appropriate.
32 <b>SINGLE-RECIPIENT DELIVERY
</b>
33 Some destinations cannot handle more than one recipient
34 per delivery request. Examples are pagers or fax machines.
35 In addition, multi-recipient delivery is undesirable when
36 prepending a
<b>Delivered-to:
</b> or
<b>X-Original-To:
</b> message
39 To prevent Postfix from sending multiple recipients per
40 delivery request, specify
42 <b><a href=
"postconf.5.html#transport_destination_recipient_limit"><i>transport
</i>_destination_recipient_limit
</a> =
1</b>
44 in the Postfix
<a href=
"postconf.5.html"><b>main.cf
</b></a> file, where
<i>transport
</i> is the name
45 in the first column of the Postfix
<a href=
"master.5.html"><b>master.cf
</b></a> entry for the
46 pipe-based delivery transport.
48 <b>COMMAND ATTRIBUTE SYNTAX
</b>
49 The external command attributes are given in the
<a href=
"master.5.html"><b>master.cf
</b></a>
50 file at the end of a service definition. The syntax is as
53 <b>chroot=
</b><i>pathname
</i> (optional)
54 Change the process root directory and working
55 directory to the named directory. This happens
56 before switching to the privileges specified with
57 the
<b>user
</b> attribute, and before executing the
58 optional
<b>directory=
</b><i>pathname
</i> directive. Delivery is
59 deferred in case of failure.
61 This feature is available as of Postfix
2.3.
63 <b>directory=
</b><i>pathname
</i> (optional)
64 Change to the named directory before executing the
65 external command. The directory must be accessible
66 for the user specified with the
<b>user
</b> attribute (see
67 below). The default working directory is
68 <b>$
<a href=
"postconf.5.html#queue_directory">queue_directory
</a></b>. Delivery is deferred in case of
71 This feature is available as of Postfix
2.2.
73 <b>eol=
</b><i>string
</i> (optional, default:
<b>\n
</b>)
74 The output record delimiter. Typically one would
75 use either
<b>\r\n
</b> or
<b>\n
</b>. The usual C-style backslash
76 escape sequences are recognized:
<b>\a \b \f \n \r \t
</b>
77 <b>\v \
</b><i>ddd
</i> (up to three octal digits) and
<b>\\
</b>.
79 <b>flags=BDFORXhqu.
</b>> (optional)
80 Optional message processing flags. By default, a
81 message is copied unchanged.
83 <b>B
</b> Append a blank line at the end of each mes-
84 sage. This is required by some mail user
85 agents that recognize
"<b>From</b> " lines only
86 when preceded by a blank line.
88 <b>D
</b> Prepend a
"<b>Delivered-To:</b> <i>recipient</i>" message
89 header with the envelope recipient address.
90 Note: for this to work, the
<i>transport
</i><b>_desti-
</b>
91 <b>nation_recipient_limit
</b> must be
1 (see SIN-
92 GLE-RECIPIENT DELIVERY above for details).
94 The
<b>D
</b> flag also enforces loop detection
95 (Postfix
2.5 and later): if a message
96 already contains a
<b>Delivered-To:
</b> header with
97 the same recipient address, then the message
98 is returned as undeliverable. The address
99 comparison is case insensitive.
101 This feature is available as of Postfix
2.0.
103 <b>F
</b> Prepend a
"<b>From</b> <i>sender time</i><b>_</b><i>stamp</i>" envelope
104 header to the message content. This is
105 expected by, for example,
<b>UUCP
</b> software.
107 <b>O
</b> Prepend an
"<b>X-Original-To:</b> <i>recipient</i>" mes-
108 sage header with the recipient address as
109 given to Postfix. Note: for this to work,
110 the
<b><a href=
"postconf.5.html#transport_destination_recipient_limit"><i>transport
</i>_destination_recipient_limit
</a></b>
111 must be
1 (see SINGLE-RECIPIENT DELIVERY
114 This feature is available as of Postfix
2.0.
116 <b>R
</b> Prepend a
<b>Return-Path:
</b> message header with
117 the envelope sender address.
119 <b>X
</b> Indicate that the external command performs
120 final delivery. This flag affects the sta-
121 tus reported in
"success" DSN (delivery sta-
122 tus notification) messages, and changes it
123 from
"relayed" into
"delivered".
125 This feature is available as of Postfix
2.5.
127 <b>h
</b> Fold the command-line
<b>$original_recipient
</b>
128 and
<b>$recipient
</b> address domain part (text to
129 the right of the right-most
<b>@
</b> character) to
130 lower case; fold the entire command-line
131 <b>$domain
</b> and
<b>$nexthop
</b> host or domain informa-
132 tion to lower case. This is recommended for
133 delivery via
<b>UUCP
</b>.
135 <b>q
</b> Quote white space and other special charac-
136 ters in the command-line
<b>$sender
</b>,
<b>$origi-
</b>
137 <b>nal_recipient
</b> and
<b>$recipient
</b> address local-
138 parts (text to the left of the right-most
<b>@
</b>
139 character), according to an
8-bit transpar-
140 ent version of
<a href=
"http://tools.ietf.org/html/rfc822">RFC
822</a>. This is recommended
141 for delivery via
<b>UUCP
</b> or
<b>BSMTP
</b>.
143 The result is compatible with the address
144 parsing of command-line recipients by the
145 Postfix
<a href=
"sendmail.1.html"><b>sendmail
</b>(
1)
</a> mail submission command.
147 The
<b>q
</b> flag affects only entire addresses,
148 not the partial address information from the
149 <b>$user
</b>,
<b>$extension
</b> or
<b>$mailbox
</b> command-line
152 <b>u
</b> Fold the command-line
<b>$original_recipient
</b>
153 and
<b>$recipient
</b> address localpart (text to
154 the left of the right-most
<b>@
</b> character) to
155 lower case. This is recommended for deliv-
158 <b>.
</b> Prepend
"<b>.</b>" to lines starting with
"<b>.</b>". This
159 is needed by, for example,
<b>BSMTP
</b> software.
161 > Prepend
">" to lines starting with
"<b>From</b> ".
162 This is expected by, for example,
<b>UUCP
</b> soft-
165 <b>null_sender
</b>=
<i>replacement
</i> (default: MAILER-DAEMON)
166 Replace the null sender address (typically used for
167 delivery status notifications) with the specified
168 text when expanding the
<b>$sender
</b> command-line macro,
169 and when generating a From_ or Return-Path: message
172 If the null sender replacement text is a non-empty
173 string then it is affected by the
<b>q
</b> flag for
174 address quoting in command-line arguments.
176 The null sender replacement text may be empty; this
177 form is recommended for content filters that feed
178 mail back into Postfix. The empty sender address is
179 not affected by the
<b>q
</b> flag for address quoting in
180 command-line arguments.
182 Caution: a null sender address is easily mis-parsed
183 by naive software. For example, when the
<a href=
"pipe.8.html"><b>pipe
</b>(
8)
</a>
184 daemon executes a command such as:
186 <i>Wrong
</i>: command -f$sender -- $recipient
188 the command will mis-parse the -f option value when
189 the sender address is a null string. For correct
190 parsing, specify
<b>$sender
</b> as an argument by itself:
192 <i>Right
</i>: command -f $sender -- $recipient
194 This feature is available as of Postfix
2.3.
196 <b>size
</b>=
<i>size
</i><b>_
</b><i>limit
</i> (optional)
197 Don't deliver messages that exceed this size limit
198 (in bytes); return them to the sender instead.
200 <b>user
</b>=
<i>username
</i> (required)
202 <b>user
</b>=
<i>username
</i>:
<i>groupname
</i>
203 Execute the external command with the user ID and
204 group ID of the specified
<i>username
</i>. The software
205 refuses to execute commands with root privileges,
206 or with the privileges of the mail system owner. If
207 <i>groupname
</i> is specified, the corresponding group ID
208 is used instead of the group ID of
<i>username
</i>.
210 <b>argv
</b>=
<i>command
</i>... (required)
211 The command to be executed. This must be specified
212 as the last command attribute. The command is exe-
213 cuted directly, i.e. without interpretation of
214 shell meta characters by a shell command inter-
217 In the command argument vector, the following
218 macros are recognized and replaced with correspond-
219 ing information from the Postfix queue manager
222 In addition to the form ${
<i>name
</i>}, the forms $
<i>name
</i>
223 and $(
<i>name
</i>) are also recognized. Specify
<b>$$
</b> where
224 a single
<b>$
</b> is wanted.
226 <b>${client_address
</b>}
227 This macro expands to the remote client net-
230 This feature is available as of Postfix
2.2.
232 <b>${client_helo
</b>}
233 This macro expands to the remote client HELO
236 This feature is available as of Postfix
2.2.
238 <b>${client_hostname
</b>}
239 This macro expands to the remote client
242 This feature is available as of Postfix
2.2.
244 <b>${client_port
</b>}
245 This macro expands to the remote client TCP
248 This feature is available as of Postfix
2.5.
250 <b>${client_protocol
</b>}
251 This macro expands to the remote client pro-
254 This feature is available as of Postfix
2.2.
257 This macro expands to the domain portion of
258 the recipient address. For example, with an
259 address
<i>user+foo@domain
</i> the domain is
262 This information is modified by the
<b>h
</b> flag
265 This feature is available as of Postfix
2.5.
268 This macro expands to the extension part of
269 a recipient address. For example, with an
270 address
<i>user+foo@domain
</i> the extension is
273 A command-line argument that contains
274 <b>${extension
</b>} expands into as many command-
275 line arguments as there are recipients.
277 This information is modified by the
<b>u
</b> flag
281 This macro expands to the complete local
282 part of a recipient address. For example,
283 with an address
<i>user+foo@domain
</i> the mailbox
286 A command-line argument that contains
287 <b>${mailbox
</b>} expands to as many command-line
288 arguments as there are recipients.
290 This information is modified by the
<b>u
</b> flag
294 This macro expands to the next-hop hostname.
296 This information is modified by the
<b>h
</b> flag
299 <b>${original_recipient
</b>}
300 This macro expands to the complete recipient
301 address before any address rewriting or
304 A command-line argument that contains
305 <b>${original_recipient
</b>} expands to as many
306 command-line arguments as there are recipi-
309 This information is modified by the
<b>hqu
</b>
310 flags for quoting and case folding.
312 This feature is available as of Postfix
2.5.
315 This macro expands to the complete recipient
318 A command-line argument that contains
319 <b>${recipient
</b>} expands to as many command-line
320 arguments as there are recipients.
322 This information is modified by the
<b>hqu
</b>
323 flags for quoting and case folding.
325 <b>${sasl_method
</b>}
326 This macro expands to the name of the SASL
327 authentication mechanism in the AUTH command
328 when the Postfix SMTP server received the
331 This feature is available as of Postfix
2.2.
333 <b>${sasl_sender
</b>}
334 This macro expands to the SASL sender name
335 (i.e. the original submitter as per
<a href=
"http://tools.ietf.org/html/rfc4954">RFC
</a>
336 <a href=
"http://tools.ietf.org/html/rfc4954">4954</a>) in the MAIL FROM command when the
337 Postfix SMTP server received the message.
339 This feature is available as of Postfix
2.2.
341 <b>${sasl_username
</b>}
342 This macro expands to the SASL user name in
343 the AUTH command when the Postfix SMTP
344 server received the message.
346 This feature is available as of Postfix
2.2.
349 This macro expands to the envelope sender
350 address. By default, the null sender address
351 expands to MAILER-DAEMON; this can be
352 changed with the
<b>null_sender
</b> attribute, as
355 This information is modified by the
<b>q
</b> flag
359 This macro expands to Postfix's idea of the
360 message size, which is an approximation of
361 the size of the message as delivered.
364 This macro expands to the username part of a
365 recipient address. For example, with an
366 address
<i>user+foo@domain
</i> the username part is
369 A command-line argument that contains
370 <b>${user
</b>} expands into as many command-line
371 arguments as there are recipients.
373 This information is modified by the
<b>u
</b> flag
377 <a href=
"http://tools.ietf.org/html/rfc3463">RFC
3463</a> (Enhanced status codes)
380 Command exit status codes are expected to follow the con-
381 ventions defined in
<<b>sysexits.h
</b>>. Exit status
0 means
382 normal successful completion.
384 In the case of a non-zero exit status, a limited amount of
385 command output is reported in an delivery status notifica-
386 tion. When the output begins with a
4.X.X or
5.X.X
387 enhanced status code, the status code takes precedence
388 over the non-zero exit status (Postfix version
2.3 and
391 Problems and transactions are logged to
<b>syslogd
</b>(
8). Cor-
392 rupted message files are marked so that the queue manager
393 can move them to the
<b>corrupt
</b> queue for further inspection.
396 This program needs a dual personality
1) to access the
397 private Postfix queue and IPC mechanisms, and
2) to exe-
398 cute external commands as the specified user. It is there-
399 fore security sensitive.
401 <b>CONFIGURATION PARAMETERS
</b>
402 Changes to
<a href=
"postconf.5.html"><b>main.cf
</b></a> are picked up automatically as
<a href=
"pipe.8.html"><b>pipe
</b>(
8)
</a>
403 processes run for only a limited amount of time. Use the
404 command
"<b>postfix reload</b>" to speed up a change.
406 The text below provides only a parameter summary. See
407 <a href=
"postconf.5.html"><b>postconf
</b>(
5)
</a> for more details including examples.
409 <b>RESOURCE AND RATE CONTROLS
</b>
410 In the text below,
<i>transport
</i> is the first field in a
<b>mas-
</b>
413 <b><a href=
"postconf.5.html#transport_destination_concurrency_limit"><i>transport
</i>_destination_concurrency_limit
</a> ($
<a href=
"postconf.5.html#default_destination_concurrency_limit">default_destina
</a>-
</b>
414 <b><a href=
"postconf.5.html#default_destination_concurrency_limit">tion_concurrency_limit
</a>)
</b>
415 Limit the number of parallel deliveries to the same
416 destination, for delivery via the named
<i>transport
</i>.
417 The limit is enforced by the Postfix queue manager.
419 <b><a href=
"postconf.5.html#transport_destination_recipient_limit"><i>transport
</i>_destination_recipient_limit
</a> ($
<a href=
"postconf.5.html#default_destination_recipient_limit">default_destina
</a>-
</b>
420 <b><a href=
"postconf.5.html#default_destination_recipient_limit">tion_recipient_limit
</a>)
</b>
421 Limit the number of recipients per message deliv-
422 ery, for delivery via the named
<i>transport
</i>. The
423 limit is enforced by the Postfix queue manager.
425 <b><a href=
"postconf.5.html#transport_time_limit"><i>transport
</i>_time_limit
</a> ($
<a href=
"postconf.5.html#command_time_limit">command_time_limit
</a>)
</b>
426 Limit the time for delivery to external command,
427 for delivery via the named
<i>transport
</i>. The limit is
428 enforced by the pipe delivery agent.
430 Postfix
2.4 and later support a suffix that speci-
431 fies the time unit: s (seconds), m (minutes), h
432 (hours), d (days), w (weeks). The default time unit
435 <b>MISCELLANEOUS CONTROLS
</b>
436 <b><a href=
"postconf.5.html#config_directory">config_directory
</a> (see 'postconf -d' output)
</b>
437 The default location of the Postfix
<a href=
"postconf.5.html">main.cf
</a> and
438 <a href=
"master.5.html">master.cf
</a> configuration files.
440 <b><a href=
"postconf.5.html#daemon_timeout">daemon_timeout
</a> (
18000s)
</b>
441 How much time a Postfix daemon process may take to
442 handle a request before it is terminated by a
443 built-in watchdog timer.
445 <b><a href=
"postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit
</a> (
2)
</b>
446 The maximal number of digits after the decimal
447 point when logging sub-second delay values.
449 <b><a href=
"postconf.5.html#export_environment">export_environment
</a> (see 'postconf -d' output)
</b>
450 The list of environment variables that a Postfix
451 process will export to non-Postfix processes.
453 <b><a href=
"postconf.5.html#ipc_timeout">ipc_timeout
</a> (
3600s)
</b>
454 The time limit for sending or receiving information
455 over an internal communication channel.
457 <b><a href=
"postconf.5.html#mail_owner">mail_owner
</a> (postfix)
</b>
458 The UNIX system account that owns the Postfix queue
459 and most Postfix daemon processes.
461 <b><a href=
"postconf.5.html#max_idle">max_idle
</a> (
100s)
</b>
462 The maximum amount of time that an idle Postfix
463 daemon process waits for an incoming connection
464 before terminating voluntarily.
466 <b><a href=
"postconf.5.html#max_use">max_use
</a> (
100)
</b>
467 The maximal number of incoming connections that a
468 Postfix daemon process will service before termi-
471 <b><a href=
"postconf.5.html#process_id">process_id
</a> (read-only)
</b>
472 The process ID of a Postfix command or daemon
475 <b><a href=
"postconf.5.html#process_name">process_name
</a> (read-only)
</b>
476 The process name of a Postfix command or daemon
479 <b><a href=
"postconf.5.html#queue_directory">queue_directory
</a> (see 'postconf -d' output)
</b>
480 The location of the Postfix top-level queue direc-
483 <b><a href=
"postconf.5.html#recipient_delimiter">recipient_delimiter
</a> (empty)
</b>
484 The separator between user names and address exten-
487 <b><a href=
"postconf.5.html#syslog_facility">syslog_facility
</a> (mail)
</b>
488 The syslog facility of Postfix logging.
490 <b><a href=
"postconf.5.html#syslog_name">syslog_name
</a> (see 'postconf -d' output)
</b>
491 The mail system name that is prepended to the
492 process name in syslog records, so that
"smtpd"
493 becomes, for example,
"postfix/smtpd".
496 <a href=
"qmgr.8.html">qmgr(
8)
</a>, queue manager
497 <a href=
"bounce.8.html">bounce(
8)
</a>, delivery status reports
498 <a href=
"postconf.5.html">postconf(
5)
</a>, configuration parameters
499 <a href=
"master.5.html">master(
5)
</a>, generic daemon options
500 <a href=
"master.8.html">master(
8)
</a>, process manager
501 syslogd(
8), system logging
504 The Secure Mailer license must be distributed with this
509 IBM T.J. Watson Research
511 Yorktown Heights, NY
10598, USA
514 </pre> </body> </html>