1PIPE(8)                     System Manager's Manual                    PIPE(8)
2
3
4

NAME

6       pipe - Postfix delivery to external command
7

SYNOPSIS

9       pipe [generic Postfix daemon options] command_attributes...
10

DESCRIPTION

12       The pipe(8) daemon processes requests from the Postfix queue manager to
13       deliver messages to external commands.  This program expects to be  run
14       from the master(8) process manager.
15
16       Message  attributes such as sender address, recipient address and next-
17       hop host name can be specified as command-line macros that are expanded
18       before the external command is executed.
19
20       The  pipe(8)  daemon  updates  queue files and marks recipients as fin‐
21       ished, or it informs the queue manager that delivery  should  be  tried
22       again  at  a  later  time.  Delivery  status  reports  are  sent to the
23       bounce(8), defer(8) or trace(8) daemon as appropriate.
24

SINGLE-RECIPIENT DELIVERY

26       Some external commands cannot handle more than one recipient per deliv‐
27       ery request. Examples of such transports are pagers or fax machines.
28
29       To  prevent  Postfix  from  sending  multiple  recipients  per delivery
30       request, specify
31
32           transport_destination_recipient_limit = 1
33
34       in the Postfix main.cf file, where transport is the name in  the  first
35       column  of  the  Postfix  master.cf  entry  for the pipe-based delivery
36       transport.
37

COMMAND ATTRIBUTE SYNTAX

39       The external command attributes are given in the master.cf file at  the
40       end of a service definition.  The syntax is as follows:
41
42       chroot=pathname (optional)
43              Change  the  process root directory and working directory to the
44              named directory. This happens before switching to the privileges
45              specified  with  the  user  attribute,  and before executing the
46              optional directory=pathname directive. Delivery is  deferred  in
47              case of failure.
48
49              This feature is available as of Postfix 2.3.
50
51       directory=pathname (optional)
52              Change to the named directory before executing the external com‐
53              mand.  The directory must be accessible for the  user  specified
54              with the user attribute (see below).  The default working direc‐
55              tory is $queue_directory.  Delivery is deferred in case of fail‐
56              ure.
57
58              This feature is available as of Postfix 2.2.
59
60       eol=string (optional, default: \n)
61              The output record delimiter. Typically one would use either \r\n
62              or \n. The usual C-style backslash escape sequences  are  recog‐
63              nized:  \a \b \f \n \r \t \v \ddd (up to three octal digits) and
64              \\.
65
66       flags=BDFORhqu.> (optional)
67              Optional message processing flags.  By  default,  a  message  is
68              copied unchanged.
69
70              B      Append  a  blank line at the end of each message. This is
71                     required by some mail user agents that recognize "From  "
72                     lines only when preceded by a blank line.
73
74              D      Prepend  a  "Delivered-To: recipient" message header with
75                     the envelope recipient address. Note: for this  to  work,
76                     the transport_destination_recipient_limit must be 1.
77
78                     This feature is available as of Postfix 2.0.
79
80              F      Prepend a "From sender time_stamp" envelope header to the
81                     message content.  This is expected by, for example,  UUCP
82                     software.
83
84              O      Prepend an "X-Original-To: recipient" message header with
85                     the recipient address as given to Postfix. Note: for this
86                     to  work,  the transport_destination_recipient_limit must
87                     be 1.
88
89                     This feature is available as of Postfix 2.0.
90
91              R      Prepend a Return-Path: message header with  the  envelope
92                     sender address.
93
94              h      Fold the command-line $recipient domain name and $nexthop
95                     host name to lower case.  This is recommended for  deliv‐
96                     ery via UUCP.
97
98              q      Quote  white  space  and  other special characters in the
99                     command-line $sender and  $recipient  address  localparts
100                     (text to the left of the right-most @ character), accord‐
101                     ing to an 8-bit transparent version of RFC 822.  This  is
102                     recommended for delivery via UUCP or BSMTP.
103
104                     The result is compatible with the address parsing of com‐
105                     mand-line recipients by the Postfix sendmail(1) mail sub‐
106                     mission command.
107
108                     The q flag affects only entire addresses, not the partial
109                     address information from the $user, $extension or  $mail‐
110                     box command-line macros.
111
112              u      Fold  the command-line $recipient address localpart (text
113                     to the left of the right-most @ character) to lower case.
114                     This is recommended for delivery via UUCP.
115
116              .      Prepend  "."  to  lines starting with ".". This is needed
117                     by, for example, BSMTP software.
118
119              >      Prepend ">" to lines  starting  with  "From  ".  This  is
120                     expected by, for example, UUCP software.
121
122       null_sender=replacement (default: MAILER-DAEMON)
123              Replace  the  null  sender  address (typically used for delivery
124              status notifications) with the specified text when expanding the
125              $sender  command-line  macro,  and  when  generating  a From_ or
126              Return-Path: message header.
127
128              If the null sender replacement text is a non-empty  string  then
129              it is affected by the q flag for address quoting in command-line
130              arguments.
131
132              The null sender replacement text may be empty; this form is rec‐
133              ommended  for  content filters that feed mail back into Postfix.
134              The empty sender address is not  affected  by  the  q  flag  for
135              address quoting in command-line arguments.
136
137              Caution:  a  null  sender  address is easily mis-parsed by naive
138              software. For example, when the pipe(8) daemon executes  a  com‐
139              mand such as:
140
141                  command -f$sender -- $recipient (bad)
142
143              the  command  will mis-parse the -f option value when the sender
144              address is a null string.  For correct parsing, specify  $sender
145              as an argument by itself:
146
147                  command -f $sender -- $recipient (good)
148
149              This feature is available with Postfix 2.3 and later.
150
151       size=size_limit (optional)
152              Messages  greater  in  size  than  this limit (in bytes) will be
153              returned to the sender as undeliverable.
154
155       user=username (required)
156
157       user=username:groupname
158              Execute the external command with the rights  of  the  specified
159              username.   The  software  refuses to execute commands with root
160              privileges, or with the privileges of the mail system owner.  If
161              groupname  is  specified,  the  corresponding  group  ID is used
162              instead of the group ID of username.
163
164       argv=command... (required)
165              The command to be executed. This must be specified as  the  last
166              command attribute.  The command is executed directly, i.e. with‐
167              out interpretation of shell meta characters by a  shell  command
168              interpreter.
169
170              In  the command argument vector, the following macros are recog‐
171              nized and replaced with corresponding information from the Post‐
172              fix queue manager delivery request.
173
174              In addition to the form ${name}, the forms $name and $(name) are
175              also recognized.  Specify $$ where a single $ is wanted.
176
177              ${client_address}
178                     This macro expands to the remote client network address.
179
180                     This is available in Postfix 2.2 and later.
181
182              ${client_helo}
183                     This macro expands to  the  remote  client  HELO  command
184                     parameter.
185
186                     This is available in Postfix 2.2 and later.
187
188              ${client_hostname}
189                     This macro expands to the remote client hostname.
190
191                     This is available in Postfix 2.2 and later.
192
193              ${client_protocol}
194                     This macro expands to the remote client protocol.
195
196                     This is available in Postfix 2.2 and later.
197
198              ${extension}
199                     This  macro  expands to the extension part of a recipient
200                     address.  For example, with  an  address  user+foo@domain
201                     the extension is foo.
202
203                     A   command-line   argument  that  contains  ${extension}
204                     expands into as many command-line arguments as there  are
205                     recipients.
206
207                     This information is modified by the u flag for case fold‐
208                     ing.
209
210              ${mailbox}
211                     This macro expands to the complete local part of a recip‐
212                     ient    address.     For   example,   with   an   address
213                     user+foo@domain the mailbox is user+foo.
214
215                     A command-line argument that contains ${mailbox}  expands
216                     to  as  many  command-line arguments as there are recipi‐
217                     ents.
218
219                     This information is modified by the u flag for case fold‐
220                     ing.
221
222              ${nexthop}
223                     This macro expands to the next-hop hostname.
224
225                     This information is modified by the h flag for case fold‐
226                     ing.
227
228              ${recipient}
229                     This macro expands to the complete recipient address.
230
231                     A  command-line  argument  that   contains   ${recipient}
232                     expands  to  as  many command-line arguments as there are
233                     recipients.
234
235                     This information is modified by the hqu flags for quoting
236                     and case folding.
237
238              ${sasl_method}
239                     This  macro  expands to the SASL authentication mechanism
240                     used during the reception of the message. An empty string
241                     is  passed  if the message has been received without SASL
242                     authentication.
243
244                     This is available in Postfix 2.2 and later.
245
246              ${sasl_sender}
247                     This macro expands to the  SASL  sender  name  (i.e.  the
248                     original  submitter  as  per  RFC  2554)  used during the
249                     reception of the message.
250
251                     This is available in Postfix 2.2 and later.
252
253              ${sasl_username}
254                     This macro expands to the SASL user name used during  the
255                     reception  of  the  message. An empty string is passed if
256                     the message has been received  without  SASL  authentica‐
257                     tion.
258
259                     This is available in Postfix 2.2 and later.
260
261              ${sender}
262                     This  macro  expands  to  the envelope sender address. By
263                     default, the null sender address expands  to  MAILER-DAE‐
264                     MON;  this can be changed with the null_sender attribute,
265                     as described above.
266
267                     This information is modified by the q flag for quoting.
268
269              ${size}
270                     This macro expands to Postfix's idea of the message size,
271                     which  is  an approximation of the size of the message as
272                     delivered.
273
274              ${user}
275                     This macro expands to the username part  of  a  recipient
276                     address.   For  example,  with an address user+foo@domain
277                     the username part is user.
278
279                     A command-line argument  that  contains  ${user}  expands
280                     into  as many command-line arguments as there are recipi‐
281                     ents.
282
283                     This information is modified by the u flag for case fold‐
284                     ing.
285

STANDARDS

287       RFC 3463 (Enhanced status codes)
288

DIAGNOSTICS

290       Command  exit  status  codes  are  expected  to  follow the conventions
291       defined in <sysexits.h>.  Exit status 0 means normal successful comple‐
292       tion.
293
294       Postfix  version  2.3  and later support RFC 3463-style enhanced status
295       codes.  If a command terminates with a non-zero exit  status,  and  the
296       command  output  begins  with an enhanced status code, this status code
297       takes precedence over the non-zero exit status.
298
299       Problems and transactions are logged to syslogd(8).  Corrupted  message
300       files are marked so that the queue manager can move them to the corrupt
301       queue for further inspection.
302

SECURITY

304       This program needs a dual personality 1) to access the private  Postfix
305       queue  and  IPC  mechanisms, and 2) to execute external commands as the
306       specified user. It is therefore security sensitive.
307

CONFIGURATION PARAMETERS

309       Changes to main.cf are picked up automatically as pipe(8) processes run
310       for  only a limited amount of time. Use the command "postfix reload" to
311       speed up a change.
312
313       The text below provides only a parameter summary. See  postconf(5)  for
314       more details including examples.
315

RESOURCE AND RATE CONTROLS

317       In the text below, transport is the first field in a master.cf entry.
318
319       transport_destination_concurrency_limit   ($default_destination_concur‐
320       rency_limit)
321              Limit the number of parallel deliveries to the same destination,
322              for  delivery via the named transport.  The limit is enforced by
323              the Postfix queue manager.
324
325       transport_destination_recipient_limit     ($default_destination_recipi‐
326       ent_limit)
327              Limit  the number of recipients per message delivery, for deliv‐
328              ery via the named transport.  The limit is enforced by the Post‐
329              fix queue manager.
330
331       transport_time_limit ($command_time_limit)
332              Limit  the  time  for delivery to external command, for delivery
333              via the named transport.  The limit  is  enforced  by  the  pipe
334              delivery agent.
335
336              Postfix  2.4  and later support a suffix that specifies the time
337              unit: s (seconds), m (minutes), h (hours), d (days), w  (weeks).
338              The default time unit is seconds.
339

MISCELLANEOUS CONTROLS

341       config_directory (see 'postconf -d' output)
342              The  default  location of the Postfix main.cf and master.cf con‐
343              figuration files.
344
345       daemon_timeout (18000s)
346              How much time a Postfix daemon process  may  take  to  handle  a
347              request before it is terminated by a built-in watchdog timer.
348
349       delay_logging_resolution_limit (2)
350              The  maximal  number of digits after the decimal point when log‐
351              ging sub-second delay values.
352
353       export_environment (see 'postconf -d' output)
354              The list of environment variables that a  Postfix  process  will
355              export to non-Postfix processes.
356
357       ipc_timeout (3600s)
358              The  time  limit  for  sending  or receiving information over an
359              internal communication channel.
360
361       mail_owner (postfix)
362              The UNIX system account that owns the  Postfix  queue  and  most
363              Postfix daemon processes.
364
365       max_idle (100s)
366              The  maximum  amount of time that an idle Postfix daemon process
367              waits for an incoming connection before terminating voluntarily.
368
369       max_use (100)
370              The maximal number of incoming connections that a Postfix daemon
371              process will service before terminating voluntarily.
372
373       process_id (read-only)
374              The process ID of a Postfix command or daemon process.
375
376       process_name (read-only)
377              The process name of a Postfix command or daemon process.
378
379       queue_directory (see 'postconf -d' output)
380              The location of the Postfix top-level queue directory.
381
382       recipient_delimiter (empty)
383              The   separator   between  user  names  and  address  extensions
384              (user+foo).
385
386       syslog_facility (mail)
387              The syslog facility of Postfix logging.
388
389       syslog_name (postfix)
390              The mail system name that is prepended to the  process  name  in
391              syslog  records,  so  that  "smtpd" becomes, for example, "post‐
392              fix/smtpd".
393

SEE ALSO

395       qmgr(8), queue manager
396       bounce(8), delivery status reports
397       postconf(5), configuration parameters
398       master(5), generic daemon options
399       master(8), process manager
400       syslogd(8), system logging
401

LICENSE

403       The Secure Mailer license must be distributed with this software.
404

AUTHOR(S)

406       Wietse Venema
407       IBM T.J. Watson Research
408       P.O. Box 704
409       Yorktown Heights, NY 10598, USA
410
411
412
413                                                                       PIPE(8)
Impressum