Postfix3.3.1
local.c
[詳解]
1 /*++
2 /* NAME
3 /* local 8
4 /* SUMMARY
5 /* Postfix local mail delivery
6 /* SYNOPSIS
7 /* \fBlocal\fR [generic Postfix daemon options]
8 /* DESCRIPTION
9 /* The \fBlocal\fR(8) daemon processes delivery requests from the
10 /* Postfix queue manager to deliver mail to local recipients.
11 /* Each delivery request specifies a queue file, a sender address,
12 /* a domain or host to deliver to, and one or more recipients.
13 /* This program expects to be run from the \fBmaster\fR(8) process
14 /* manager.
15 /*
16 /* The \fBlocal\fR(8) daemon updates queue files and marks recipients
17 /* as finished, or it informs the queue manager that delivery should
18 /* be tried again at a later time. Delivery status reports are sent
19 /* to the \fBbounce\fR(8), \fBdefer\fR(8) or \fBtrace\fR(8) daemon as
20 /* appropriate.
21 /* CASE FOLDING
22 /* .ad
23 /* .fi
24 /* All delivery decisions are made using the bare recipient
25 /* name (i.e. the address localpart), folded to lower case.
26 /* See also under ADDRESS EXTENSION below for a few exceptions.
27 /* SYSTEM-WIDE AND USER-LEVEL ALIASING
28 /* .ad
29 /* .fi
30 /* The system administrator can set up one or more system-wide
31 /* \fBsendmail\fR-style alias databases.
32 /* Users can have \fBsendmail\fR-style ~/.\fBforward\fR files.
33 /* Mail for \fIname\fR is delivered to the alias \fIname\fR, to
34 /* destinations in ~\fIname\fR/.\fBforward\fR, to the mailbox owned
35 /* by the user \fIname\fR, or it is sent back as undeliverable.
36 /*
37 /* The system administrator can specify a comma/space separated list
38 /* of ~\fR/.\fBforward\fR like files through the \fBforward_path\fR
39 /* configuration parameter. Upon delivery, the local delivery agent
40 /* tries each pathname in the list until a file is found.
41 /*
42 /* Delivery via ~/.\fBforward\fR files is done with the privileges
43 /* of the recipient.
44 /* Thus, ~/.\fBforward\fR like files must be readable by the
45 /* recipient, and their parent directory needs to have "execute"
46 /* permission for the recipient.
47 /*
48 /* The \fBforward_path\fR parameter is subject to interpolation of
49 /* \fB$user\fR (recipient username), \fB$home\fR (recipient home
50 /* directory), \fB$shell\fR (recipient shell), \fB$recipient\fR
51 /* (complete recipient address), \fB$extension\fR (recipient address
52 /* extension), \fB$domain\fR (recipient domain), \fB$local\fR
53 /* (entire recipient address localpart) and
54 /* \fB$recipient_delimiter.\fR The forms \fI${name?value}\fR and
55 /* \fI${name:value}\fR expand conditionally to \fIvalue\fR when
56 /* \fI$name\fR is (is not) defined.
57 /* Characters that may have special meaning to the shell or file system
58 /* are replaced by underscores. The list of acceptable characters
59 /* is specified with the \fBforward_expansion_filter\fR configuration
60 /* parameter.
61 /*
62 /* An alias or ~/.\fBforward\fR file may list any combination of external
63 /* commands, destination file names, \fB:include:\fR directives, or
64 /* mail addresses.
65 /* See \fBaliases\fR(5) for a precise description. Each line in a
66 /* user's .\fBforward\fR file has the same syntax as the right-hand part
67 /* of an alias.
68 /*
69 /* When an address is found in its own alias expansion, delivery is
70 /* made to the user instead. When a user is listed in the user's own
71 /* ~/.\fBforward\fR file, delivery is made to the user's mailbox instead.
72 /* An empty ~/.\fBforward\fR file means do not forward mail.
73 /*
74 /* In order to prevent the mail system from using up unreasonable
75 /* amounts of memory, input records read from \fB:include:\fR or from
76 /* ~/.\fBforward\fR files are broken up into chunks of length
77 /* \fBline_length_limit\fR.
78 /*
79 /* While expanding aliases, ~/.\fBforward\fR files, and so on, the
80 /* program attempts to avoid duplicate deliveries. The
81 /* \fBduplicate_filter_limit\fR configuration parameter limits the
82 /* number of remembered recipients.
83 /* MAIL FORWARDING
84 /* .ad
85 /* .fi
86 /* For the sake of reliability, forwarded mail is re-submitted as
87 /* a new message, so that each recipient has a separate on-file
88 /* delivery status record.
89 /*
90 /* In order to stop mail forwarding loops early, the software adds an
91 /* optional
92 /* \fBDelivered-To:\fR header with the final envelope recipient address. If
93 /* mail arrives for a recipient that is already listed in a
94 /* \fBDelivered-To:\fR header, the message is bounced.
95 /* MAILBOX DELIVERY
96 /* .ad
97 /* .fi
98 /* The default per-user mailbox is a file in the UNIX mail spool
99 /* directory (\fB/var/mail/\fIuser\fR or \fB/var/spool/mail/\fIuser\fR);
100 /* the location can be specified with the \fBmail_spool_directory\fR
101 /* configuration parameter. Specify a name ending in \fB/\fR for
102 /* \fBqmail\fR-compatible \fBmaildir\fR delivery.
103 /*
104 /* Alternatively, the per-user mailbox can be a file in the user's home
105 /* directory with a name specified via the \fBhome_mailbox\fR
106 /* configuration parameter. Specify a relative path name. Specify a name
107 /* ending in \fB/\fR for \fBqmail\fR-compatible \fBmaildir\fR delivery.
108 /*
109 /* Mailbox delivery can be delegated to an external command specified
110 /* with the \fBmailbox_command_maps\fR and \fBmailbox_command\fR
111 /* configuration parameters. The command
112 /* executes with the privileges of the recipient user (exceptions:
113 /* secondary groups are not enabled; in case of delivery as root,
114 /* the command executes with the privileges of \fBdefault_privs\fR).
115 /*
116 /* Mailbox delivery can be delegated to alternative message transports
117 /* specified in the \fBmaster.cf\fR file.
118 /* The \fBmailbox_transport_maps\fR and \fBmailbox_transport\fR
119 /* configuration parameters specify an optional
120 /* message transport that is to be used for all local recipients,
121 /* regardless of whether they are found in the UNIX passwd database.
122 /* The \fBfallback_transport_maps\fR and
123 /* \fBfallback_transport\fR parameters specify an optional
124 /* message transport
125 /* for recipients that are not found in the aliases(5) or UNIX
126 /* passwd database.
127 /*
128 /* In the case of UNIX-style mailbox delivery,
129 /* the \fBlocal\fR(8) daemon prepends a "\fBFrom \fIsender time_stamp\fR"
130 /* envelope header to each message, prepends an
131 /* \fBX-Original-To:\fR header with the recipient address as given to
132 /* Postfix, prepends an
133 /* optional \fBDelivered-To:\fR header
134 /* with the final envelope recipient address, prepends a \fBReturn-Path:\fR
135 /* header with the envelope sender address, prepends a \fB>\fR character
136 /* to lines beginning with "\fBFrom \fR", and appends an empty line.
137 /* The mailbox is locked for exclusive access while delivery is in
138 /* progress. In case of problems, an attempt is made to truncate the
139 /* mailbox to its original length.
140 /*
141 /* In the case of \fBmaildir\fR delivery, the local daemon prepends
142 /* an optional
143 /* \fBDelivered-To:\fR header with the final envelope recipient address,
144 /* prepends an
145 /* \fBX-Original-To:\fR header with the recipient address as given to
146 /* Postfix,
147 /* and prepends a \fBReturn-Path:\fR header with the envelope sender
148 /* address.
149 /* EXTERNAL COMMAND DELIVERY
150 /* .ad
151 /* .fi
152 /* The \fBallow_mail_to_commands\fR configuration parameter restricts
153 /* delivery to external commands. The default setting (\fBalias,
154 /* forward\fR) forbids command destinations in \fB:include:\fR files.
155 /*
156 /* Optionally, the process working directory is changed to the path
157 /* specified with \fBcommand_execution_directory\fR (Postfix 2.2 and
158 /* later). Failure to change directory causes mail to be deferred.
159 /*
160 /* The \fBcommand_execution_directory\fR parameter value is subject
161 /* to interpolation of \fB$user\fR (recipient username),
162 /* \fB$home\fR (recipient home directory), \fB$shell\fR
163 /* (recipient shell), \fB$recipient\fR (complete recipient
164 /* address), \fB$extension\fR (recipient address extension),
165 /* \fB$domain\fR (recipient domain), \fB$local\fR (entire
166 /* recipient address localpart) and \fB$recipient_delimiter.\fR
167 /* The forms \fI${name?value}\fR and \fI${name:value}\fR expand
168 /* conditionally to \fIvalue\fR when \fI$name\fR is (is not)
169 /* defined. Characters that may have special meaning to the
170 /* shell or file system are replaced by underscores. The list
171 /* of acceptable characters is specified with the
172 /* \fBexecution_directory_expansion_filter\fR configuration
173 /* parameter.
174 /*
175 /* The command is executed directly where possible. Assistance by the
176 /* shell (\fB/bin/sh\fR on UNIX systems) is used only when the command
177 /* contains shell magic characters, or when the command invokes a shell
178 /* built-in command.
179 /*
180 /* A limited amount of command output (standard output and standard
181 /* error) is captured for inclusion with non-delivery status reports.
182 /* A command is forcibly terminated if it does not complete within
183 /* \fBcommand_time_limit\fR seconds. Command exit status codes are
184 /* expected to follow the conventions defined in <\fBsysexits.h\fR>.
185 /* Exit status 0 means normal successful completion.
186 /*
187 /* Postfix version 2.3 and later support RFC 3463-style enhanced
188 /* status codes. If a command terminates with a non-zero exit
189 /* status, and the command output begins with an enhanced
190 /* status code, this status code takes precedence over the
191 /* non-zero exit status.
192 /*
193 /* A limited amount of message context is exported via environment
194 /* variables. Characters that may have special meaning to the shell
195 /* are replaced by underscores. The list of acceptable characters
196 /* is specified with the \fBcommand_expansion_filter\fR configuration
197 /* parameter.
198 /* .IP \fBSHELL\fR
199 /* The recipient user's login shell.
200 /* .IP \fBHOME\fR
201 /* The recipient user's home directory.
202 /* .IP \fBUSER\fR
203 /* The bare recipient name.
204 /* .IP \fBEXTENSION\fR
205 /* The optional recipient address extension.
206 /* .IP \fBDOMAIN\fR
207 /* The recipient address domain part.
208 /* .IP \fBLOGNAME\fR
209 /* The bare recipient name.
210 /* .IP \fBLOCAL\fR
211 /* The entire recipient address localpart (text to the left of the
212 /* rightmost @ character).
213 /* .IP \fBORIGINAL_RECIPIENT\fR
214 /* The entire recipient address, before any address rewriting
215 /* or aliasing (Postfix 2.5 and later).
216 /* .IP \fBRECIPIENT\fR
217 /* The entire recipient address.
218 /* .IP \fBSENDER\fR
219 /* The entire sender address.
220 /* .PP
221 /* Additional remote client information is made available via
222 /* the following environment variables:
223 /* .IP \fBCLIENT_ADDRESS\fR
224 /* Remote client network address. Available as of Postfix 2.2.
225 /* .IP \fBCLIENT_HELO\fR
226 /* Remote client EHLO command parameter. Available as of Postfix 2.2.
227 /* .IP \fBCLIENT_HOSTNAME\fR
228 /* Remote client hostname. Available as of Postfix 2.2.
229 /* .IP \fBCLIENT_PROTOCOL\fR
230 /* Remote client protocol. Available as of Postfix 2.2.
231 /* .IP \fBSASL_METHOD\fR
232 /* SASL authentication method specified in the
233 /* remote client AUTH command. Available as of Postfix 2.2.
234 /* .IP \fBSASL_SENDER\fR
235 /* SASL sender address specified in the remote client MAIL
236 /* FROM command. Available as of Postfix 2.2.
237 /* .IP \fBSASL_USERNAME\fR
238 /* SASL username specified in the remote client AUTH command.
239 /* Available as of Postfix 2.2.
240 /* .PP
241 /* The \fBPATH\fR environment variable is always reset to a
242 /* system-dependent default path, and environment variables
243 /* whose names are blessed by the \fBexport_environment\fR
244 /* configuration parameter are exported unchanged.
245 /*
246 /* The current working directory is the mail queue directory.
247 /*
248 /* The \fBlocal\fR(8) daemon prepends a "\fBFrom \fIsender time_stamp\fR"
249 /* envelope header to each message, prepends an
250 /* \fBX-Original-To:\fR header with the recipient address as given to
251 /* Postfix, prepends an
252 /* optional \fBDelivered-To:\fR
253 /* header with the final recipient envelope address, prepends a
254 /* \fBReturn-Path:\fR header with the sender envelope address,
255 /* and appends no empty line.
256 /* EXTERNAL FILE DELIVERY
257 /* .ad
258 /* .fi
259 /* The delivery format depends on the destination filename syntax.
260 /* The default is to use UNIX-style mailbox format. Specify a name
261 /* ending in \fB/\fR for \fBqmail\fR-compatible \fBmaildir\fR delivery.
262 /*
263 /* The \fBallow_mail_to_files\fR configuration parameter restricts
264 /* delivery to external files. The default setting (\fBalias,
265 /* forward\fR) forbids file destinations in \fB:include:\fR files.
266 /*
267 /* In the case of UNIX-style mailbox delivery,
268 /* the \fBlocal\fR(8) daemon prepends a "\fBFrom \fIsender time_stamp\fR"
269 /* envelope header to each message, prepends an
270 /* \fBX-Original-To:\fR header with the recipient address as given to
271 /* Postfix, prepends an
272 /* optional \fBDelivered-To:\fR
273 /* header with the final recipient envelope address, prepends a \fB>\fR
274 /* character to lines beginning with "\fBFrom \fR", and appends an
275 /* empty line.
276 /* The envelope sender address is available in the \fBReturn-Path:\fR
277 /* header.
278 /* When the destination is a regular file, it is locked for exclusive
279 /* access while delivery is in progress. In case of problems, an attempt
280 /* is made to truncate a regular file to its original length.
281 /*
282 /* In the case of \fBmaildir\fR delivery, the local daemon prepends
283 /* an optional
284 /* \fBDelivered-To:\fR header with the final envelope recipient address,
285 /* and prepends an
286 /* \fBX-Original-To:\fR header with the recipient address as given to
287 /* Postfix.
288 /* The envelope sender address is available in the \fBReturn-Path:\fR
289 /* header.
290 /* ADDRESS EXTENSION
291 /* .ad
292 /* .fi
293 /* The optional \fBrecipient_delimiter\fR configuration parameter
294 /* specifies how to separate address extensions from local recipient
295 /* names.
296 /*
297 /* For example, with "\fBrecipient_delimiter = +\fR", mail for
298 /* \fIname\fR+\fIfoo\fR is delivered to the alias \fIname\fR+\fIfoo\fR
299 /* or to the alias \fIname\fR, to the destinations listed in
300 /* ~\fIname\fR/.\fBforward\fR+\fIfoo\fR or in ~\fIname\fR/.\fBforward\fR,
301 /* to the mailbox owned by the user \fIname\fR, or it is sent back as
302 /* undeliverable.
303 /* DELIVERY RIGHTS
304 /* .ad
305 /* .fi
306 /* Deliveries to external files and external commands are made with
307 /* the rights of the receiving user on whose behalf the delivery is made.
308 /* In the absence of a user context, the \fBlocal\fR(8) daemon uses the
309 /* owner rights of the \fB:include:\fR file or alias database.
310 /* When those files are owned by the superuser, delivery is made with
311 /* the rights specified with the \fBdefault_privs\fR configuration
312 /* parameter.
313 /* STANDARDS
314 /* RFC 822 (ARPA Internet Text Messages)
315 /* RFC 3463 (Enhanced status codes)
316 /* DIAGNOSTICS
317 /* Problems and transactions are logged to \fBsyslogd\fR(8).
318 /* Corrupted message files are marked so that the queue
319 /* manager can move them to the \fBcorrupt\fR queue afterwards.
320 /*
321 /* Depending on the setting of the \fBnotify_classes\fR parameter,
322 /* the postmaster is notified of bounces and of other trouble.
323 /* SECURITY
324 /* .ad
325 /* .fi
326 /* The \fBlocal\fR(8) delivery agent needs a dual personality
327 /* 1) to access the private Postfix queue and IPC mechanisms,
328 /* 2) to impersonate the recipient and deliver to recipient-specified
329 /* files or commands. It is therefore security sensitive.
330 /*
331 /* The \fBlocal\fR(8) delivery agent disallows regular expression
332 /* substitution of $1 etc. in \fBalias_maps\fR, because that
333 /* would open a security hole.
334 /*
335 /* The \fBlocal\fR(8) delivery agent will silently ignore
336 /* requests to use the \fBproxymap\fR(8) server within
337 /* \fBalias_maps\fR. Instead it will open the table directly.
338 /* Before Postfix version 2.2, the \fBlocal\fR(8) delivery
339 /* agent will terminate with a fatal error.
340 /* BUGS
341 /* For security reasons, the message delivery status of external commands
342 /* or of external files is never checkpointed to file. As a result,
343 /* the program may occasionally deliver more than once to a command or
344 /* external file. Better safe than sorry.
345 /*
346 /* Mutually-recursive aliases or ~/.\fBforward\fR files are not detected
347 /* early. The resulting mail forwarding loop is broken by the use of the
348 /* \fBDelivered-To:\fR message header.
349 /* CONFIGURATION PARAMETERS
350 /* .ad
351 /* .fi
352 /* Changes to \fBmain.cf\fR are picked up automatically, as \fBlocal\fR(8)
353 /* processes run for only a limited amount of time. Use the command
354 /* "\fBpostfix reload\fR" to speed up a change.
355 /*
356 /* The text below provides only a parameter summary. See
357 /* \fBpostconf\fR(5) for more details including examples.
358 /* COMPATIBILITY CONTROLS
359 /* .ad
360 /* .fi
361 /* .IP "\fBbiff (yes)\fR"
362 /* Whether or not to use the local biff service.
363 /* .IP "\fBexpand_owner_alias (no)\fR"
364 /* When delivering to an alias "\fIaliasname\fR" that has an
365 /* "owner-\fIaliasname\fR" companion alias, set the envelope sender
366 /* address to the expansion of the "owner-\fIaliasname\fR" alias.
367 /* .IP "\fBowner_request_special (yes)\fR"
368 /* Enable special treatment for owner-\fIlistname\fR entries in the
369 /* \fBaliases\fR(5) file, and don't split owner-\fIlistname\fR and
370 /* \fIlistname\fR-request address localparts when the recipient_delimiter
371 /* is set to "-".
372 /* .IP "\fBsun_mailtool_compatibility (no)\fR"
373 /* Obsolete SUN mailtool compatibility feature.
374 /* .PP
375 /* Available in Postfix version 2.3 and later:
376 /* .IP "\fBfrozen_delivered_to (yes)\fR"
377 /* Update the \fBlocal\fR(8) delivery agent's idea of the Delivered-To:
378 /* address (see prepend_delivered_header) only once, at the start of
379 /* a delivery attempt; do not update the Delivered-To: address while
380 /* expanding aliases or .forward files.
381 /* .PP
382 /* Available in Postfix version 2.5.3 and later:
383 /* .IP "\fBstrict_mailbox_ownership (yes)\fR"
384 /* Defer delivery when a mailbox file is not owned by its recipient.
385 /* .IP "\fBreset_owner_alias (no)\fR"
386 /* Reset the \fBlocal\fR(8) delivery agent's idea of the owner-alias
387 /* attribute, when delivering mail to a child alias that does not have
388 /* its own owner alias.
389 /* .PP
390 /* Available in Postfix version 3.0 and later:
391 /* .IP "\fBlocal_delivery_status_filter ($default_delivery_status_filter)\fR"
392 /* Optional filter for the \fBlocal\fR(8) delivery agent to change the
393 /* status code or explanatory text of successful or unsuccessful
394 /* deliveries.
395 /* DELIVERY METHOD CONTROLS
396 /* .ad
397 /* .fi
398 /* The precedence of \fBlocal\fR(8) delivery methods from high to low is:
399 /* aliases, .forward files, mailbox_transport_maps,
400 /* mailbox_transport, mailbox_command_maps, mailbox_command,
401 /* home_mailbox, mail_spool_directory, fallback_transport_maps,
402 /* fallback_transport, and luser_relay.
403 /* .IP "\fBalias_maps (see 'postconf -d' output)\fR"
404 /* The alias databases that are used for \fBlocal\fR(8) delivery.
405 /* .IP "\fBforward_path (see 'postconf -d' output)\fR"
406 /* The \fBlocal\fR(8) delivery agent search list for finding a .forward
407 /* file with user-specified delivery methods.
408 /* .IP "\fBmailbox_transport_maps (empty)\fR"
409 /* Optional lookup tables with per-recipient message delivery
410 /* transports to use for \fBlocal\fR(8) mailbox delivery, whether or not the
411 /* recipients are found in the UNIX passwd database.
412 /* .IP "\fBmailbox_transport (empty)\fR"
413 /* Optional message delivery transport that the \fBlocal\fR(8) delivery
414 /* agent should use for mailbox delivery to all local recipients,
415 /* whether or not they are found in the UNIX passwd database.
416 /* .IP "\fBmailbox_command_maps (empty)\fR"
417 /* Optional lookup tables with per-recipient external commands to use
418 /* for \fBlocal\fR(8) mailbox delivery.
419 /* .IP "\fBmailbox_command (empty)\fR"
420 /* Optional external command that the \fBlocal\fR(8) delivery agent should
421 /* use for mailbox delivery.
422 /* .IP "\fBhome_mailbox (empty)\fR"
423 /* Optional pathname of a mailbox file relative to a \fBlocal\fR(8) user's
424 /* home directory.
425 /* .IP "\fBmail_spool_directory (see 'postconf -d' output)\fR"
426 /* The directory where \fBlocal\fR(8) UNIX-style mailboxes are kept.
427 /* .IP "\fBfallback_transport_maps (empty)\fR"
428 /* Optional lookup tables with per-recipient message delivery
429 /* transports for recipients that the \fBlocal\fR(8) delivery agent could
430 /* not find in the \fBaliases\fR(5) or UNIX password database.
431 /* .IP "\fBfallback_transport (empty)\fR"
432 /* Optional message delivery transport that the \fBlocal\fR(8) delivery
433 /* agent should use for names that are not found in the \fBaliases\fR(5)
434 /* or UNIX password database.
435 /* .IP "\fBluser_relay (empty)\fR"
436 /* Optional catch-all destination for unknown \fBlocal\fR(8) recipients.
437 /* .PP
438 /* Available in Postfix version 2.2 and later:
439 /* .IP "\fBcommand_execution_directory (empty)\fR"
440 /* The \fBlocal\fR(8) delivery agent working directory for delivery to
441 /* external command.
442 /* MAILBOX LOCKING CONTROLS
443 /* .ad
444 /* .fi
445 /* .IP "\fBdeliver_lock_attempts (20)\fR"
446 /* The maximal number of attempts to acquire an exclusive lock on a
447 /* mailbox file or \fBbounce\fR(8) logfile.
448 /* .IP "\fBdeliver_lock_delay (1s)\fR"
449 /* The time between attempts to acquire an exclusive lock on a mailbox
450 /* file or \fBbounce\fR(8) logfile.
451 /* .IP "\fBstale_lock_time (500s)\fR"
452 /* The time after which a stale exclusive mailbox lockfile is removed.
453 /* .IP "\fBmailbox_delivery_lock (see 'postconf -d' output)\fR"
454 /* How to lock a UNIX-style \fBlocal\fR(8) mailbox before attempting delivery.
455 /* RESOURCE AND RATE CONTROLS
456 /* .ad
457 /* .fi
458 /* .IP "\fBcommand_time_limit (1000s)\fR"
459 /* Time limit for delivery to external commands.
460 /* .IP "\fBduplicate_filter_limit (1000)\fR"
461 /* The maximal number of addresses remembered by the address
462 /* duplicate filter for \fBaliases\fR(5) or \fBvirtual\fR(5) alias expansion, or
463 /* for \fBshowq\fR(8) queue displays.
464 /* .IP "\fBmailbox_size_limit (51200000)\fR"
465 /* The maximal size of any \fBlocal\fR(8) individual mailbox or maildir
466 /* file, or zero (no limit).
467 /* .PP
468 /* Implemented in the qmgr(8) daemon:
469 /* .IP "\fBlocal_destination_concurrency_limit (2)\fR"
470 /* The maximal number of parallel deliveries via the local mail
471 /* delivery transport to the same recipient (when
472 /* "local_destination_recipient_limit = 1") or the maximal number of
473 /* parallel deliveries to the same local domain (when
474 /* "local_destination_recipient_limit > 1").
475 /* .IP "\fBlocal_destination_recipient_limit (1)\fR"
476 /* The maximal number of recipients per message delivery via the
477 /* local mail delivery transport.
478 /* SECURITY CONTROLS
479 /* .ad
480 /* .fi
481 /* .IP "\fBallow_mail_to_commands (alias, forward)\fR"
482 /* Restrict \fBlocal\fR(8) mail delivery to external commands.
483 /* .IP "\fBallow_mail_to_files (alias, forward)\fR"
484 /* Restrict \fBlocal\fR(8) mail delivery to external files.
485 /* .IP "\fBcommand_expansion_filter (see 'postconf -d' output)\fR"
486 /* Restrict the characters that the \fBlocal\fR(8) delivery agent allows in
487 /* $name expansions of $mailbox_command and $command_execution_directory.
488 /* .IP "\fBdefault_privs (nobody)\fR"
489 /* The default rights used by the \fBlocal\fR(8) delivery agent for delivery
490 /* to external file or command.
491 /* .IP "\fBforward_expansion_filter (see 'postconf -d' output)\fR"
492 /* Restrict the characters that the \fBlocal\fR(8) delivery agent allows in
493 /* $name expansions of $forward_path.
494 /* .PP
495 /* Available in Postfix version 2.2 and later:
496 /* .IP "\fBexecution_directory_expansion_filter (see 'postconf -d' output)\fR"
497 /* Restrict the characters that the \fBlocal\fR(8) delivery agent allows
498 /* in $name expansions of $command_execution_directory.
499 /* .PP
500 /* Available in Postfix version 2.5.3 and later:
501 /* .IP "\fBstrict_mailbox_ownership (yes)\fR"
502 /* Defer delivery when a mailbox file is not owned by its recipient.
503 /* MISCELLANEOUS CONTROLS
504 /* .ad
505 /* .fi
506 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
507 /* The default location of the Postfix main.cf and master.cf
508 /* configuration files.
509 /* .IP "\fBdaemon_timeout (18000s)\fR"
510 /* How much time a Postfix daemon process may take to handle a
511 /* request before it is terminated by a built-in watchdog timer.
512 /* .IP "\fBdelay_logging_resolution_limit (2)\fR"
513 /* The maximal number of digits after the decimal point when logging
514 /* sub-second delay values.
515 /* .IP "\fBexport_environment (see 'postconf -d' output)\fR"
516 /* The list of environment variables that a Postfix process will export
517 /* to non-Postfix processes.
518 /* .IP "\fBipc_timeout (3600s)\fR"
519 /* The time limit for sending or receiving information over an internal
520 /* communication channel.
521 /* .IP "\fBlocal_command_shell (empty)\fR"
522 /* Optional shell program for \fBlocal\fR(8) delivery to non-Postfix command.
523 /* .IP "\fBmax_idle (100s)\fR"
524 /* The maximum amount of time that an idle Postfix daemon process waits
525 /* for an incoming connection before terminating voluntarily.
526 /* .IP "\fBmax_use (100)\fR"
527 /* The maximal number of incoming connections that a Postfix daemon
528 /* process will service before terminating voluntarily.
529 /* .IP "\fBprepend_delivered_header (command, file, forward)\fR"
530 /* The message delivery contexts where the Postfix \fBlocal\fR(8) delivery
531 /* agent prepends a Delivered-To: message header with the address
532 /* that the mail was delivered to.
533 /* .IP "\fBprocess_id (read-only)\fR"
534 /* The process ID of a Postfix command or daemon process.
535 /* .IP "\fBprocess_name (read-only)\fR"
536 /* The process name of a Postfix command or daemon process.
537 /* .IP "\fBpropagate_unmatched_extensions (canonical, virtual)\fR"
538 /* What address lookup tables copy an address extension from the lookup
539 /* key to the lookup result.
540 /* .IP "\fBqueue_directory (see 'postconf -d' output)\fR"
541 /* The location of the Postfix top-level queue directory.
542 /* .IP "\fBrecipient_delimiter (empty)\fR"
543 /* The set of characters that can separate a user name from its
544 /* extension (example: user+foo), or a .forward file name from its
545 /* extension (example: .forward+foo).
546 /* .IP "\fBrequire_home_directory (no)\fR"
547 /* Require that a \fBlocal\fR(8) recipient's home directory exists
548 /* before mail delivery is attempted.
549 /* .IP "\fBsyslog_facility (mail)\fR"
550 /* The syslog facility of Postfix logging.
551 /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR"
552 /* A prefix that is prepended to the process name in syslog
553 /* records, so that, for example, "smtpd" becomes "prefix/smtpd".
554 /* .PP
555 /* Available in Postfix version 3.3 and later:
556 /* .IP "\fBenable_original_recipient (yes)\fR"
557 /* Enable support for the original recipient address after an
558 /* address is rewritten to a different address (for example with
559 /* aliasing or with canonical mapping).
560 /* .IP "\fBservice_name (read-only)\fR"
561 /* The master.cf service name of a Postfix daemon process.
562 /* FILES
563 /* The following are examples; details differ between systems.
564 /* $HOME/.forward, per-user aliasing
565 /* /etc/aliases, system-wide alias database
566 /* /var/spool/mail, system mailboxes
567 /* SEE ALSO
568 /* qmgr(8), queue manager
569 /* bounce(8), delivery status reports
570 /* newaliases(1), create/update alias database
571 /* postalias(1), create/update alias database
572 /* aliases(5), format of alias database
573 /* postconf(5), configuration parameters
574 /* master(5), generic daemon options
575 /* syslogd(8), system logging
576 /* LICENSE
577 /* .ad
578 /* .fi
579 /* The Secure Mailer license must be distributed with this software.
580 /* HISTORY
581 /* .ad
582 /* .fi
583 /* The \fBDelivered-To:\fR message header appears in the \fBqmail\fR
584 /* system by Daniel Bernstein.
585 /*
586 /* The \fImaildir\fR structure appears in the \fBqmail\fR system
587 /* by Daniel Bernstein.
588 /* AUTHOR(S)
589 /* Wietse Venema
590 /* IBM T.J. Watson Research
591 /* P.O. Box 704
592 /* Yorktown Heights, NY 10598, USA
593 /*
594 /* Wietse Venema
595 /* Google, Inc.
596 /* 111 8th Avenue
597 /* New York, NY 10011, USA
598 /*--*/
599 
600 /* System library. */
601 
602 #include <sys_defs.h>
603 #include <unistd.h>
604 #include <stdlib.h>
605 #include <string.h>
606 #include <fcntl.h>
607 #ifdef USE_PATHS_H
608 #include <paths.h>
609 #endif
610 
611 /* Utility library. */
612 
613 #include <msg.h>
614 #include <mymalloc.h>
615 #include <htable.h>
616 #include <vstring.h>
617 #include <vstream.h>
618 #include <iostuff.h>
619 #include <name_mask.h>
620 #include <set_eugid.h>
621 #include <dict.h>
622 
623 /* Global library. */
624 
625 #include <recipient_list.h>
626 #include <deliver_request.h>
627 #include <deliver_completed.h>
628 #include <mail_params.h>
629 #include <mail_addr.h>
630 #include <mail_conf.h>
631 #include <been_here.h>
632 #include <mail_params.h>
633 #include <mail_version.h>
634 #include <ext_prop.h>
635 #include <maps.h>
636 #include <flush_clnt.h>
637 
638 /* Single server skeleton. */
639 
640 #include <mail_server.h>
641 
642 /* Application-specific. */
643 
644 #include "local.h"
645 
646  /*
647  * Tunable parameters.
648  */
653 int var_command_maxtime; /* You can now leave this here. */
681 
689 
690 /* local_deliver - deliver message with extreme prejudice */
691 
692 static int local_deliver(DELIVER_REQUEST *rqst, char *service)
693 {
694  const char *myname = "local_deliver";
695  RECIPIENT *rcpt_end = rqst->rcpt_list.info + rqst->rcpt_list.len;
696  RECIPIENT *rcpt;
697  int rcpt_stat;
698  int msg_stat;
699  LOCAL_STATE state;
700  USER_ATTR usr_attr;
701 
702  if (msg_verbose)
703  msg_info("local_deliver: %s from %s", rqst->queue_id, rqst->sender);
704 
705  /*
706  * Initialize the delivery attributes that are not recipient specific.
707  * While messages are being delivered and while aliases or forward files
708  * are being expanded, this attribute list is being changed constantly.
709  * For this reason, the list is passed on by value (except when it is
710  * being initialized :-), so that there is no need to undo attribute
711  * changes made by lower-level routines. The alias/include/forward
712  * expansion attribute list is part of a tree with self and parent
713  * references (see the EXPAND_ATTR definitions). The user-specific
714  * attributes are security sensitive, and are therefore kept separate.
715  * All this results in a noticeable level of clumsiness, but passing
716  * things around by value gives good protection against accidental change
717  * by subroutines.
718  */
719  state.level = 0;
720  deliver_attr_init(&state.msg_attr);
721  state.msg_attr.queue_name = rqst->queue_name;
722  state.msg_attr.queue_id = rqst->queue_id;
723  state.msg_attr.fp = rqst->fp;
724  state.msg_attr.offset = rqst->data_offset;
725  state.msg_attr.encoding = rqst->encoding;
726  state.msg_attr.smtputf8 = rqst->smtputf8;
727  state.msg_attr.sender = rqst->sender;
728  state.msg_attr.dsn_envid = rqst->dsn_envid;
729  state.msg_attr.dsn_ret = rqst->dsn_ret;
730  state.msg_attr.relay = service;
731  state.msg_attr.msg_stats = rqst->msg_stats;
732  state.msg_attr.request = rqst;
733  RESET_OWNER_ATTR(state.msg_attr, state.level);
734  RESET_USER_ATTR(usr_attr, state.level);
735  state.loop_info = delivered_hdr_init(rqst->fp, rqst->data_offset,
736  FOLD_ADDR_ALL);
737  state.request = rqst;
738 
739  /*
740  * Iterate over each recipient named in the delivery request. When the
741  * mail delivery status for a given recipient is definite (i.e. bounced
742  * or delivered), update the message queue file and cross off the
743  * recipient. Update the per-message delivery status.
744  */
745  for (msg_stat = 0, rcpt = rqst->rcpt_list.info; rcpt < rcpt_end; rcpt++) {
747  forward_init();
748  state.msg_attr.rcpt = *rcpt;
749  rcpt_stat = deliver_recipient(state, usr_attr);
750  rcpt_stat |= forward_finish(rqst, state.msg_attr, rcpt_stat);
751  if (rcpt_stat == 0 && (rqst->flags & DEL_REQ_FLAG_SUCCESS))
752  deliver_completed(state.msg_attr.fp, rcpt->offset);
753  been_here_free(state.dup_filter);
754  msg_stat |= rcpt_stat;
755  }
756 
757  /*
758  * Clean up.
759  */
761  deliver_attr_free(&state.msg_attr);
762 
763  return (msg_stat);
764 }
765 
766 /* local_service - perform service for client */
767 
768 static void local_service(VSTREAM *stream, char *service, char **argv)
769 {
770  DELIVER_REQUEST *request;
771  int status;
772 
773  /*
774  * Sanity check. This service takes no command-line arguments.
775  */
776  if (argv[0])
777  msg_fatal("unexpected command-line argument: %s", argv[0]);
778 
779  /*
780  * This routine runs whenever a client connects to the UNIX-domain socket
781  * that is dedicated to local mail delivery service. What we see below is
782  * a little protocol to (1) tell the client that we are ready, (2) read a
783  * delivery request from the client, and (3) report the completion status
784  * of that request.
785  */
786  if ((request = deliver_request_read(stream)) != 0) {
787  status = local_deliver(request, service);
788  deliver_request_done(stream, request, status);
789  }
790 }
791 
792 /* local_mask_init - initialize delivery restrictions */
793 
794 static void local_mask_init(void)
795 {
796  static const NAME_MASK file_mask[] = {
797  "alias", EXPAND_TYPE_ALIAS,
798  "forward", EXPAND_TYPE_FWD,
799  "include", EXPAND_TYPE_INCL,
800  0,
801  };
802  static const NAME_MASK command_mask[] = {
803  "alias", EXPAND_TYPE_ALIAS,
804  "forward", EXPAND_TYPE_FWD,
805  "include", EXPAND_TYPE_INCL,
806  0,
807  };
808  static const NAME_MASK deliver_mask[] = {
809  "command", DELIVER_HDR_CMD,
810  "file", DELIVER_HDR_FILE,
811  "forward", DELIVER_HDR_FWD,
812  0,
813  };
814 
824  if (var_mailtool_compat) {
825  msg_warn("%s: deprecated parameter, use \"%s = dotlock\" instead",
828  }
829  if (local_mbox_lock_mask == 0)
830  msg_fatal("parameter %s specifies no applicable mailbox locking method",
832 }
833 
834 /* pre_accept - see if tables have changed */
835 
836 static void pre_accept(char *unused_name, char **unused_argv)
837 {
838  const char *table;
839 
840  if ((table = dict_changed_name()) != 0) {
841  msg_info("table %s has changed -- restarting", table);
842  exit(0);
843  }
844 }
845 
846 /* post_init - post-jail initialization */
847 
848 static void post_init(char *unused_name, char **unused_argv)
849 {
850 
851  /*
852  * Drop privileges most of the time, and set up delivery restrictions.
853  */
855  local_mask_init();
856 }
857 
858 /* pre_init - pre-jail initialization */
859 
860 static void pre_init(char *unused_name, char **unused_argv)
861 {
862 
863  /*
864  * Reset the file size limit from the message size limit to the mailbox
865  * size limit. XXX This still isn't accurate because the file size limit
866  * also affects delivery to command.
867  *
868  * A file size limit protects the machine against runaway software errors.
869  * It is not suitable to enforce mail quota, because users can get around
870  * mail quota by delivering to /file/name or to |command.
871  *
872  * We can't have mailbox size limit smaller than the message size limit,
873  * because that prohibits the delivery agent from updating the queue
874  * file.
875  */
876  if (var_mailbox_limit) {
878  msg_fatal("main.cf configuration error: %s is smaller than %s",
881  }
882  alias_maps = maps_create("aliases", var_alias_maps,
886 
887  flush_init();
888 }
889 
891 
892 /* main - pass control to the single-threaded skeleton */
893 
894 int main(int argc, char **argv)
895 {
896  static const CONFIG_TIME_TABLE time_table[] = {
898  0,
899  };
900  static const CONFIG_INT_TABLE int_table[] = {
902  0,
903  };
904  static const CONFIG_LONG_TABLE long_table[] = {
906  0,
907  };
908  static const CONFIG_STR_TABLE str_table[] = {
924  VAR_MAILBOX_LOCK, DEF_MAILBOX_LOCK, &var_mailbox_lock, 1, 0,
927  0,
928  };
929  static const CONFIG_BOOL_TABLE bool_table[] = {
937  0,
938  };
939 
940  /* Suppress $name expansion upon loading. */
941  static const CONFIG_RAW_TABLE raw_table[] = {
946  0,
947  };
948 
949  /*
950  * Fingerprint executables and core dumps.
951  */
953 
954  single_server_main(argc, argv, local_service,
955  CA_MAIL_SERVER_INT_TABLE(int_table),
956  CA_MAIL_SERVER_LONG_TABLE(long_table),
957  CA_MAIL_SERVER_STR_TABLE(str_table),
958  CA_MAIL_SERVER_RAW_TABLE(raw_table),
959  CA_MAIL_SERVER_BOOL_TABLE(bool_table),
960  CA_MAIL_SERVER_TIME_TABLE(time_table),
961  CA_MAIL_SERVER_PRE_INIT(pre_init),
962  CA_MAIL_SERVER_POST_INIT(post_init),
963  CA_MAIL_SERVER_PRE_ACCEPT(pre_accept),
967  0);
968 }
int msg_verbose
Definition: msg.c:177
#define VAR_FORWARD_PATH
Definition: mail_params.h:606
#define DEF_HOME_MAILBOX
Definition: mail_params.h:576
#define BH_FLAG_FOLD
Definition: been_here.h:29
#define DELIVER_HDR_FILE
Definition: local.h:203
#define DEF_FROZEN_DELIVERED
Definition: mail_params.h:3161
int ext_prop_mask(const char *param_name, const char *pattern)
Definition: ext_prop.c:65
bool var_strict_mbox_owner
Definition: local.c:680
int var_stat_home_dir
Definition: local.c:674
#define CA_MAIL_SERVER_BOOL_TABLE(v)
Definition: mail_server.h:58
RECIPIENT_LIST rcpt_list
MAPS * alias_maps
Definition: local.c:687
#define DEF_ALLOW_COMMANDS
Definition: mail_params.h:542
char * var_allow_files
Definition: local.c:650
#define CA_MAIL_SERVER_RAW_TABLE(v)
Definition: mail_server.h:60
#define VAR_PROP_EXTENSION
Definition: mail_params.h:640
#define DEF_LUSER_RELAY
Definition: mail_params.h:563
void been_here_free(BH_TABLE *dup_filter)
Definition: been_here.c:116
#define DEF_MAILBOX_LIMIT
Definition: mail_params.h:634
#define RESET_OWNER_ATTR(msg_attr, level)
Definition: local.h:116
#define DELIVER_HDR_FWD
Definition: local.h:204
#define VAR_FROZEN_DELIVERED
Definition: mail_params.h:3160
#define CA_MAIL_SERVER_STR_TABLE(v)
Definition: mail_server.h:57
char * var_local_dsn_filter
Definition: local.c:688
#define DEL_REQ_FLAG_SUCCESS
#define VAR_DUP_FILTER_LIMIT
Definition: mail_params.h:686
int var_mailtool_compat
Definition: local.c:675
int local_mbox_lock_mask
Definition: local.c:686
int forward_init(void)
Definition: forward.c:106
#define VAR_MAILBOX_TRANSP
Definition: mail_params.h:587
void deliver_completed(VSTREAM *stream, long offset)
#define DEF_FBCK_TRANSP_MAPS
Definition: mail_params.h:600
char * var_allow_commands
Definition: local.c:649
#define VAR_MAILBOX_COMMAND
Definition: mail_params.h:579
#define VAR_DELIVER_HDR
Definition: mail_params.h:660
#define VAR_MAILBOX_CMD_MAPS
Definition: mail_params.h:583
#define VAR_RESET_OWNER_ATTR
Definition: mail_params.h:3164
int var_dup_filter_limit
Definition: local.c:652
Definition: maps.h:22
#define EXPAND_TYPE_ALIAS
Definition: local.h:99
void deliver_attr_free(DELIVER_ATTR *attrp)
Definition: deliver_attr.c:102
void set_file_limit(off_t limit)
Definition: file_limit.c:80
DELIVER_REQUEST * request
Definition: local.h:91
char * var_exec_exp_filter
Definition: local.c:667
int var_biff
Definition: local.c:660
#define VAR_LOCAL_CMD_SHELL
Definition: mail_params.h:554
#define DICT_FLAG_UTF8_REQUEST
Definition: dict.h:130
long var_mailbox_limit
Definition: local.c:677
#define DEF_DELIVER_HDR
Definition: mail_params.h:661
#define DEF_STAT_HOME_DIR
Definition: mail_params.h:679
char * var_fbck_transp_maps
Definition: local.c:665
char * var_fallback_transport
Definition: local.c:664
BH_TABLE * been_here_init(int limit, int flags)
Definition: been_here.c:103
#define VAR_MBOX_TRANSP_MAPS
Definition: mail_params.h:591
#define DEF_FALLBACK_TRANSP
Definition: mail_params.h:596
#define CA_MAIL_SERVER_BOUNCE_INIT(v, w)
Definition: mail_server.h:76
char * var_fwd_exp_filter
Definition: local.c:670
#define DEF_STRICT_MBOX_OWNER
Definition: mail_params.h:3540
#define DEF_EXEC_EXP_FILTER
Definition: mail_params.h:618
#define DICT_FLAG_FOLD_FIX
Definition: dict.h:124
void flush_init(void)
Definition: flush_clnt.c:104
DELIVER_REQUEST * request
Definition: local.h:113
char * var_forward_path
Definition: local.c:668
#define VAR_STAT_HOME_DIR
Definition: mail_params.h:678
char * queue_name
Definition: local.h:71
#define VAR_EXP_OWN_ALIAS
Definition: mail_params.h:674
bool var_frozen_delivered
Definition: local.c:678
#define VAR_ALLOW_FILES
Definition: mail_params.h:550
MSG_STATS msg_stats
int deliver_recipient(LOCAL_STATE, USER_ATTR)
Definition: recipient.c:206
char * var_alias_maps
Definition: local.c:651
#define EXPAND_TYPE_FWD
Definition: local.h:100
#define MBOX_DOT_LOCK
Definition: mbox_conf.h:24
#define DEF_RESET_OWNER_ATTR
Definition: mail_params.h:3165
long var_message_limit
Definition: mail_params.c:265
#define CA_MAIL_SERVER_POST_INIT(v)
Definition: mail_server.h:65
#define CA_MAIL_SERVER_INT_TABLE(v)
Definition: mail_server.h:56
#define VAR_MAILBOX_LIMIT
Definition: mail_params.h:633
#define DEF_CMD_EXP_FILTER
Definition: mail_params.h:649
char * encoding
Definition: local.h:74
char * var_mailbox_transport
Definition: local.c:662
#define VAR_STRICT_MBOX_OWNER
Definition: mail_params.h:3539
BH_TABLE * dup_filter
Definition: local.h:111
#define VAR_LOCAL_DSN_FILTER
Definition: mail_params.h:3994
int main(int argc, char **argv)
Definition: local.c:894
#define VAR_CMD_EXP_FILTER
Definition: mail_params.h:648
#define VAR_MESSAGE_LIMIT
Definition: mail_params.h:1926
int var_command_maxtime
Definition: local.c:653
gid_t var_owner_gid
Definition: mail_params.c:235
uid_t var_owner_uid
Definition: mail_params.c:234
char * var_deliver_hdr
Definition: local.c:673
#define DEF_MAILTOOL_COMPAT
Definition: mail_params.h:1996
#define DEF_ALIAS_MAPS
Definition: mail_params.h:527
MAPS * maps_create(const char *title, const char *map_names, int dict_flags)
Definition: maps.c:112
#define VAR_HOME_MAILBOX
Definition: mail_params.h:575
const char * dict_changed_name(void)
Definition: dict.c:583
#define VAR_MAILTOOL_COMPAT
Definition: mail_params.h:1995
#define DEF_MAILBOX_TRANSP
Definition: mail_params.h:588
char * var_mailbox_cmd_maps
Definition: local.c:656
#define DEF_MAILBOX_CMD_MAPS
Definition: mail_params.h:584
int dsn_ret
Definition: local.h:78
#define DEF_EXEC_DIRECTORY
Definition: mail_params.h:614
#define VAR_EXEC_EXP_FILTER
Definition: mail_params.h:617
DELIVERED_HDR_INFO * loop_info
Definition: local.h:112
#define DEF_COMMAND_MAXTIME
Definition: mail_params.h:547
#define DICT_FLAG_LOCK
Definition: dict.h:116
DELIVER_ATTR msg_attr
Definition: local.h:110
int local_cmd_deliver_mask
Definition: local.c:682
char * var_home_mailbox
Definition: local.c:654
int mbox_lock_mask(const char *string)
Definition: mbox_conf.c:83
#define DEF_FORWARD_PATH
Definition: mail_params.h:607
#define DICT_FLAG_PARANOID
Definition: dict.h:158
char * dsn_envid
Definition: local.h:77
void msg_warn(const char *fmt,...)
Definition: msg.c:215
#define VAR_FWD_EXP_FILTER
Definition: mail_params.h:654
#define VAR_ALLOW_COMMANDS
Definition: mail_params.h:541
#define DELIVER_HDR_CMD
Definition: local.h:202
#define VAR_COMMAND_MAXTIME
Definition: mail_params.h:545
#define name_mask(tag, table, str)
Definition: name_mask.h:49
#define MAIL_VERSION_STAMP_ALLOCATE
Definition: mail_version.h:67
#define VAR_LUSER_RELAY
Definition: mail_params.h:562
#define DEF_MBOX_TRANSP_MAPS
Definition: mail_params.h:592
char * var_mailbox_lock
Definition: local.c:676
#define CA_MAIL_SERVER_TIME_TABLE(v)
Definition: mail_server.h:59
char * var_luser_relay
Definition: local.c:659
#define VAR_ALIAS_MAPS
Definition: mail_params.h:523
DELIVERED_HDR_INFO * delivered_hdr_init(VSTREAM *fp, off_t offset, int flags)
NORETURN msg_fatal(const char *fmt,...)
Definition: msg.c:249
#define DEF_FWD_EXP_FILTER
Definition: mail_params.h:655
#define DEF_BIFF
Definition: mail_params.h:535
#define CA_MAIL_SERVER_PRIVILEGED
Definition: mail_server.h:72
void deliver_attr_init(DELIVER_ATTR *attrp)
Definition: deliver_attr.c:53
VSTREAM * fp
Definition: local.h:70
#define VAR_BIFF
Definition: mail_params.h:534
int forward_finish(DELIVER_REQUEST *request, DELIVER_ATTR attr, int cancel)
Definition: forward.c:348
void set_eugid(uid_t euid, gid_t egid)
Definition: set_eugid.c:54
int deliver_request_done(VSTREAM *stream, DELIVER_REQUEST *request, int status)
int smtputf8
Definition: local.h:75
#define FOLD_ADDR_ALL
Definition: fold_addr.h:20
#define VAR_EXEC_DIRECTORY
Definition: mail_params.h:613
int level
Definition: local.h:109
char * var_exec_directory
Definition: local.c:666
char * queue_id
Definition: local.h:72
#define DEF_PROP_EXTENSION
Definition: mail_params.h:641
bool var_reset_owner_attr
Definition: local.c:679
#define VAR_FBCK_TRANSP_MAPS
Definition: mail_params.h:599
char * var_cmd_exp_filter
Definition: local.c:669
char * relay
Definition: local.h:87
RECIPIENT * info
#define DEF_MAIL_SPOOL_DIR
Definition: mail_params.h:571
char * var_mbox_transp_maps
Definition: local.c:663
NORETURN single_server_main(int, char **, SINGLE_SERVER_FN,...)
#define VAR_MAILBOX_LOCK
Definition: mail_params.h:626
const char * sender
Definition: local.h:76
MSG_STATS msg_stats
Definition: local.h:88
#define VAR_FALLBACK_TRANSP
Definition: mail_params.h:595
#define RESET_USER_ATTR(usr_attr, level)
Definition: local.h:46
RECIPIENT rcpt
Definition: local.h:79
#define CA_MAIL_SERVER_LONG_TABLE(v)
Definition: mail_server.h:63
char * var_local_cmd_shell
Definition: local.c:658
int local_file_deliver_mask
Definition: local.c:683
#define CA_MAIL_SERVER_PRE_ACCEPT(v)
Definition: mail_server.h:68
int local_ext_prop_mask
Definition: local.c:684
long offset
Definition: local.h:73
#define DEF_MAILBOX_COMMAND
Definition: mail_params.h:580
DELIVER_REQUEST * deliver_request_read(VSTREAM *stream)
char * var_mailbox_command
Definition: local.c:655
#define VAR_MAIL_SPOOL_DIR
Definition: mail_params.h:569
int local_deliver_hdr_mask
Definition: local.c:685
char * var_rcpt_fdelim
Definition: local.c:657
#define DEF_DUP_FILTER_LIMIT
Definition: mail_params.h:687
#define DEF_LOCAL_CMD_SHELL
Definition: mail_params.h:555
#define DEF_EXP_OWN_ALIAS
Definition: mail_params.h:675
#define DEF_LOCAL_DSN_FILTER
Definition: mail_params.h:3995
void delivered_hdr_free(DELIVERED_HDR_INFO *info)
#define CA_MAIL_SERVER_PRE_INIT(v)
Definition: mail_server.h:64
char * var_mail_spool_dir
Definition: local.c:661
char * var_prop_extension
Definition: local.c:671
#define DEF_ALLOW_FILES
Definition: mail_params.h:551
void msg_info(const char *fmt,...)
Definition: msg.c:199
#define EXPAND_TYPE_INCL
Definition: local.h:101
int var_exp_own_alias
Definition: local.c:672
MAIL_VERSION_STAMP_DECLARE
Definition: local.c:890