1 /*++
2 /* NAME
3 /*	virtual 8
4 /* SUMMARY
5 /*	Postfix virtual domain mail delivery agent
6 /* SYNOPSIS
7 /*	\fBvirtual\fR [generic Postfix daemon options]
8 /* DESCRIPTION
9 /*	The \fBvirtual\fR(8) delivery agent is designed for virtual mail
10 /*	hosting services. Originally based on the Postfix \fBlocal\fR(8)
11 /*	delivery
12 /*	agent, this agent looks up recipients with map lookups of their
13 /*	full recipient address, instead of using hard-coded unix password
14 /*	file lookups of the address local part only.
15 /*
16 /*	This delivery agent only delivers mail.  Other features such as
17 /*	mail forwarding, out-of-office notifications, etc., must be
18 /*	configured via virtual_alias maps or via similar lookup mechanisms.
19 /* MAILBOX LOCATION
20 /* .ad
21 /* .fi
22 /*	The mailbox location is controlled by the \fBvirtual_mailbox_base\fR
23 /*	and \fBvirtual_mailbox_maps\fR configuration parameters (see below).
24 /*	The \fBvirtual_mailbox_maps\fR table is indexed by the recipient
25 /*	address as described under TABLE SEARCH ORDER below.
26 /*
27 /*	The mailbox pathname is constructed as follows:
28 /*
29 /* .nf
30 /*	  \fB$virtual_mailbox_base/$virtual_mailbox_maps(\fIrecipient\fB)\fR
31 /* .fi
32 /*
33 /*	where \fIrecipient\fR is the full recipient address.
34 /* UNIX MAILBOX FORMAT
35 /* .ad
36 /* .fi
37 /*	When the mailbox location does not end in \fB/\fR, the message
38 /*	is delivered in UNIX mailbox format.   This format stores multiple
39 /*	messages in one textfile.
40 /*
41 /*	The \fBvirtual\fR(8) delivery agent prepends a "\fBFrom \fIsender
42 /*	time_stamp\fR" envelope header to each message, prepends a
43 /*	\fBDelivered-To:\fR message header with the envelope recipient
44 /*	address,
45 /*	prepends an \fBX-Original-To:\fR header with the recipient address as
46 /*	given to Postfix,
47 /*	prepends a \fBReturn-Path:\fR message header with the
48 /*	envelope sender address, prepends a \fB>\fR character to lines
49 /*	beginning with "\fBFrom \fR", and appends an empty line.
50 /*
51 /*	The mailbox is locked for exclusive access while delivery is in
52 /*	progress. In case of problems, an attempt is made to truncate the
53 /*	mailbox to its original length.
54 /* QMAIL MAILDIR FORMAT
55 /* .ad
56 /* .fi
57 /*	When the mailbox location ends in \fB/\fR, the message is delivered
58 /*	in qmail \fBmaildir\fR format. This format stores one message per file.
59 /*
60 /*	The \fBvirtual\fR(8) delivery agent prepends a \fBDelivered-To:\fR
61 /*	message header with the final envelope recipient address,
62 /*	prepends an \fBX-Original-To:\fR header with the recipient address as
63 /*	given to Postfix, and prepends a
64 /*	\fBReturn-Path:\fR message header with the envelope sender address.
65 /*
66 /*	By definition, \fBmaildir\fR format does not require application-level
67 /*	file locking during mail delivery or retrieval.
68 /* MAILBOX OWNERSHIP
69 /* .ad
70 /* .fi
71 /*	Mailbox ownership is controlled by the \fBvirtual_uid_maps\fR
72 /*	and \fBvirtual_gid_maps\fR lookup tables, which are indexed
73 /*	with the full recipient address. Each table provides
74 /*	a string with the numerical user and group ID, respectively.
75 /*
76 /*	The \fBvirtual_minimum_uid\fR parameter imposes a lower bound on
77 /*	numerical user ID values that may be specified in any
78 /*	\fBvirtual_uid_maps\fR.
79 /* CASE FOLDING
80 /* .ad
81 /* .fi
82 /*	All delivery decisions are made using the full recipient
83 /*	address, folded to lower case. See also the next section
84 /*	for a few exceptions with optional address extensions.
85 /* TABLE SEARCH ORDER
86 /* .ad
87 /* .fi
88 /*	Normally, a lookup table is specified as a text file that
89 /*	serves as input to the \fBpostmap\fR(1) command. The result, an
90 /*	indexed file in \fBdbm\fR or \fBdb\fR format, is used for fast
91 /*	searching by the mail system.
92 /*
93 /*	The search order is as follows. The search stops
94 /*	upon the first successful lookup.
95 /* .IP \(bu
96 /*	When the recipient has an optional address extension the
97 /*	\fIuser+extension@domain.tld\fR address is looked up first.
98 /* .sp
99 /*	With Postfix versions before 2.1, the optional address extension
100 /*	is always ignored.
101 /* .IP \(bu
102 /*	The \fIuser@domain.tld\fR address, without address extension,
103 /*	is looked up next.
104 /* .IP \(bu
105 /*	Finally, the recipient \fI@domain\fR is looked up.
106 /* .PP
107 /*	When the table is provided via other means such as NIS, LDAP
108 /*	or SQL, the same lookups are done as for ordinary indexed files.
109 /*
110 /*	Alternatively, a table can be provided as a regular-expression
111 /*	map where patterns are given as regular expressions. In that case,
112 /*	only the full recipient address is given to the regular-expression
113 /*	map.
114 /* SECURITY
115 /* .ad
116 /* .fi
117 /*	The \fBvirtual\fR(8) delivery agent is not security sensitive, provided
118 /*	that the lookup tables with recipient user/group ID information are
119 /*	adequately protected. This program is not designed to run chrooted.
120 /*
121 /*	The \fBvirtual\fR(8) delivery agent disallows regular expression
122 /*	substitution of $1 etc. in regular expression lookup tables,
123 /*	because that would open a security hole.
124 /*
125 /*	The \fBvirtual\fR(8) delivery agent will silently ignore requests
126 /*	to use the \fBproxymap\fR(8) server. Instead it will open the
127 /*	table directly. Before Postfix version 2.2, the virtual
128 /*	delivery agent will terminate with a fatal error.
129 /* STANDARDS
130 /*	RFC 822 (ARPA Internet Text Messages)
131 /* DIAGNOSTICS
132 /*	Mail bounces when the recipient has no mailbox or when the
133 /*	recipient is over disk quota. In all other cases, mail for
134 /*	an existing recipient is deferred and a warning is logged.
135 /*
136 /*	Problems and transactions are logged to \fBsyslogd\fR(8)
137 /*	or \fBpostlogd\fR(8).
138 /*	Corrupted message files are marked so that the queue
139 /*	manager can move them to the \fBcorrupt\fR queue afterwards.
140 /*
141 /*	Depending on the setting of the \fBnotify_classes\fR parameter,
142 /*	the postmaster is notified of bounces and of other trouble.
143 /* BUGS
144 /*	This delivery agent supports address extensions in email
145 /*	addresses and in lookup table keys, but does not propagate
146 /*	address extension information to the result of table lookup.
147 /*
148 /*	Postfix should have lookup tables that can return multiple result
149 /*	attributes. In order to avoid the inconvenience of maintaining
150 /*	three tables, use an LDAP or MYSQL database.
151 /* CONFIGURATION PARAMETERS
152 /* .ad
153 /* .fi
154 /*	Changes to \fBmain.cf\fR are picked up automatically, as
155 /*	\fBvirtual\fR(8)
156 /*	processes run for only a limited amount of time. Use the command
157 /*	"\fBpostfix reload\fR" to speed up a change.
158 /*
159 /*	The text below provides only a parameter summary. See
160 /*	\fBpostconf\fR(5) for more details including examples.
161 /* MAILBOX DELIVERY CONTROLS
162 /* .ad
163 /* .fi
164 /* .IP "\fBvirtual_mailbox_base (empty)\fR"
165 /*	A prefix that the \fBvirtual\fR(8) delivery agent prepends to all pathname
166 /*	results from $virtual_mailbox_maps table lookups.
167 /* .IP "\fBvirtual_mailbox_maps (empty)\fR"
168 /*	Optional lookup tables with all valid addresses in the domains that
169 /*	match $virtual_mailbox_domains.
170 /* .IP "\fBvirtual_minimum_uid (100)\fR"
171 /*	The minimum user ID value that the \fBvirtual\fR(8) delivery agent accepts
172 /*	as a result from $virtual_uid_maps table lookup.
173 /* .IP "\fBvirtual_uid_maps (empty)\fR"
174 /*	Lookup tables with the per-recipient user ID that the \fBvirtual\fR(8)
175 /*	delivery agent uses while writing to the recipient's mailbox.
176 /* .IP "\fBvirtual_gid_maps (empty)\fR"
177 /*	Lookup tables with the per-recipient group ID for \fBvirtual\fR(8) mailbox
178 /*	delivery.
179 /* .PP
180 /*	Available in Postfix version 2.0 and later:
181 /* .IP "\fBvirtual_mailbox_domains ($virtual_mailbox_maps)\fR"
182 /*	Postfix is final destination for the specified list of domains;
183 /*	mail is delivered via the $virtual_transport mail delivery transport.
184 /* .IP "\fBvirtual_transport (virtual)\fR"
185 /*	The default mail delivery transport and next-hop destination for
186 /*	final delivery to domains listed with $virtual_mailbox_domains.
187 /* .PP
188 /*	Available in Postfix version 2.5.3 and later:
189 /* .IP "\fBstrict_mailbox_ownership (yes)\fR"
190 /*	Defer delivery when a mailbox file is not owned by its recipient.
191 /* LOCKING CONTROLS
192 /* .ad
193 /* .fi
194 /* .IP "\fBvirtual_mailbox_lock (see 'postconf -d' output)\fR"
195 /*	How to lock a UNIX-style \fBvirtual\fR(8) mailbox before attempting
196 /*	delivery.
197 /* .IP "\fBdeliver_lock_attempts (20)\fR"
198 /*	The maximal number of attempts to acquire an exclusive lock on a
199 /*	mailbox file or \fBbounce\fR(8) logfile.
200 /* .IP "\fBdeliver_lock_delay (1s)\fR"
201 /*	The time between attempts to acquire an exclusive lock on a mailbox
202 /*	file or \fBbounce\fR(8) logfile.
203 /* .IP "\fBstale_lock_time (500s)\fR"
204 /*	The time after which a stale exclusive mailbox lockfile is removed.
205 /* RESOURCE AND RATE CONTROLS
206 /* .ad
207 /* .fi
208 /* .IP "\fBvirtual_mailbox_limit (51200000)\fR"
209 /*	The maximal size in bytes of an individual \fBvirtual\fR(8) mailbox or
210 /*	maildir file, or zero (no limit).
211 /* .PP
212 /*	Implemented in the qmgr(8) daemon:
213 /* .IP "\fBvirtual_destination_concurrency_limit ($default_destination_concurrency_limit)\fR"
214 /*	The maximal number of parallel deliveries to the same destination
215 /*	via the virtual message delivery transport.
216 /* .IP "\fBvirtual_destination_recipient_limit ($default_destination_recipient_limit)\fR"
217 /*	The maximal number of recipients per message for the virtual
218 /*	message delivery transport.
219 /* MISCELLANEOUS CONTROLS
220 /* .ad
221 /* .fi
222 /* .IP "\fBconfig_directory (see 'postconf -d' output)\fR"
223 /*	The default location of the Postfix main.cf and master.cf
224 /*	configuration files.
225 /* .IP "\fBdaemon_timeout (18000s)\fR"
226 /*	How much time a Postfix daemon process may take to handle a
227 /*	request before it is terminated by a built-in watchdog timer.
228 /* .IP "\fBdelay_logging_resolution_limit (2)\fR"
229 /*	The maximal number of digits after the decimal point when logging
230 /*	sub-second delay values.
231 /* .IP "\fBipc_timeout (3600s)\fR"
232 /*	The time limit for sending or receiving information over an internal
233 /*	communication channel.
234 /* .IP "\fBmax_idle (100s)\fR"
235 /*	The maximum amount of time that an idle Postfix daemon process waits
236 /*	for an incoming connection before terminating voluntarily.
237 /* .IP "\fBmax_use (100)\fR"
238 /*	The maximal number of incoming connections that a Postfix daemon
239 /*	process will service before terminating voluntarily.
240 /* .IP "\fBprocess_id (read-only)\fR"
241 /*	The process ID of a Postfix command or daemon process.
242 /* .IP "\fBprocess_name (read-only)\fR"
243 /*	The process name of a Postfix command or daemon process.
244 /* .IP "\fBqueue_directory (see 'postconf -d' output)\fR"
245 /*	The location of the Postfix top-level queue directory.
246 /* .IP "\fBsyslog_facility (mail)\fR"
247 /*	The syslog facility of Postfix logging.
248 /* .IP "\fBsyslog_name (see 'postconf -d' output)\fR"
249 /*	A prefix that is prepended to the process name in syslog
250 /*	records, so that, for example, "smtpd" becomes "prefix/smtpd".
251 /* .PP
252 /*	Available in Postfix version 3.0 and later:
253 /* .IP "\fBvirtual_delivery_status_filter ($default_delivery_status_filter)\fR"
254 /*	Optional filter for the \fBvirtual\fR(8) delivery agent to change the
255 /*	delivery status code or explanatory text of successful or unsuccessful
256 /*	deliveries.
257 /* .PP
258 /*	Available in Postfix version 3.3 and later:
259 /* .IP "\fBenable_original_recipient (yes)\fR"
260 /*	Enable support for the original recipient address after an
261 /*	address is rewritten to a different address (for example with
262 /*	aliasing or with canonical mapping).
263 /* .IP "\fBservice_name (read-only)\fR"
264 /*	The master.cf service name of a Postfix daemon process.
265 /* .PP
266 /*	Available in Postfix 3.5 and later:
267 /* .IP "\fBinfo_log_address_format (external)\fR"
268 /*	The email address form that will be used in non-debug logging
269 /*	(info, warning, etc.).
270 /* SEE ALSO
271 /*	qmgr(8), queue manager
272 /*	bounce(8), delivery status reports
273 /*	postconf(5), configuration parameters
274 /*	postlogd(8), Postfix logging
275 /*	syslogd(8), system logging
276 /* README_FILES
277 /*	Use "\fBpostconf readme_directory\fR" or
278 /*	"\fBpostconf html_directory\fR" to locate this information.
279 /*	VIRTUAL_README, domain hosting howto
280 /* LICENSE
281 /* .ad
282 /* .fi
283 /*	The Secure Mailer license must be distributed with this software.
284 /* HISTORY
285 /* .ad
286 /* .fi
287 /*	This delivery agent was originally based on the Postfix local delivery
288 /*	agent. Modifications mainly consisted of removing code that either
289 /*	was not applicable or that was not safe in this context: aliases,
290 /*	~user/.forward files, delivery to "|command" or to /file/name.
291 /*
292 /*	The \fBDelivered-To:\fR message header appears in the \fBqmail\fR
293 /*	system by Daniel Bernstein.
294 /*
295 /*	The \fBmaildir\fR structure appears in the \fBqmail\fR system
296 /*	by Daniel Bernstein.
297 /* AUTHOR(S)
298 /*	Wietse Venema
299 /*	IBM T.J. Watson Research
300 /*	P.O. Box 704
301 /*	Yorktown Heights, NY 10598, USA
302 /*
303 /*	Wietse Venema
304 /*	Google, Inc.
305 /*	111 8th Avenue
306 /*	New York, NY 10011, USA
307 /*
308 /*	Andrew McNamara
309 /*	andrewm@connect.com.au
310 /*	connect.com.au Pty. Ltd.
311 /*	Level 3, 213 Miller St
312 /*	North Sydney 2060, NSW, Australia
313 /*--*/
314 
315 /* System library. */
316 
317 #include <sys_defs.h>
318 #include <stdlib.h>
319 #ifdef USE_PATHS_H
320 #include <paths.h>			/* XXX mail_spool_dir dependency */
321 #endif
322 
323 /* Utility library. */
324 
325 #include <msg.h>
326 #include <vstring.h>
327 #include <vstream.h>
328 #include <iostuff.h>
329 #include <set_eugid.h>
330 #include <dict.h>
331 
332 /* Global library. */
333 
334 #include <mail_queue.h>
335 #include <recipient_list.h>
336 #include <deliver_request.h>
337 #include <deliver_completed.h>
338 #include <mail_params.h>
339 #include <mail_version.h>
340 #include <mail_conf.h>
341 #include <mail_params.h>
342 #include <mail_addr_find.h>
343 #include <flush_clnt.h>
344 
345 /* Single server skeleton. */
346 
347 #include <mail_server.h>
348 
349 /* Application-specific. */
350 
351 #include "virtual.h"
352 
353  /*
354   * Tunable parameters.
355   */
356 char   *var_virt_mailbox_maps;
357 char   *var_virt_uid_maps;
358 char   *var_virt_gid_maps;
359 int     var_virt_minimum_uid;
360 char   *var_virt_mailbox_base;
361 char   *var_virt_mailbox_lock;
362 long    var_virt_mailbox_limit;
363 char   *var_mail_spool_dir;		/* XXX dependency fix */
364 bool    var_strict_mbox_owner;
365 char   *var_virt_dsn_filter;
366 
367  /*
368   * Mappings.
369   */
370 MAPS   *virtual_mailbox_maps;
371 MAPS   *virtual_uid_maps;
372 MAPS   *virtual_gid_maps;
373 
374  /*
375   * Bit masks.
376   */
377 int     virtual_mbox_lock_mask;
378 
379 /* local_deliver - deliver message with extreme prejudice */
380 
local_deliver(DELIVER_REQUEST * rqst,char * service)381 static int local_deliver(DELIVER_REQUEST *rqst, char *service)
382 {
383     const char *myname = "local_deliver";
384     RECIPIENT *rcpt_end = rqst->rcpt_list.info + rqst->rcpt_list.len;
385     RECIPIENT *rcpt;
386     int     rcpt_stat;
387     int     msg_stat;
388     LOCAL_STATE state;
389     USER_ATTR usr_attr;
390 
391     if (msg_verbose)
392 	msg_info("local_deliver: %s from %s", rqst->queue_id, rqst->sender);
393 
394     /*
395      * Initialize the delivery attributes that are not recipient specific.
396      */
397     state.level = 0;
398     deliver_attr_init(&state.msg_attr);
399     state.msg_attr.queue_name = rqst->queue_name;
400     state.msg_attr.queue_id = rqst->queue_id;
401     state.msg_attr.fp = rqst->fp;
402     state.msg_attr.offset = rqst->data_offset;
403     state.msg_attr.sender = rqst->sender;
404     state.msg_attr.dsn_envid = rqst->dsn_envid;
405     state.msg_attr.dsn_ret = rqst->dsn_ret;
406     state.msg_attr.relay = service;
407     state.msg_attr.msg_stats = rqst->msg_stats;
408     RESET_USER_ATTR(usr_attr, state.level);
409     state.request = rqst;
410 
411     /*
412      * Iterate over each recipient named in the delivery request. When the
413      * mail delivery status for a given recipient is definite (i.e. bounced
414      * or delivered), update the message queue file and cross off the
415      * recipient. Update the per-message delivery status.
416      */
417     for (msg_stat = 0, rcpt = rqst->rcpt_list.info; rcpt < rcpt_end; rcpt++) {
418 	state.msg_attr.rcpt = *rcpt;
419 	rcpt_stat = deliver_recipient(state, usr_attr);
420 	if (rcpt_stat == 0 && (rqst->flags & DEL_REQ_FLAG_SUCCESS))
421 	    deliver_completed(state.msg_attr.fp, rcpt->offset);
422 	msg_stat |= rcpt_stat;
423     }
424 
425     deliver_attr_free(&state.msg_attr);
426     return (msg_stat);
427 }
428 
429 /* local_service - perform service for client */
430 
local_service(VSTREAM * stream,char * service,char ** argv)431 static void local_service(VSTREAM *stream, char *service, char **argv)
432 {
433     DELIVER_REQUEST *request;
434     int     status;
435 
436     /*
437      * Sanity check. This service takes no command-line arguments.
438      */
439     if (argv[0])
440 	msg_fatal("unexpected command-line argument: %s", argv[0]);
441 
442     /*
443      * This routine runs whenever a client connects to the UNIX-domain socket
444      * that is dedicated to local mail delivery service. What we see below is
445      * a little protocol to (1) tell the client that we are ready, (2) read a
446      * delivery request from the client, and (3) report the completion status
447      * of that request.
448      */
449     if ((request = deliver_request_read(stream)) != 0) {
450 	status = local_deliver(request, service);
451 	deliver_request_done(stream, request, status);
452     }
453 }
454 
455 /* pre_accept - see if tables have changed */
456 
pre_accept(char * unused_name,char ** unused_argv)457 static void pre_accept(char *unused_name, char **unused_argv)
458 {
459     const char *table;
460 
461     if ((table = dict_changed_name()) != 0) {
462 	msg_info("table %s has changed -- restarting", table);
463 	exit(0);
464     }
465 }
466 
467 /* post_init - post-jail initialization */
468 
post_init(char * unused_name,char ** unused_argv)469 static void post_init(char *unused_name, char **unused_argv)
470 {
471 
472     /*
473      * Drop privileges most of the time.
474      */
475     set_eugid(var_owner_uid, var_owner_gid);
476 
477     /*
478      * No case folding needed: the recipient address is case folded.
479      */
480     virtual_mailbox_maps =
481 	maps_create(VAR_VIRT_MAILBOX_MAPS, var_virt_mailbox_maps,
482 		    DICT_FLAG_LOCK | DICT_FLAG_PARANOID
483 		    | DICT_FLAG_UTF8_REQUEST);
484 
485     virtual_uid_maps =
486 	maps_create(VAR_VIRT_UID_MAPS, var_virt_uid_maps,
487 		    DICT_FLAG_LOCK | DICT_FLAG_PARANOID
488 		    | DICT_FLAG_UTF8_REQUEST);
489 
490     virtual_gid_maps =
491 	maps_create(VAR_VIRT_GID_MAPS, var_virt_gid_maps,
492 		    DICT_FLAG_LOCK | DICT_FLAG_PARANOID
493 		    | DICT_FLAG_UTF8_REQUEST);
494 
495     virtual_mbox_lock_mask = mbox_lock_mask(var_virt_mailbox_lock);
496 }
497 
498 /* pre_init - pre-jail initialization */
499 
pre_init(char * unused_name,char ** unused_argv)500 static void pre_init(char *unused_name, char **unused_argv)
501 {
502 
503     /*
504      * Reset the file size limit from the message size limit to the mailbox
505      * size limit.
506      *
507      * We can't have mailbox size limit smaller than the message size limit,
508      * because that prohibits the delivery agent from updating the queue
509      * file.
510      */
511     if (ENFORCING_SIZE_LIMIT(var_virt_mailbox_limit)) {
512 	if (!ENFORCING_SIZE_LIMIT(var_message_limit))
513 	    msg_fatal("configuration error: %s is limited but %s is "
514 		    "unlimited", VAR_VIRT_MAILBOX_LIMIT, VAR_MESSAGE_LIMIT);
515 	if (var_virt_mailbox_limit < var_message_limit)
516 	    msg_fatal("configuration error: %s is smaller than %s",
517 		      VAR_VIRT_MAILBOX_LIMIT, VAR_MESSAGE_LIMIT);
518 	set_file_limit(var_virt_mailbox_limit);
519     }
520 
521     /*
522      * flush client.
523      */
524     flush_init();
525 }
526 
527 MAIL_VERSION_STAMP_DECLARE;
528 
529 /* main - pass control to the single-threaded skeleton */
530 
main(int argc,char ** argv)531 int     main(int argc, char **argv)
532 {
533     static const CONFIG_INT_TABLE int_table[] = {
534 	VAR_VIRT_MINUID, DEF_VIRT_MINUID, &var_virt_minimum_uid, 1, 0,
535 	0,
536     };
537     static const CONFIG_LONG_TABLE long_table[] = {
538 	VAR_VIRT_MAILBOX_LIMIT, DEF_VIRT_MAILBOX_LIMIT, &var_virt_mailbox_limit, 0, 0,
539 	0,
540     };
541     static const CONFIG_STR_TABLE str_table[] = {
542 	VAR_MAIL_SPOOL_DIR, DEF_MAIL_SPOOL_DIR, &var_mail_spool_dir, 0, 0,
543 	VAR_VIRT_MAILBOX_MAPS, DEF_VIRT_MAILBOX_MAPS, &var_virt_mailbox_maps, 0, 0,
544 	VAR_VIRT_UID_MAPS, DEF_VIRT_UID_MAPS, &var_virt_uid_maps, 0, 0,
545 	VAR_VIRT_GID_MAPS, DEF_VIRT_GID_MAPS, &var_virt_gid_maps, 0, 0,
546 	VAR_VIRT_MAILBOX_BASE, DEF_VIRT_MAILBOX_BASE, &var_virt_mailbox_base, 1, 0,
547 	VAR_VIRT_MAILBOX_LOCK, DEF_VIRT_MAILBOX_LOCK, &var_virt_mailbox_lock, 1, 0,
548 	VAR_VIRT_DSN_FILTER, DEF_VIRT_DSN_FILTER, &var_virt_dsn_filter, 0, 0,
549 	0,
550     };
551     static const CONFIG_BOOL_TABLE bool_table[] = {
552 	VAR_STRICT_MBOX_OWNER, DEF_STRICT_MBOX_OWNER, &var_strict_mbox_owner,
553 	0,
554     };
555 
556     /*
557      * Fingerprint executables and core dumps.
558      */
559     MAIL_VERSION_STAMP_ALLOCATE;
560 
561     single_server_main(argc, argv, local_service,
562 		       CA_MAIL_SERVER_INT_TABLE(int_table),
563 		       CA_MAIL_SERVER_LONG_TABLE(long_table),
564 		       CA_MAIL_SERVER_STR_TABLE(str_table),
565 		       CA_MAIL_SERVER_BOOL_TABLE(bool_table),
566 		       CA_MAIL_SERVER_PRE_INIT(pre_init),
567 		       CA_MAIL_SERVER_POST_INIT(post_init),
568 		       CA_MAIL_SERVER_PRE_ACCEPT(pre_accept),
569 		       CA_MAIL_SERVER_PRIVILEGED,
570 		       CA_MAIL_SERVER_BOUNCE_INIT(VAR_VIRT_DSN_FILTER,
571 						  &var_virt_dsn_filter),
572 		       0);
573 }
574