summaryrefslogtreecommitdiff
path: root/gnu/dist/postfix/html/local.8.html
blob: 26e48689e5969ec61ec2869078bfddefed5caefc (plain)
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
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
<html> <head> </head> <body> <pre>



LOCAL(8)                                                 LOCAL(8)


<b>NAME</b>
       local - Postfix local mail delivery

<b>SYNOPSIS</b>
       <b>local</b> [generic Postfix daemon options]

<b>DESCRIPTION</b>
       The  <b>local</b>  daemon  processes  delivery  requests from the
       Postfix queue manager to deliver mail to local recipients.
       Each  delivery  request  specifies  a queue file, a sender
       address, a domain or host to deliver to, and one  or  more
       recipients.   This program expects to be run from the <a href="master.8.html"><b>mas-</b>
       <b>ter</b>(8)</a> process manager.

       The <b>local</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>SYSTEM-WIDE</b> <b>AND</b> <b>USER-LEVEL</b> <b>ALIASING</b>
       The system adminstrator can set up one or more system-wide
       <b>sendmail</b>-style  alias databases.  Users can have <b>sendmail</b>-
       style ~/.<b>forward</b> files.  Mail for <i>name</i> is delivered to the
       alias  <i>name</i>,  to  destinations  in  ~<i>name</i>/.<b>forward</b>, to the
       mailbox owned by the user <i>name</i>, or  it  is  sent  back  as
       undeliverable.

       The  system  administrator can specify a comma/space sepa-
       rated list of  ~/.<b>forward</b>  like  files  through  the  <b>for-</b>
       <b>ward</b><i>_</i><b>path</b>  configuration  parameter.  Upon  delivery,  the
       local delivery agent tries each pathname in the list until
       a file is found.  The <b>forward</b><i>_</i><b>path</b> parameter is subject to
       interpolation of <b>$user</b> (recipient username), <b>$home</b> (recip-
       ient home directory), <b>$shell</b> (recipient shell), <b>$recipient</b>
       (complete  recipient   address),   <b>$extension</b>   (recipient
       address  extension),  <b>$domain</b>  (recipient  domain),  <b>local</b>
       (entire recipient address localpart) and <b>$recipient</b><i>_</i><b>delim-</b>
       <b>iter.</b>  The  forms  <i>${name?value}</i>  and <i>${name:value}</i> expand
       conditionally to <i>value</i> when <i>$name</i>  is  (is  not)  defined.
       Characters  that  may have special meaning to the shell or
       file system are replaced  by  underscores.   The  list  of
       acceptable characters is specified with the <b>forward</b><i>_</i><b>expan-</b>
       <b>sion</b><i>_</i><b>filter</b> configuration parameter.

       An alias or ~/.<b>forward</b> file may list  any  combination  of
       external   commands,  destination  file  names,  <b>:include:</b>
       directives, or mail addresses.  See <a href="aliases.5.html"><b>aliases</b>(5)</a> for a  pre-
       cise  description. Each line in a user's .<b>forward</b> file has
       the same syntax as the right-hand part of an alias.

       When an address is  found  in  its  own  alias  expansion,
       delivery  is  made  to  the  user  instead. When a user is
       listed in the user's own ~/.<b>forward</b> file, delivery is made



                                                                1





LOCAL(8)                                                 LOCAL(8)


       to  the  user's mailbox instead.  An empty ~/.<b>forward</b> file
       means do not forward mail.

       In order to prevent the mail system from using  up  unrea-
       sonable   amounts  of  memory,  input  records  read  from
       <b>:include:</b> or from ~/.<b>forward</b>  files  are  broken  up  into
       chunks of length <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>.

       While  expanding aliases, ~/.<b>forward</b> files, and so on, the
       program attempts to avoid duplicate deliveries. The <b>dupli-</b>
       <b>cate</b><i>_</i><b>filter</b><i>_</i><b>limit</b>  configuration parameter limits the num-
       ber of remembered recipients.

<b>MAIL</b> <b>FORWARDING</b>
       For the sake of reliability, forwarded mail is  re-submit-
       ted  as  a new message, so that each recipient has a sepa-
       rate on-file delivery status record.

       In order to stop mail forwarding loops early, the software
       adds  an  optional  <b>Delivered-To:</b> header with the envelope
       recipient address. If mail arrives for a recipient that is
       already  listed  in a <b>Delivered-To:</b> header, the message is
       bounced.

<b>MAILBOX</b> <b>DELIVERY</b>
       The default per-user mailbox is a file in  the  UNIX  mail
       spool  directory (<b>/var/mail/</b><i>user</i> or <b>/var/spool/mail/</b><i>user</i>);
       the location can be specified with  the  <b>mail</b><i>_</i><b>spool</b><i>_</i><b>direc-</b>
       <b>tory</b> configuration parameter.

       Alternatively,  the  per-user mailbox can be a file in the
       user's home  directory  with  a  name  specified  via  the
       <b>home</b><i>_</i><b>mailbox</b>  configuration  parameter. Specify a relative
       path name. Specify a name ending in <b>/</b> for <b>qmail</b>-compatible
       <b>maildir</b> delivery.

       Mailbox  delivery  can be delegated to an external command
       specified with the <b>mailbox</b><i>_</i><b>command</b>  configuration  parame-
       ter.  The  command  executes  with  the  privileges of the
       recipient user (exception: in case of  delivery  as  root,
       the    command    executes    with   the   privileges   of
       <b>default</b><i>_</i><b>privs</b>).

       Mailbox delivery can be delegated to  alternative  message
       transports  specified  in  the  <b>master.cf</b> file.  The <b>mail-</b>
       <b>box</b><i>_</i><b>transport</b> configuration parameter specifies a  message
       transport  that  is  to  be used for all local recipients,
       regardless of whether they are found in  the  UNIX  passwd
       database.   The  <b>fallback</b><i>_</i><b>transport</b>  parameter specifies a
       message transport for recipients that are not found in the
       UNIX passwd database.

       In the case of UNIX-style mailbox delivery, the <b>local</b> dae-
       mon prepends a "<b>From</b> <i>sender</i> <i>time_stamp</i>" envelope header to



                                                                2





LOCAL(8)                                                 LOCAL(8)


       each  message,  prepends  an optional <b>Delivered-To:</b> header
       with the envelope recipient address,  prepends  a  <b>Return-</b>
       <b>Path:</b>  header with the envelope sender address, prepends a
       &gt; character to lines beginning with "<b>From</b> ",  and  appends
       an empty line.  The mailbox is locked for exclusive access
       while delivery is in progress. In  case  of  problems,  an
       attempt  is  made  to truncate the mailbox to its original
       length.

       In the case of <b>maildir</b> delivery, the local daemon prepends
       an optional <b>Delivered-To:</b> header with the envelope recipi-
       ent address and prepends a <b>Return-Path:</b>  header  with  the
       envelope sender address.

<b>EXTERNAL</b> <b>COMMAND</b> <b>DELIVERY</b>
       The    <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>commands</b>    configuration   parameter
       restricts delivery to external commands. The default  set-
       ting  (<b>alias,</b>  <b>forward</b>)  forbids  command  destinations in
       <b>:include:</b> files.

       The command is executed directly  where  possible.  Assis-
       tance  by the shell (<b>/bin/sh</b> on UNIX systems) is used only
       when the command contains shell magic characters, or  when
       the command invokes a shell built-in command.

       A  limited  amount  of command output (standard output and
       standard error) is captured for inclusion with  non-deliv-
       ery  status  reports.  A command is forcibly terminated if
       it does not complete  within  <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b>  seconds.
       Command  exit status codes are expected to follow the con-
       ventions defined in &lt;<b>sysexits.h</b>&gt;.

       A limited amount of message context is exported via  envi-
       ronment  variables. Characters that may have special mean-
       ing to the shell are replaced by underscores.  The list of
       acceptable characters is specified with the <b>command</b><i>_</i><b>expan-</b>
       <b>sion</b><i>_</i><b>filter</b> configuration parameter.

       <b>SHELL</b>  The recipient user's login shell.

       <b>HOME</b>   The recipient user's home directory.

       <b>USER</b>   The bare recipient name.

       <b>EXTENSION</b>
              The optional recipient address extension.

       <b>DOMAIN</b> The recipient address domain part.

       <b>LOGNAME</b>
              The bare recipient name.

       <b>LOCAL</b>  The entire recipient address localpart (text to the
              left of the rightmost @ character).



                                                                3





LOCAL(8)                                                 LOCAL(8)


       <b>RECIPIENT</b>
              The entire recipient address.

       The <b>PATH</b> environment variable is always reset to a system-
       dependent default path, and the <b>TZ</b> (time zone) environment
       variable is always passed on without change.

       The current working directory is the mail queue directory.

       The <b>local</b> daemon prepends a "<b>From</b> <i>sender</i> <i>time_stamp</i>" enve-
       lope  header  to each message, prepends an optional <b>Deliv-</b>
       <b>ered-To:</b>  header  with  the  recipient  envelope  address,
       prepends  a  <b>Return-Path:</b>  header with the sender envelope
       address, and appends an empty line.

<b>EXTERNAL</b> <b>FILE</b> <b>DELIVERY</b>
       The <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>files</b> configuration parameter  restricts
       delivery  to  external  files. The default setting (<b>alias,</b>
       <b>forward</b>) forbids file  destinations  in  <b>:include:</b>  files.
       Specify  a  pathname  ending  in  <b>/</b>  for  <b>qmail</b>-compatible
       <b>maildir</b> delivery.

       The <b>local</b> daemon prepends a "<b>From</b> <i>sender</i> <i>time_stamp</i>" enve-
       lope  header  to each message, prepends an optional <b>Deliv-</b>
       <b>ered-To:</b>  header  with  the  recipient  envelope  address,
       prepends  a  &gt;  character to lines beginning with "<b>From</b> ",
       and appends an empty line.  The envelope sender address is
       available  in  the <b>Return-Path:</b> header.  When the destina-
       tion is a regular file, it is locked for exclusive  access
       while  delivery  is  in  progress. In case of problems, an
       attempt is made to truncate a regular file to its original
       length.

       In the case of <b>maildir</b> delivery, the local daemon prepends
       an optional <b>Delivered-To:</b> header with the envelope recipi-
       ent  address.  The envelope sender address is available in
       the <b>Return-Path:</b> header.

<b>ADDRESS</b> <b>EXTENSION</b>
       The optional <b>recipient</b><i>_</i><b>delimiter</b>  configuration  parameter
       specifies  how  to  separate address extensions from local
       recipient names.

       For example, with  "<b>recipient</b><i>_</i><b>delimiter</b>  <b>=</b>  <b>+</b>",  mail  for
       <i>name</i>+<i>foo</i>  is  delivered  to  the  alias <i>name</i>+<i>foo</i> or to the
       alias <i>name</i>, to  the  destinations  listed  in  ~<i>name</i>/.<b>for-</b>
       <b>ward</b>+<i>foo</i> or in ~<i>name</i>/.<b>forward</b>, to the mailbox owned by the
       user <i>name</i>, or it is sent back as undeliverable.

       In all cases the <b>local</b> daemon prepends an opional  `<b>Deliv-</b>
       <b>ered-To:</b> <i>name</i>+<i>foo</i>' header line.

<b>DELIVERY</b> <b>RIGHTS</b>
       Deliveries  to  external  files  and external commands are



                                                                4





LOCAL(8)                                                 LOCAL(8)


       made with the rights of the receiving user on whose behalf
       the  delivery  is made.  In the absence of a user context,
       the <b>local</b> daemon uses the owner rights  of  the  <b>:include:</b>
       file or alias database.  When those files are owned by the
       superuser, delivery is made with the rights specified with
       the <b>default</b><i>_</i><b>privs</b> configuration parameter.

<b>STANDARDS</b>
       RFC 822 (ARPA Internet Text Messages)

<b>DIAGNOSTICS</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 afterwards.

       Depending  on the setting of the <b>notify</b><i>_</i><b>classes</b> parameter,
       the postmaster is notified of bounces and of  other  trou-
       ble.

<b>BUGS</b>
       For  security  reasons,  the  message  delivery  status of
       external commands or of external  files  is  never  check-
       pointed to file. As a result, the program may occasionally
       deliver more than once to a command or external file. Bet-
       ter safe than sorry.

       Mutually-recursive  aliases  or  ~/.<b>forward</b>  files are not
       detected early.  The resulting  mail  forwarding  loop  is
       broken by the use of the <b>Delivered-To:</b> message header.

<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>alias</b><i>_</i><b>maps</b>
              List of alias databases.

       <b>expand</b><i>_</i><b>owner</b><i>_</i><b>alias</b>
              When delivering to an alias that has an owner- com-
              panion  alias,  set  the envelope sender address to
              the right-hand side of  the  owner  alias,  instead
              using of the left-hand side address.

       <b>forward</b><i>_</i><b>path</b>
              Search list for .forward files.  The names are sub-
              ject to <i>$name</i> expansion.

       <b>local</b><i>_</i><b>command</b><i>_</i><b>shell</b>
              Shell to use for external  command  execution  (for
              example,  /some/where/smrsh  -c).   When a shell is
              specified, it is  invoked  even  when  the  command



                                                                5





LOCAL(8)                                                 LOCAL(8)


              contains no shell built-in commands or meta charac-
              ters.

       <b>owner</b><i>_</i><b>request</b><i>_</i><b>special</b>
              Give special treatment to <b>owner-</b><i>xxx</i> and <i>xxx</i><b>-request</b>
              addresses.

       <b>prepend</b><i>_</i><b>delivered</b><i>_</i><b>header</b>
              Prepend   an  optional  <b>Delivered-To:</b>  header  upon
              external forwarding, delivery to command  or  file.
              Specify  zero  or  more of: <b>command,</b> <b>file,</b> <b>forward</b>.
              Turning off <b>Delivered-To:</b> when forwarding  mail  is
              not recommended.

       <b>recipient</b><i>_</i><b>delimiter</b>
              Separator between username and address extension.

<b>Mailbox</b> <b>delivery</b>
       <b>fallback</b><i>_</i><b>transport</b>
              Message transport for recipients that are not found
              in the UNIX passwd database.  This parameter  over-
              rides <b>luser</b><i>_</i><b>relay</b>.

       <b>home</b><i>_</i><b>mailbox</b>
              Pathname  of  a  mailbox  relative to a user's home
              directory.  Specify a path ending in <b>/</b> for maildir-
              style delivery.

       <b>luser</b><i>_</i><b>relay</b>
              Destination  (<i>@domain</i>  or <i>address</i>) for non-existent
              users.  The <i>address</i> is subjected  to  <i>$name</i>  expan-
              sion.

       <b>mail</b><i>_</i><b>spool</b><i>_</i><b>directory</b>
              Directory  with  UNIX-style  mailboxes. The default
              pathname is system dependent.

       <b>mailbox</b><i>_</i><b>command</b>
              External command to use for mailbox  delivery.  The
              command  executes  with  the  recipient  privileges
              (exception: root). The string is subject  to  $name
              expansions.

       <b>mailbox</b><i>_</i><b>transport</b>
              Message  transport  to  use for mailbox delivery to
              all local recipients, whether or not they are found
              in  the UNIX passwd database.  This parameter over-
              rides all other configuration parameters that  con-
              trol mailbox delivery, including <b>luser</b><i>_</i><b>relay</b>.

<b>Locking</b> <b>controls</b>
       <b>deliver</b><i>_</i><b>lock</b><i>_</i><b>attempts</b>
              Limit  the  number of attempts to acquire an exclu-
              sive lock on a mailbox or external file.



                                                                6





LOCAL(8)                                                 LOCAL(8)


       <b>deliver</b><i>_</i><b>lock</b><i>_</i><b>delay</b>
              Time in  seconds  between  successive  attempts  to
              acquire an exclusive lock.

       <b>stale</b><i>_</i><b>lock</b><i>_</i><b>time</b>
              Limit the time after which a stale lock is removed.

<b>Resource</b> <b>controls</b>
       <b>command</b><i>_</i><b>time</b><i>_</i><b>limit</b>
              Limit the amount of time for delivery  to  external
              command.

       <b>duplicate</b><i>_</i><b>filter</b><i>_</i><b>limit</b>
              Limit  the size of the duplicate filter for results
              from alias etc. expansion.

       <b>line</b><i>_</i><b>length</b><i>_</i><b>limit</b>
              Limit the amount of memory used  for  processing  a
              partial input line.

       <b>local</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b>
              Limit the number of parallel deliveries to the same
              user.   The  default  limit  is  taken   from   the
              <b>default</b><i>_</i><b>destination</b><i>_</i><b>concurrency</b><i>_</i><b>limit</b> parameter.

       <b>local</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b>
              Limit  the  number of recipients per message deliv-
              ery.   The  default  limit  is   taken   from   the
              <b>default</b><i>_</i><b>destination</b><i>_</i><b>recipient</b><i>_</i><b>limit</b> parameter.

<b>Security</b> <b>controls</b>
       <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>commands</b>
              Restrict  the  usage  of  mail delivery to external
              command.

       <b>allow</b><i>_</i><b>mail</b><i>_</i><b>to</b><i>_</i><b>files</b>
              Restrict the usage of  mail  delivery  to  external
              file.

       <b>command</b><i>_</i><b>expansion</b><i>_</i><b>filter</b>
              What  characters  are  allowed  to  appear in $name
              expansions of mailbox_command.  Illegal  characters
              are replaced by underscores.

       <b>default</b><i>_</i><b>privs</b>
              Default  rights  for  delivery  to external file or
              command.

       <b>forward</b><i>_</i><b>expansion</b><i>_</i><b>filter</b>
              What characters are  allowed  to  appear  in  $name
              expansions  of forward_path. Illegal characters are
              replaced by underscores.





                                                                7





LOCAL(8)                                                 LOCAL(8)


<b>HISTORY</b>
       The <b>Delivered-To:</b> header appears in the  <b>qmail</b>  system  by
       Daniel Bernstein.

       The  <i>maildir</i>  structure  appears  in  the  <b>qmail</b> system by
       Daniel Bernstein.

<b>SEE</b> <b>ALSO</b>
       <a href="aliases.5.html">aliases(5)</a> format of alias database
       <a href="bounce.8.html">bounce(8)</a> non-delivery status reports
       <a href="postalias.1.html">postalias(1)</a> create/update alias database
       syslogd(8) system logging
       <a href="qmgr.8.html">qmgr(8)</a> queue manager

<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


































                                                                8


</pre> </body> </html>