1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
<html> <head> </head> <body> <pre>
PIPE(8) PIPE(8)
<b>NAME</b>
pipe - Postfix delivery to external command
<b>SYNOPSIS</b>
<b>pipe</b> [generic Postfix daemon options] command_attributes...
<b>DESCRIPTION</b>
The <b>pipe</b> daemon processes requests from the Postfix queue
manager to deliver messages to external commands. This
program expects to be run from the <a href="master.8.html"><b>master</b>(8)</a> process man-
ager.
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 <b>pipe</b> 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 problem
reports are sent to the <a href="bounce.8.html"><b>bounce</b>(8)</a> or <a href="defer.8.html"><b>defer</b>(8)</a> daemon as
appropriate.
<b>SINGLE-RECIPIENT</b> <b>DELIVERY</b>
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
<i>transport_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> <b>=</b> <b>1</b>
in the Postfix <b>main.cf</b> file, where <i>transport</i> is the name
in the first column of the Postfix <b>master.cf</b> entry for the
pipe-based delivery transport.
<b>COMMAND</b> <b>ATTRIBUTE</b> <b>SYNTAX</b>
The external command attributes are given in the <b>master.cf</b>
file at the end of a service definition. The syntax is as
follows:
<b>flags=BDFORhqu.</b>> (optional)
Optional message processing flags. By default, a
message is copied unchanged.
<b>B</b> Append a blank line at the end of each mes-
sage. This is required by some mail user
agents that recognize "<b>From</b> " lines only
when preceded by a blank line.
<b>D</b> Prepend a "<b>Delivered-To:</b> <i>recipient</i>" message
header with the envelope recipient address.
Note: for this to work, the <i>transport_</i><b>desti-</b>
<b>nation</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> must be 1.
<b>F</b> Prepend a "<b>From</b> <i>sender</i> <i>time_stamp</i>" envelope
header to the message content. This is
expected by, for example, <b>UUCP</b> software.
<b>O</b> Prepend an "<b>X-Original-To:</b> <i>recipient</i>" mes-
sage header with the recipient address as
given to Postfix. Note: for this to work,
the <i>transport_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
must be 1.
<b>R</b> Prepend a <b>Return-Path:</b> message header with
the envelope sender address.
<b>h</b> Fold the command-line <b>$recipient</b> domain name
and <b>$nexthop</b> host name to lower case. This
is recommended for delivery via <b>UUCP</b>.
<b>q</b> Quote white space and other special charac-
ters in the command-line <b>$sender</b> and <b>$recip-</b>
<b>ient</b> address localparts (text to the left of
the right-most <b>@</b> character), according to an
8-bit transparent version of <a href="http://www.faqs.org/rfcs/rfc822.html">RFC 822</a>. This
is recommended for delivery via <b>UUCP</b> or
<b>BSMTP</b>.
The result is compatible with the address
parsing of command-line recipients by the
Postfix <b>sendmail</b> mail submission command.
The <b>q</b> flag affects only entire addresses,
not the partial address information from the
<b>$user</b>, <b>$extension</b> or <b>$mailbox</b> command-line
macros.
<b>u</b> Fold the command-line <b>$recipient</b> address
localpart (text to the left of the right-
most <b>@</b> character) to lower case. This is
recommended for delivery via <b>UUCP</b>.
<b>.</b> Prepend <b>.</b> to lines starting with "<b>.</b>". This
is needed by, for example, <b>BSMTP</b> software.
> Prepend > to lines starting with "<b>From</b> ".
This is expected by, for example, <b>UUCP</b> soft-
ware.
<b>user</b>=<i>username</i> (required)
<b>user</b>=<i>username</i>:<i>groupname</i>
The external command is executed with the rights of
the specified <i>username</i>. The software refuses to
execute commands with root privileges, or with the
privileges of the mail system owner. If <i>groupname</i>
is specified, the corresponding group ID is used
instead of the group ID of <i>username</i>.
<b>eol=string</b> (optional, default: <b>\n</b>)
The output record delimiter. Typically one would
use either <b>\r\n</b> or <b>\n</b>. The usual C-style backslash
escape sequences are recognized: <b>\a</b> <b>\b</b> <b>\f</b> <b>\n</b> <b>\r</b> <b>\t</b>
<b>\v</b> <b>\</b><i>octal</i> and <b>\\</b>.
<b>size</b>=<i>size_limit</i> (optional)
Messages greater in size than this limit (in bytes)
will be bounced back to the sender.
<b>argv</b>=<i>command</i>... (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:
<b>${extension</b>}
This macro expands to the extension part of
a recipient address. For example, with an
address <i>user+foo@domain</i> the extension is
<i>foo</i>.
A command-line argument that contains
<b>${extension</b>} expands into as many command-
line arguments as there are recipients.
This information is modified by the <b>u</b> flag
for case folding.
<b>${mailbox</b>}
This macro expands to the complete local
part of a recipient address. For example,
with an address <i>user+foo@domain</i> the mailbox
is <i>user+foo</i>.
A command-line argument that contains
<b>${mailbox</b>} expands into as many command-line
arguments as there are recipients.
This information is modified by the <b>u</b> flag
for case folding.
<b>${nexthop</b>}
This macro expands to the next-hop hostname.
This information is modified by the <b>h</b> flag
for case folding.
<b>${recipient</b>}
This macro expands to the complete recipient
address.
A command-line argument that contains
<b>${recipient</b>} expands into as many command-
line arguments as there are recipients.
This information is modified by the <b>hqu</b>
flags for quoting and case folding.
<b>${sender</b>}
This macro expands to the envelope sender
address.
This information is modified by the <b>q</b> flag
for quoting.
<b>${size</b>}
This macro expands to Postfix's idea of the
message size, which is an approximation of
the size of the message as delivered.
<b>${user</b>}
This macro expands to the username part of a
recipient address. For example, with an
address <i>user+foo@domain</i> the username part is
<i>user</i>.
A command-line argument that contains
<b>${user</b>} expands into as many command-line
arguments as there are recipients.
This information is modified by the <b>u</b> flag
for case folding.
In addition to the form ${<i>name</i>}, the forms $<i>name</i> and
$(<i>name</i>) are also recognized. Specify <b>$$</b> where a single <b>$</b>
is wanted.
<b>DIAGNOSTICS</b>
Command exit status codes are expected to follow the con-
ventions defined in <<b>sysexits.h</b>>.
Problems and transactions are logged to <b>syslogd</b>(8). Cor-
rupted message files are marked so that the queue manager
can move them to the <b>corrupt</b> queue for further inspection.
<b>SECURITY</b>
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.
<b>CONFIGURATION</b> <b>PARAMETERS</b>
The following <b>main.cf</b> parameters are especially relevant
to this program. See the Postfix <b>main.cf</b> file for syntax
details and for default values. Use the <b>postfix</b> <b>reload</b>
command after a configuration change.
<b>Miscellaneous</b>
<b>export</b><i>_</i><b>environment</b>
List of names of environment parameters that can be
exported to non-Postfix processes.
<b>mail</b><i>_</i><b>owner</b>
The process privileges used while not running an
external command.
<b>Resource</b> <b>controls</b>
In the text below, <i>transport</i> is the first field in a <b>mas-</b>
<b>ter.cf</b> entry.
<i>transport_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>
Limit the number of parallel deliveries to the same
destination, for delivery via the named <i>transport</i>.
The default limit is taken from the <b>default</b><i>_</i><b>desti-</b>
<b>nation</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b> parameter. The limit is
enforced by the Postfix queue manager.
<i>transport_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
Limit the number of recipients per message deliv-
ery, for delivery via the named <i>transport</i>. The
default limit is taken from the <b>default</b><i>_</i><b>destina-</b>
<b>tion</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> parameter. The limit is
enforced by the Postfix queue manager.
<i>transport_</i><b>time</b><i>_</i><b>limit</b>
Limit the time for delivery to external command,
for delivery via the named <b>transport</b>. The default
limit is taken from the <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b> parame-
ter. The limit is enforced by the pipe delivery
agent.
<b>SEE</b> <b>ALSO</b>
<a href="bounce.8.html">bounce(8)</a> non-delivery status reports
<a href="master.8.html">master(8)</a> process manager
<a href="qmgr.8.html">qmgr(8)</a> queue manager
syslogd(8) system logging
<b>LICENSE</b>
The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA
PIPE(8)
</pre> </body> </html>
|