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 /*	or \fBpostlogd\fR(8).
319 /*	Corrupted message files are marked so that the queue
320 /*	manager can move them to the \fBcorrupt\fR queue afterwards.
321 /*
322 /*	Depending on the setting of the \fBnotify_classes\fR parameter,
323 /*	the postmaster is notified of bounces and of other trouble.
324 /* SECURITY
325 /* .ad
326 /* .fi
327 /*	The \fBlocal\fR(8) delivery agent needs a dual personality
328 /*	1) to access the private Postfix queue and IPC mechanisms,
329 /*	2) to impersonate the recipient and deliver to recipient-specified
330 /*	files or commands. It is therefore security sensitive.
331 /*
332 /*	The \fBlocal\fR(8) delivery agent disallows regular expression
333 /*	substitution of $1 etc. in \fBalias_maps\fR, because that
334 /*	would open a security hole.
335 /*
336 /*	The \fBlocal\fR(8) delivery agent will silently ignore
337 /*	requests to use the \fBproxymap\fR(8) server within
338 /*	\fBalias_maps\fR. Instead it will open the table directly.
339 /*	Before Postfix version 2.2, the \fBlocal\fR(8) delivery
340 /*	agent will terminate with a fatal error.
341 /* BUGS
342 /*	For security reasons, the message delivery status of external commands
343 /*	or of external files is never checkpointed to file. As a result,
344 /*	the program may occasionally deliver more than once to a command or
345 /*	external file. Better safe than sorry.
346 /*
347 /*	Mutually-recursive aliases or ~/.\fBforward\fR files are not detected
348 /*	early.  The resulting mail forwarding loop is broken by the use of the
349 /*	\fBDelivered-To:\fR message header.
350 /* CONFIGURATION PARAMETERS
351 /* .ad
352 /* .fi
353 /*	Changes to \fBmain.cf\fR are picked up automatically, as \fBlocal\fR(8)
354 /*	processes run for only a limited amount of time. Use the command
355 /*	"\fBpostfix reload\fR" to speed up a change.
356 /*
357 /*	The text below provides only a parameter summary. See
358 /*	\fBpostconf\fR(5) for more details including examples.
359 /* COMPATIBILITY CONTROLS
360 /* .ad
361 /* .fi
362 /* .IP "\fBbiff (yes)\fR"
363 /*	Whether or not to use the local biff service.
364 /* .IP "\fBexpand_owner_alias (no)\fR"
365 /*	When delivering to an alias "\fIaliasname\fR" that has an
366 /*	"owner-\fIaliasname\fR" companion alias, set the envelope sender
367 /*	address to the expansion of the "owner-\fIaliasname\fR" alias.
368 /* .IP "\fBowner_request_special (yes)\fR"
369 /*	Enable special treatment for owner-\fIlistname\fR entries in the
370 /*	\fBaliases\fR(5) file, and don't split owner-\fIlistname\fR and
371 /*	\fIlistname\fR-request address localparts when the recipient_delimiter
372 /*	is set to "-".
373 /* .IP "\fBsun_mailtool_compatibility (no)\fR"
374 /*	Obsolete SUN mailtool compatibility feature.
375 /* .PP
376 /*	Available in Postfix version 2.3 and later:
377 /* .IP "\fBfrozen_delivered_to (yes)\fR"
378 /*	Update the \fBlocal\fR(8) delivery agent's idea of the Delivered-To:
379 /*	address (see prepend_delivered_header) only once, at the start of
380 /*	a delivery attempt; do not update the Delivered-To: address while
381 /*	expanding aliases or .forward files.
382 /* .PP
383 /*	Available in Postfix version 2.5.3 and later:
384 /* .IP "\fBstrict_mailbox_ownership (yes)\fR"
385 /*	Defer delivery when a mailbox file is not owned by its recipient.
386 /* .IP "\fBreset_owner_alias (no)\fR"
387 /*	Reset the \fBlocal\fR(8) delivery agent's idea of the owner-alias
388 /*	attribute, when delivering mail to a child alias that does not have
389 /*	its own owner alias.
390 /* .PP
391 /*	Available in Postfix version 3.0 and later:
392 /* .IP "\fBlocal_delivery_status_filter ($default_delivery_status_filter)\fR"
393 /*	Optional filter for the \fBlocal\fR(8) delivery agent to change the
394 /*	status code or explanatory text of successful or unsuccessful
395 /*	deliveries.
396 /* DELIVERY METHOD CONTROLS
397 /* .ad
398 /* .fi
399 /*	The precedence of \fBlocal\fR(8) delivery methods from high to low is:
400 /*	aliases, .forward files, mailbox_transport_maps,
401 /*	mailbox_transport, mailbox_command_maps, mailbox_command,
402 /*	home_mailbox, mail_spool_directory, fallback_transport_maps,
403 /*	fallback_transport, and luser_relay.
404 /* .IP "\fBalias_maps (see 'postconf -d' output)\fR"
405 /*	The alias databases that are used for \fBlocal\fR(8) delivery.
406 /* .IP "\fBforward_path (see 'postconf -d' output)\fR"
407 /*	The \fBlocal\fR(8) delivery agent search list for finding a .forward
408 /*	file with user-specified delivery methods.
409 /* .IP "\fBmailbox_transport_maps (empty)\fR"
410 /*	Optional lookup tables with per-recipient message delivery
411 /*	transports to use for \fBlocal\fR(8) mailbox delivery, whether or not the
412 /*	recipients are found in the UNIX passwd database.
413 /* .IP "\fBmailbox_transport (empty)\fR"
414 /*	Optional message delivery transport that the \fBlocal\fR(8) delivery
415 /*	agent should use for mailbox delivery to all local recipients,
416 /*	whether or not they are found in the UNIX passwd database.
417 /* .IP "\fBmailbox_command_maps (empty)\fR"
418 /*	Optional lookup tables with per-recipient external commands to use
419 /*	for \fBlocal\fR(8) mailbox delivery.
420 /* .IP "\fBmailbox_command (empty)\fR"
421 /*	Optional external command that the \fBlocal\fR(8) delivery agent should
422 /*	use for mailbox delivery.
423 /* .IP "\fBhome_mailbox (empty)\fR"
424 /*	Optional pathname of a mailbox file relative to a \fBlocal\fR(8) user's
425 /*	home directory.
426 /* .IP "\fBmail_spool_directory (see 'postconf -d' output)\fR"
427 /*	The directory where \fBlocal\fR(8) UNIX-style mailboxes are kept.
428 /* .IP "\fBfallback_transport_maps (empty)\fR"
429 /*	Optional lookup tables with per-recipient message delivery
430 /*	transports for recipients that the \fBlocal\fR(8) delivery agent could
431 /*	not find in the \fBaliases\fR(5) or UNIX password database.
432 /* .IP "\fBfallback_transport (empty)\fR"
433 /*	Optional message delivery transport that the \fBlocal\fR(8) delivery
434 /*	agent should use for names that are not found in the \fBaliases\fR(5)
435 /*	or UNIX password database.
436 /* .IP "\fBluser_relay (empty)\fR"
437 /*	Optional catch-all destination for unknown \fBlocal\fR(8) recipients.
438 /* .PP
439 /*	Available in Postfix version 2.2 and later:
440 /* .IP "\fBcommand_execution_directory (empty)\fR"
441 /*	The \fBlocal\fR(8) delivery agent working directory for delivery to
442 /*	external command.
443 /* MAILBOX LOCKING CONTROLS
444 /* .ad
445 /* .fi
446 /* .IP "\fBdeliver_lock_attempts (20)\fR"
447 /*	The maximal number of attempts to acquire an exclusive lock on a
448 /*	mailbox file or \fBbounce\fR(8) logfile.
449 /* .IP "\fBdeliver_lock_delay (1s)\fR"
450 /*	The time between attempts to acquire an exclusive lock on a mailbox
451 /*	file or \fBbounce\fR(8) logfile.
452 /* .IP "\fBstale_lock_time (500s)\fR"
453 /*	The time after which a stale exclusive mailbox lockfile is removed.
454 /* .IP "\fBmailbox_delivery_lock (see 'postconf -d' output)\fR"
455 /*	How to lock a UNIX-style \fBlocal\fR(8) mailbox before attempting delivery.
456 /* RESOURCE AND RATE CONTROLS
457 /* .ad
458 /* .fi
459 /* .IP "\fBcommand_time_limit (1000s)\fR"
460 /*	Time limit for delivery to external commands.
461 /* .IP "\fBduplicate_filter_limit (1000)\fR"
462 /*	The maximal number of addresses remembered by the address
463 /*	duplicate filter for \fBaliases\fR(5) or \fBvirtual\fR(5) alias expansion, or
464 /*	for \fBshowq\fR(8) queue displays.
465 /* .IP "\fBmailbox_size_limit (51200000)\fR"
466 /*	The maximal size of any \fBlocal\fR(8) individual mailbox or maildir
467 /*	file, or zero (no limit).
468 /* .PP
469 /*	Implemented in the qmgr(8) daemon:
470 /* .IP "\fBlocal_destination_concurrency_limit (2)\fR"
471 /*	The maximal number of parallel deliveries via the local mail
472 /*	delivery transport to the same recipient (when
473 /*	"local_destination_recipient_limit = 1") or the maximal number of
474 /*	parallel deliveries to the same local domain (when
475 /*	"local_destination_recipient_limit > 1").
476 /* .IP "\fBlocal_destination_recipient_limit (1)\fR"
477 /*	The maximal number of recipients per message delivery via the
478 /*	local mail delivery transport.
479 /* SECURITY CONTROLS
480 /* .ad
481 /* .fi
482 /* .IP "\fBallow_mail_to_commands (alias, forward)\fR"
483 /*	Restrict \fBlocal\fR(8) mail delivery to external commands.
484 /* .IP "\fBallow_mail_to_files (alias, forward)\fR"
485 /*	Restrict \fBlocal\fR(8) mail delivery to external files.
486 /* .IP "\fBcommand_expansion_filter (see 'postconf -d' output)\fR"
487 /*	Restrict the characters that the \fBlocal\fR(8) delivery agent allows in
488 /*	$name expansions of $mailbox_command and $command_execution_directory.
489 /* .IP "\fBdefault_privs (nobody)\fR"
490 /*	The default rights used by the \fBlocal\fR(8) delivery agent for delivery
491 /*	to external file or command.
492 /* .IP "\fBforward_expansion_filter (see 'postconf -d' output)\fR"
493 /*	Restrict the characters that the \fBlocal\fR(8) delivery agent allows in
494 /*	$name expansions of $forward_path.
495 /* .PP
496 /*	Available in Postfix version 2.2 and later:
497 /* .IP "\fBexecution_directory_expansion_filter (see 'postconf -d' output)\fR"
498 /*	Restrict the characters that the \fBlocal\fR(8) delivery agent allows
499 /*	in $name expansions of $command_execution_directory.
500 /* .PP
501 /*	Available in Postfix version 2.5.3 and later:
502 /* .IP "\fBstrict_mailbox_ownership (yes)\fR"
503 /*	Defer delivery when a mailbox file is not owned by its recipient.
504 /* MISCELLANEOUS CONTROLS
505 /* .ad
506 /* .fi
507 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
508 /*	The default location of the Postfix main.cf and master.cf
509 /*	configuration files.
510 /* .IP "\fBdaemon_timeout (18000s)\fR"
511 /*	How much time a Postfix daemon process may take to handle a
512 /*	request before it is terminated by a built-in watchdog timer.
513 /* .IP "\fBdelay_logging_resolution_limit (2)\fR"
514 /*	The maximal number of digits after the decimal point when logging
515 /*	sub-second delay values.
516 /* .IP "\fBexport_environment (see 'postconf -d' output)\fR"
517 /*	The list of environment variables that a Postfix process will export
518 /*	to non-Postfix processes.
519 /* .IP "\fBipc_timeout (3600s)\fR"
520 /*	The time limit for sending or receiving information over an internal
521 /*	communication channel.
522 /* .IP "\fBlocal_command_shell (empty)\fR"
523 /*	Optional shell program for \fBlocal\fR(8) delivery to non-Postfix command.
524 /* .IP "\fBmax_idle (100s)\fR"
525 /*	The maximum amount of time that an idle Postfix daemon process waits
526 /*	for an incoming connection before terminating voluntarily.
527 /* .IP "\fBmax_use (100)\fR"
528 /*	The maximal number of incoming connections that a Postfix daemon
529 /*	process will service before terminating voluntarily.
530 /* .IP "\fBprepend_delivered_header (command, file, forward)\fR"
531 /*	The message delivery contexts where the Postfix \fBlocal\fR(8) delivery
532 /*	agent prepends a Delivered-To:  message header with the address
533 /*	that the mail was delivered to.
534 /* .IP "\fBprocess_id (read-only)\fR"
535 /*	The process ID of a Postfix command or daemon process.
536 /* .IP "\fBprocess_name (read-only)\fR"
537 /*	The process name of a Postfix command or daemon process.
538 /* .IP "\fBpropagate_unmatched_extensions (canonical, virtual)\fR"
539 /*	What address lookup tables copy an address extension from the lookup
540 /*	key to the lookup result.
541 /* .IP "\fBqueue_directory (see 'postconf -d' output)\fR"
542 /*	The location of the Postfix top-level queue directory.
543 /* .IP "\fBrecipient_delimiter (empty)\fR"
544 /*	The set of characters that can separate a user name from its
545 /*	extension (example: user+foo), or a .forward file name from its
546 /*	extension (example: .forward+foo).
547 /* .IP "\fBrequire_home_directory (no)\fR"
548 /*	Require that a \fBlocal\fR(8) recipient's home directory exists
549 /*	before mail delivery is attempted.
550 /* .IP "\fBsyslog_facility (mail)\fR"
551 /*	The syslog facility of Postfix logging.
552 /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR"
553 /*	A prefix that is prepended to the process name in syslog
554 /*	records, so that, for example, "smtpd" becomes "prefix/smtpd".
555 /* .PP
556 /*	Available in Postfix version 3.3 and later:
557 /* .IP "\fBenable_original_recipient (yes)\fR"
558 /*	Enable support for the original recipient address after an
559 /*	address is rewritten to a different address (for example with
560 /*	aliasing or with canonical mapping).
561 /* .IP "\fBservice_name (read-only)\fR"
562 /*	The master.cf service name of a Postfix daemon process.
563 /* .PP
564 /*	Available in Postfix 3.5 and later:
565 /* .IP "\fBinfo_log_address_format (external)\fR"
566 /*	The email address form that will be used in non-debug logging
567 /*	(info, warning, etc.).
568 /* FILES
569 /*	The following are examples; details differ between systems.
570 /*	$HOME/.forward, per-user aliasing
571 /*	/etc/aliases, system-wide alias database
572 /*	/var/spool/mail, system mailboxes
573 /* SEE ALSO
574 /*	qmgr(8), queue manager
575 /*	bounce(8), delivery status reports
576 /*	newaliases(1), create/update alias database
577 /*	postalias(1), create/update alias database
578 /*	aliases(5), format of alias database
579 /*	postconf(5), configuration parameters
580 /*	master(5), generic daemon options
581 /*	postlogd(8), Postfix logging
582 /*	syslogd(8), system logging
583 /* LICENSE
584 /* .ad
585 /* .fi
586 /*	The Secure Mailer license must be distributed with this software.
587 /* HISTORY
588 /* .ad
589 /* .fi
590 /*	The \fBDelivered-To:\fR message header appears in the \fBqmail\fR
591 /*	system by Daniel Bernstein.
592 /*
593 /*	The \fImaildir\fR structure appears in the \fBqmail\fR system
594 /*	by Daniel Bernstein.
595 /* AUTHOR(S)
596 /*	Wietse Venema
597 /*	IBM T.J. Watson Research
598 /*	P.O. Box 704
599 /*	Yorktown Heights, NY 10598, USA
600 /*
601 /*	Wietse Venema
602 /*	Google, Inc.
603 /*	111 8th Avenue
604 /*	New York, NY 10011, USA
605 /*--*/
606 
607 /* System library. */
608 
609 #include <sys_defs.h>
610 #include <unistd.h>
611 #include <stdlib.h>
612 #include <string.h>
613 #include <fcntl.h>
614 #ifdef USE_PATHS_H
615 #include <paths.h>
616 #endif
617 
618 /* Utility library. */
619 
620 #include <msg.h>
621 #include <mymalloc.h>
622 #include <htable.h>
623 #include <vstring.h>
624 #include <vstream.h>
625 #include <iostuff.h>
626 #include <name_mask.h>
627 #include <set_eugid.h>
628 #include <dict.h>
629 
630 /* Global library. */
631 
632 #include <recipient_list.h>
633 #include <deliver_request.h>
634 #include <deliver_completed.h>
635 #include <mail_params.h>
636 #include <mail_addr.h>
637 #include <mail_conf.h>
638 #include <been_here.h>
639 #include <mail_params.h>
640 #include <mail_version.h>
641 #include <ext_prop.h>
642 #include <maps.h>
643 #include <flush_clnt.h>
644 
645 /* Single server skeleton. */
646 
647 #include <mail_server.h>
648 
649 /* Application-specific. */
650 
651 #include "local.h"
652 
653  /*
654   * Tunable parameters.
655   */
656 char   *var_allow_commands;
657 char   *var_allow_files;
658 char   *var_alias_maps;
659 int     var_dup_filter_limit;
660 int     var_command_maxtime;		/* You can now leave this here. */
661 char   *var_home_mailbox;
662 char   *var_mailbox_command;
663 char   *var_mailbox_cmd_maps;
664 char   *var_rcpt_fdelim;
665 char   *var_local_cmd_shell;
666 char   *var_luser_relay;
667 int     var_biff;
668 char   *var_mail_spool_dir;
669 char   *var_mailbox_transport;
670 char   *var_mbox_transp_maps;
671 char   *var_fallback_transport;
672 char   *var_fbck_transp_maps;
673 char   *var_exec_directory;
674 char   *var_exec_exp_filter;
675 char   *var_forward_path;
676 char   *var_cmd_exp_filter;
677 char   *var_fwd_exp_filter;
678 char   *var_prop_extension;
679 int     var_exp_own_alias;
680 char   *var_deliver_hdr;
681 int     var_stat_home_dir;
682 int     var_mailtool_compat;
683 char   *var_mailbox_lock;
684 long    var_mailbox_limit;
685 bool    var_frozen_delivered;
686 bool    var_reset_owner_attr;
687 bool    var_strict_mbox_owner;
688 
689 int     local_cmd_deliver_mask;
690 int     local_file_deliver_mask;
691 int     local_ext_prop_mask;
692 int     local_deliver_hdr_mask;
693 int     local_mbox_lock_mask;
694 MAPS   *alias_maps;
695 char   *var_local_dsn_filter;
696 
697 /* local_deliver - deliver message with extreme prejudice */
698 
local_deliver(DELIVER_REQUEST * rqst,char * service)699 static int local_deliver(DELIVER_REQUEST *rqst, char *service)
700 {
701     const char *myname = "local_deliver";
702     RECIPIENT *rcpt_end = rqst->rcpt_list.info + rqst->rcpt_list.len;
703     RECIPIENT *rcpt;
704     int     rcpt_stat;
705     int     msg_stat;
706     LOCAL_STATE state;
707     USER_ATTR usr_attr;
708 
709     if (msg_verbose)
710 	msg_info("local_deliver: %s from %s", rqst->queue_id, rqst->sender);
711 
712     /*
713      * Initialize the delivery attributes that are not recipient specific.
714      * While messages are being delivered and while aliases or forward files
715      * are being expanded, this attribute list is being changed constantly.
716      * For this reason, the list is passed on by value (except when it is
717      * being initialized :-), so that there is no need to undo attribute
718      * changes made by lower-level routines. The alias/include/forward
719      * expansion attribute list is part of a tree with self and parent
720      * references (see the EXPAND_ATTR definitions). The user-specific
721      * attributes are security sensitive, and are therefore kept separate.
722      * All this results in a noticeable level of clumsiness, but passing
723      * things around by value gives good protection against accidental change
724      * by subroutines.
725      */
726     state.level = 0;
727     deliver_attr_init(&state.msg_attr);
728     state.msg_attr.queue_name = rqst->queue_name;
729     state.msg_attr.queue_id = rqst->queue_id;
730     state.msg_attr.fp = rqst->fp;
731     state.msg_attr.offset = rqst->data_offset;
732     state.msg_attr.encoding = rqst->encoding;
733     state.msg_attr.smtputf8 = rqst->smtputf8;
734     state.msg_attr.sender = rqst->sender;
735     state.msg_attr.dsn_envid = rqst->dsn_envid;
736     state.msg_attr.dsn_ret = rqst->dsn_ret;
737     state.msg_attr.relay = service;
738     state.msg_attr.msg_stats = rqst->msg_stats;
739     state.msg_attr.request = rqst;
740     RESET_OWNER_ATTR(state.msg_attr, state.level);
741     RESET_USER_ATTR(usr_attr, state.level);
742     state.loop_info = delivered_hdr_init(rqst->fp, rqst->data_offset,
743 					 FOLD_ADDR_ALL);
744     state.request = rqst;
745 
746     /*
747      * Iterate over each recipient named in the delivery request. When the
748      * mail delivery status for a given recipient is definite (i.e. bounced
749      * or delivered), update the message queue file and cross off the
750      * recipient. Update the per-message delivery status.
751      */
752     for (msg_stat = 0, rcpt = rqst->rcpt_list.info; rcpt < rcpt_end; rcpt++) {
753 	state.dup_filter = been_here_init(var_dup_filter_limit, BH_FLAG_FOLD);
754 	forward_init();
755 	state.msg_attr.rcpt = *rcpt;
756 	rcpt_stat = deliver_recipient(state, usr_attr);
757 	rcpt_stat |= forward_finish(rqst, state.msg_attr, rcpt_stat);
758 	if (rcpt_stat == 0 && (rqst->flags & DEL_REQ_FLAG_SUCCESS))
759 	    deliver_completed(state.msg_attr.fp, rcpt->offset);
760 	been_here_free(state.dup_filter);
761 	msg_stat |= rcpt_stat;
762     }
763 
764     /*
765      * Clean up.
766      */
767     delivered_hdr_free(state.loop_info);
768     deliver_attr_free(&state.msg_attr);
769 
770     return (msg_stat);
771 }
772 
773 /* local_service - perform service for client */
774 
local_service(VSTREAM * stream,char * service,char ** argv)775 static void local_service(VSTREAM *stream, char *service, char **argv)
776 {
777     DELIVER_REQUEST *request;
778     int     status;
779 
780     /*
781      * Sanity check. This service takes no command-line arguments.
782      */
783     if (argv[0])
784 	msg_fatal("unexpected command-line argument: %s", argv[0]);
785 
786     /*
787      * This routine runs whenever a client connects to the UNIX-domain socket
788      * that is dedicated to local mail delivery service. What we see below is
789      * a little protocol to (1) tell the client that we are ready, (2) read a
790      * delivery request from the client, and (3) report the completion status
791      * of that request.
792      */
793     if ((request = deliver_request_read(stream)) != 0) {
794 	status = local_deliver(request, service);
795 	deliver_request_done(stream, request, status);
796     }
797 }
798 
799 /* local_mask_init - initialize delivery restrictions */
800 
local_mask_init(void)801 static void local_mask_init(void)
802 {
803     static const NAME_MASK file_mask[] = {
804 	"alias", EXPAND_TYPE_ALIAS,
805 	"forward", EXPAND_TYPE_FWD,
806 	"include", EXPAND_TYPE_INCL,
807 	0,
808     };
809     static const NAME_MASK command_mask[] = {
810 	"alias", EXPAND_TYPE_ALIAS,
811 	"forward", EXPAND_TYPE_FWD,
812 	"include", EXPAND_TYPE_INCL,
813 	0,
814     };
815     static const NAME_MASK deliver_mask[] = {
816 	"command", DELIVER_HDR_CMD,
817 	"file", DELIVER_HDR_FILE,
818 	"forward", DELIVER_HDR_FWD,
819 	0,
820     };
821 
822     local_file_deliver_mask = name_mask(VAR_ALLOW_FILES, file_mask,
823 					var_allow_files);
824     local_cmd_deliver_mask = name_mask(VAR_ALLOW_COMMANDS, command_mask,
825 				       var_allow_commands);
826     local_ext_prop_mask =
827 	ext_prop_mask(VAR_PROP_EXTENSION, var_prop_extension);
828     local_deliver_hdr_mask = name_mask(VAR_DELIVER_HDR, deliver_mask,
829 				       var_deliver_hdr);
830     local_mbox_lock_mask = mbox_lock_mask(var_mailbox_lock);
831     if (var_mailtool_compat) {
832 	msg_warn("%s: deprecated parameter, use \"%s = dotlock\" instead",
833 		 VAR_MAILTOOL_COMPAT, VAR_MAILBOX_LOCK);
834 	local_mbox_lock_mask &= MBOX_DOT_LOCK;
835     }
836     if (local_mbox_lock_mask == 0)
837 	msg_fatal("parameter %s specifies no applicable mailbox locking method",
838 		  VAR_MAILBOX_LOCK);
839 }
840 
841 /* pre_accept - see if tables have changed */
842 
pre_accept(char * unused_name,char ** unused_argv)843 static void pre_accept(char *unused_name, char **unused_argv)
844 {
845     const char *table;
846 
847     if ((table = dict_changed_name()) != 0) {
848 	msg_info("table %s has changed -- restarting", table);
849 	exit(0);
850     }
851 }
852 
853 /* post_init - post-jail initialization */
854 
post_init(char * unused_name,char ** unused_argv)855 static void post_init(char *unused_name, char **unused_argv)
856 {
857 
858     /*
859      * Drop privileges most of the time, and set up delivery restrictions.
860      */
861     set_eugid(var_owner_uid, var_owner_gid);
862     local_mask_init();
863 }
864 
865 /* pre_init - pre-jail initialization */
866 
pre_init(char * unused_name,char ** unused_argv)867 static void pre_init(char *unused_name, char **unused_argv)
868 {
869 
870     /*
871      * Reset the file size limit from the message size limit to the mailbox
872      * size limit. XXX This still isn't accurate because the file size limit
873      * also affects delivery to command.
874      *
875      * A file size limit protects the machine against runaway software errors.
876      * It is not suitable to enforce mail quota, because users can get around
877      * mail quota by delivering to /file/name or to |command.
878      *
879      * We can't have mailbox size limit smaller than the message size limit,
880      * because that prohibits the delivery agent from updating the queue
881      * file.
882      */
883     if (ENFORCING_SIZE_LIMIT(var_mailbox_limit)) {
884 	if (!ENFORCING_SIZE_LIMIT(var_message_limit))
885 	    msg_fatal("configuration error: %s is limited but %s is "
886 		      "unlimited", VAR_MAILBOX_LIMIT, VAR_MESSAGE_LIMIT);
887 	if (var_mailbox_limit < var_message_limit)
888 	    msg_fatal("configuration error: %s is smaller than %s",
889 		      VAR_MAILBOX_LIMIT, VAR_MESSAGE_LIMIT);
890 	set_file_limit(var_mailbox_limit);
891     }
892     alias_maps = maps_create("aliases", var_alias_maps,
893 			     DICT_FLAG_LOCK | DICT_FLAG_PARANOID
894 			     | DICT_FLAG_FOLD_FIX
895 			     | DICT_FLAG_UTF8_REQUEST);
896 
897     flush_init();
898 }
899 
900 MAIL_VERSION_STAMP_DECLARE;
901 
902 /* main - pass control to the single-threaded skeleton */
903 
main(int argc,char ** argv)904 int     main(int argc, char **argv)
905 {
906     static const CONFIG_TIME_TABLE time_table[] = {
907 	VAR_COMMAND_MAXTIME, DEF_COMMAND_MAXTIME, &var_command_maxtime, 1, 0,
908 	0,
909     };
910     static const CONFIG_INT_TABLE int_table[] = {
911 	VAR_DUP_FILTER_LIMIT, DEF_DUP_FILTER_LIMIT, &var_dup_filter_limit, 0, 0,
912 	0,
913     };
914     static const CONFIG_LONG_TABLE long_table[] = {
915 	VAR_MAILBOX_LIMIT, DEF_MAILBOX_LIMIT, &var_mailbox_limit, 0, 0,
916 	0,
917     };
918     static const CONFIG_STR_TABLE str_table[] = {
919 	VAR_ALIAS_MAPS, DEF_ALIAS_MAPS, &var_alias_maps, 0, 0,
920 	VAR_HOME_MAILBOX, DEF_HOME_MAILBOX, &var_home_mailbox, 0, 0,
921 	VAR_ALLOW_COMMANDS, DEF_ALLOW_COMMANDS, &var_allow_commands, 0, 0,
922 	VAR_ALLOW_FILES, DEF_ALLOW_FILES, &var_allow_files, 0, 0,
923 	VAR_LOCAL_CMD_SHELL, DEF_LOCAL_CMD_SHELL, &var_local_cmd_shell, 0, 0,
924 	VAR_MAIL_SPOOL_DIR, DEF_MAIL_SPOOL_DIR, &var_mail_spool_dir, 0, 0,
925 	VAR_MAILBOX_TRANSP, DEF_MAILBOX_TRANSP, &var_mailbox_transport, 0, 0,
926 	VAR_MBOX_TRANSP_MAPS, DEF_MBOX_TRANSP_MAPS, &var_mbox_transp_maps, 0, 0,
927 	VAR_FALLBACK_TRANSP, DEF_FALLBACK_TRANSP, &var_fallback_transport, 0, 0,
928 	VAR_FBCK_TRANSP_MAPS, DEF_FBCK_TRANSP_MAPS, &var_fbck_transp_maps, 0, 0,
929 	VAR_CMD_EXP_FILTER, DEF_CMD_EXP_FILTER, &var_cmd_exp_filter, 1, 0,
930 	VAR_FWD_EXP_FILTER, DEF_FWD_EXP_FILTER, &var_fwd_exp_filter, 1, 0,
931 	VAR_EXEC_EXP_FILTER, DEF_EXEC_EXP_FILTER, &var_exec_exp_filter, 1, 0,
932 	VAR_PROP_EXTENSION, DEF_PROP_EXTENSION, &var_prop_extension, 0, 0,
933 	VAR_DELIVER_HDR, DEF_DELIVER_HDR, &var_deliver_hdr, 0, 0,
934 	VAR_MAILBOX_LOCK, DEF_MAILBOX_LOCK, &var_mailbox_lock, 1, 0,
935 	VAR_MAILBOX_CMD_MAPS, DEF_MAILBOX_CMD_MAPS, &var_mailbox_cmd_maps, 0, 0,
936 	VAR_LOCAL_DSN_FILTER, DEF_LOCAL_DSN_FILTER, &var_local_dsn_filter, 0, 0,
937 	0,
938     };
939     static const CONFIG_BOOL_TABLE bool_table[] = {
940 	VAR_BIFF, DEF_BIFF, &var_biff,
941 	VAR_EXP_OWN_ALIAS, DEF_EXP_OWN_ALIAS, &var_exp_own_alias,
942 	VAR_STAT_HOME_DIR, DEF_STAT_HOME_DIR, &var_stat_home_dir,
943 	VAR_MAILTOOL_COMPAT, DEF_MAILTOOL_COMPAT, &var_mailtool_compat,
944 	VAR_FROZEN_DELIVERED, DEF_FROZEN_DELIVERED, &var_frozen_delivered,
945 	VAR_RESET_OWNER_ATTR, DEF_RESET_OWNER_ATTR, &var_reset_owner_attr,
946 	VAR_STRICT_MBOX_OWNER, DEF_STRICT_MBOX_OWNER, &var_strict_mbox_owner,
947 	0,
948     };
949 
950     /* Suppress $name expansion upon loading. */
951     static const CONFIG_RAW_TABLE raw_table[] = {
952 	VAR_EXEC_DIRECTORY, DEF_EXEC_DIRECTORY, &var_exec_directory, 0, 0,
953 	VAR_FORWARD_PATH, DEF_FORWARD_PATH, &var_forward_path, 0, 0,
954 	VAR_MAILBOX_COMMAND, DEF_MAILBOX_COMMAND, &var_mailbox_command, 0, 0,
955 	VAR_LUSER_RELAY, DEF_LUSER_RELAY, &var_luser_relay, 0, 0,
956 	0,
957     };
958 
959     /*
960      * Fingerprint executables and core dumps.
961      */
962     MAIL_VERSION_STAMP_ALLOCATE;
963 
964     single_server_main(argc, argv, local_service,
965 		       CA_MAIL_SERVER_INT_TABLE(int_table),
966 		       CA_MAIL_SERVER_LONG_TABLE(long_table),
967 		       CA_MAIL_SERVER_STR_TABLE(str_table),
968 		       CA_MAIL_SERVER_RAW_TABLE(raw_table),
969 		       CA_MAIL_SERVER_BOOL_TABLE(bool_table),
970 		       CA_MAIL_SERVER_TIME_TABLE(time_table),
971 		       CA_MAIL_SERVER_PRE_INIT(pre_init),
972 		       CA_MAIL_SERVER_POST_INIT(post_init),
973 		       CA_MAIL_SERVER_PRE_ACCEPT(pre_accept),
974 		       CA_MAIL_SERVER_PRIVILEGED,
975 		       CA_MAIL_SERVER_BOUNCE_INIT(VAR_LOCAL_DSN_FILTER,
976 						  &var_local_dsn_filter),
977 		       0);
978 }
979