annotate src/lmtp/main.c @ 22656:1789bf2a1e01

director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0 The reset command would just hang in that case. doveadm would never have sent this, so this is just an extra sanity check.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 05 Nov 2017 23:51:56 +0200
parents f166a414426f
children cb108f786fb4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21390
2e2563132d5f Updated copyright notices to include the year 2017.
Stephan Bosch <stephan.bosch@dovecot.fi>
parents: 21389
diff changeset
1 /* Copyright (c) 2002-2017 Dovecot authors, see the included COPYING file */
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3 #include "lib.h"
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include "array.h"
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 #include "ioloop.h"
10257
597f969a9870 lmtp: Improved logging.
Timo Sirainen <tss@iki.fi>
parents: 10134
diff changeset
6 #include "hostpid.h"
10825
cc3f6adc1e0b lmtp proxy: Added support for DNS lookups.
Timo Sirainen <tss@iki.fi>
parents: 10582
diff changeset
7 #include "abspath.h"
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 #include "restrict-access.h"
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 #include "fd-close-on-exec.h"
18297
0e657cfb3f98 lmtp: Added lmtp_user_concurrency_limit setting.
Timo Sirainen <tss@iki.fi>
parents: 18137
diff changeset
10 #include "anvil-client.h"
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 #include "master-service.h"
10039
ddcc3391adf9 lmtp: Added lmtp_proxy setting (it's no longer hardcoded to yes).
Timo Sirainen <tss@iki.fi>
parents: 9832
diff changeset
12 #include "master-service-settings.h"
9350
7df8fddbc7a5 Fixed LMTP server to actualy work.
Timo Sirainen <tss@iki.fi>
parents: 9348
diff changeset
13 #include "master-interface.h"
21551
8351a4c497cc lib-lda: Fix deliver_log_format variables with Sieve
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21390
diff changeset
14 #include "mail-deliver.h"
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 #include "mail-storage-service.h"
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 #include "lda-settings.h"
10039
ddcc3391adf9 lmtp: Added lmtp_proxy setting (it's no longer hardcoded to yes).
Timo Sirainen <tss@iki.fi>
parents: 9832
diff changeset
17 #include "lmtp-settings.h"
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 #include "client.h"
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 #include "main.h"
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 #include <unistd.h>
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22
10825
cc3f6adc1e0b lmtp proxy: Added support for DNS lookups.
Timo Sirainen <tss@iki.fi>
parents: 10582
diff changeset
23 #define DNS_CLIENT_SOCKET_PATH "dns-client"
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24 #define LMTP_MASTER_FIRST_LISTEN_FD 3
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26 #define IS_STANDALONE() \
12425
10c163bb5e22 "Running standalone?" check now uses a new DOVECOT_CHILD_PROCESS environment rather than GENERATION.
Timo Sirainen <tss@iki.fi>
parents: 12091
diff changeset
27 (getenv(MASTER_IS_PARENT_ENV) == NULL)
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28
13977
d5ba2d63ed6d lmtp: Make core dumping work also after the first mail delivery.
Timo Sirainen <tss@iki.fi>
parents: 12782
diff changeset
29 const char *dns_client_socket_path, *base_dir;
10130
d1384c2b08e5 Merged single and multi mail_storage_service_*() functions.
Timo Sirainen <tss@iki.fi>
parents: 10127
diff changeset
30 struct mail_storage_service_ctx *storage_service;
18297
0e657cfb3f98 lmtp: Added lmtp_user_concurrency_limit setting.
Timo Sirainen <tss@iki.fi>
parents: 18137
diff changeset
31 struct anvil_client *anvil;
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32
11388
b8d3c96e61a7 lib-master API changed to avoid accidentally leaking client connections.
Timo Sirainen <tss@iki.fi>
parents: 11282
diff changeset
33 static void client_connected(struct master_service_connection *conn)
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
34 {
11388
b8d3c96e61a7 lib-master API changed to avoid accidentally leaking client connections.
Timo Sirainen <tss@iki.fi>
parents: 11282
diff changeset
35 master_service_client_connection_accept(conn);
10134
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
36 (void)client_create(conn->fd, conn->fd, conn);
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 }
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38
11282
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
39 static void drop_privileges(void)
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
40 {
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
41 struct restrict_access_settings set;
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
42 const char *error;
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
43
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
44 /* by default we don't drop any privileges, but keep running as root. */
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
45 restrict_access_get_env(&set);
20704
70a4f52e32b3 lmtp: Always read settings before dropping privs
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 19601
diff changeset
46 /* open config connection before dropping privileges */
70a4f52e32b3 lmtp: Always read settings before dropping privs
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 19601
diff changeset
47 struct master_service_settings_input input;
70a4f52e32b3 lmtp: Always read settings before dropping privs
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 19601
diff changeset
48 struct master_service_settings_output output;
12091
7fef89fea00e lmtp: Read initial settings with service=lmtp
Timo Sirainen <tss@iki.fi>
parents: 11388
diff changeset
49
21389
59437f8764c6 global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Stephan Bosch <stephan.bosch@dovecot.fi>
parents: 20704
diff changeset
50 i_zero(&input);
20704
70a4f52e32b3 lmtp: Always read settings before dropping privs
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 19601
diff changeset
51 input.module = "lmtp";
70a4f52e32b3 lmtp: Always read settings before dropping privs
Aki Tuomi <aki.tuomi@dovecot.fi>
parents: 19601
diff changeset
52 input.service = "lmtp";
21872
f166a414426f lmtp: Die at startup if config reading fails.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21816
diff changeset
53 if (master_service_settings_read(master_service,
f166a414426f lmtp: Die at startup if config reading fails.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21816
diff changeset
54 &input, &output, &error) < 0)
f166a414426f lmtp: Die at startup if config reading fails.
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21816
diff changeset
55 i_fatal("Error reading configuration: %s", error);
11282
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
56 restrict_access_by_env(NULL, FALSE);
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
57 }
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
58
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
59 static void main_init(void)
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
60 {
10134
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
61 struct master_service_connection conn;
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
62
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
63 if (IS_STANDALONE()) {
21389
59437f8764c6 global: Replaced all instances of memset(p, 0, sizeof(*p)) with the new i_zero() macro.
Stephan Bosch <stephan.bosch@dovecot.fi>
parents: 20704
diff changeset
64 i_zero(&conn);
10134
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
65 (void)client_create(STDIN_FILENO, STDOUT_FILENO, &conn);
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
66 }
10825
cc3f6adc1e0b lmtp proxy: Added support for DNS lookups.
Timo Sirainen <tss@iki.fi>
parents: 10582
diff changeset
67 dns_client_socket_path = t_abspath(DNS_CLIENT_SOCKET_PATH);
21551
8351a4c497cc lib-lda: Fix deliver_log_format variables with Sieve
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21390
diff changeset
68 mail_deliver_hooks_init();
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
69 }
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
70
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
71 static void main_deinit(void)
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
72 {
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
73 clients_destroy();
18297
0e657cfb3f98 lmtp: Added lmtp_user_concurrency_limit setting.
Timo Sirainen <tss@iki.fi>
parents: 18137
diff changeset
74 if (anvil != NULL)
0e657cfb3f98 lmtp: Added lmtp_user_concurrency_limit setting.
Timo Sirainen <tss@iki.fi>
parents: 18137
diff changeset
75 anvil_client_deinit(&anvil);
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
76 }
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
77
10120
b584904d3bc7 Moved process title init to lib-master. With Linux-hack enabled it now preserves command args.
Timo Sirainen <tss@iki.fi>
parents: 10119
diff changeset
78 int main(int argc, char *argv[])
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
79 {
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80 const struct setting_parser_info *set_roots[] = {
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
81 &lda_setting_parser_info,
10039
ddcc3391adf9 lmtp: Added lmtp_proxy setting (it's no longer hardcoded to yes).
Timo Sirainen <tss@iki.fi>
parents: 9832
diff changeset
82 &lmtp_setting_parser_info,
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
83 NULL
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
84 };
18041
297192cfbd37 lmtp: Added support for STARTTLS command.
Timo Sirainen <tss@iki.fi>
parents: 17130
diff changeset
85 enum master_service_flags service_flags =
297192cfbd37 lmtp: Added support for STARTTLS command.
Timo Sirainen <tss@iki.fi>
parents: 17130
diff changeset
86 MASTER_SERVICE_FLAG_USE_SSL_SETTINGS;
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
87 enum mail_storage_service_flags storage_service_flags =
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
88 MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT |
10134
545bdb7670d2 lib-storage: Changed APIs to fix reading settings for multiple users.
Timo Sirainen <tss@iki.fi>
parents: 10130
diff changeset
89 MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP |
10257
597f969a9870 lmtp: Improved logging.
Timo Sirainen <tss@iki.fi>
parents: 10134
diff changeset
90 MAIL_STORAGE_SERVICE_FLAG_TEMP_PRIV_DROP |
10498
569206178c09 mail storage service: Some flag enums were missing FLAG_ in the middle.
Timo Sirainen <tss@iki.fi>
parents: 10497
diff changeset
91 MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT |
21816
869db4bcecdb lib-storage: Replace MAIL_STORAGE_SERVICE_FLAG_AUTOEXPUNGE with explicit mail_user_autoexpunge()
Timo Sirainen <timo.sirainen@dovecot.fi>
parents: 21551
diff changeset
92 MAIL_STORAGE_SERVICE_FLAG_NO_IDLE_TIMEOUT;
10364
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
93 int c;
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
94
9159
6324a79d3ee1 Initial commit for v2.0 master rewrite. Several features are still missing.
Timo Sirainen <tss@iki.fi>
parents: 9121
diff changeset
95 if (IS_STANDALONE()) {
6324a79d3ee1 Initial commit for v2.0 master rewrite. Several features are still missing.
Timo Sirainen <tss@iki.fi>
parents: 9121
diff changeset
96 service_flags |= MASTER_SERVICE_FLAG_STANDALONE |
6324a79d3ee1 Initial commit for v2.0 master rewrite. Several features are still missing.
Timo Sirainen <tss@iki.fi>
parents: 9121
diff changeset
97 MASTER_SERVICE_FLAG_STD_CLIENT;
10259
e0db66c8b9a9 lmtp: Keep connection to config process open.
Timo Sirainen <tss@iki.fi>
parents: 10257
diff changeset
98 } else {
18041
297192cfbd37 lmtp: Added support for STARTTLS command.
Timo Sirainen <tss@iki.fi>
parents: 17130
diff changeset
99 service_flags |= MASTER_SERVICE_FLAG_KEEP_CONFIG_OPEN ;
9159
6324a79d3ee1 Initial commit for v2.0 master rewrite. Several features are still missing.
Timo Sirainen <tss@iki.fi>
parents: 9121
diff changeset
100 }
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
101
10119
1e63221f5c83 Moved most of getopt() handling to lib-master.
Timo Sirainen <tss@iki.fi>
parents: 10039
diff changeset
102 master_service = master_service_init("lmtp", service_flags,
10364
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
103 &argc, &argv, "D");
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
104 while ((c = master_getopt(master_service)) > 0) {
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
105 switch (c) {
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
106 case 'D':
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
107 storage_service_flags |=
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
108 MAIL_STORAGE_SERVICE_FLAG_ENABLE_CORE_DUMPS;
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
109 break;
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
110 default:
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
111 return FATAL_DEFAULT;
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
112 }
4183f16e6f60 lmtp: If -D parameter is given, enable core dumps.
Timo Sirainen <tss@iki.fi>
parents: 10259
diff changeset
113 }
11282
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
114
13977
d5ba2d63ed6d lmtp: Make core dumping work also after the first mail delivery.
Timo Sirainen <tss@iki.fi>
parents: 12782
diff changeset
115 if (t_get_current_dir(&base_dir) < 0)
d5ba2d63ed6d lmtp: Make core dumping work also after the first mail delivery.
Timo Sirainen <tss@iki.fi>
parents: 12782
diff changeset
116 i_fatal("getcwd() failed: %m");
11282
70cfc89a3936 lmtp: Set user/group at startup as specified in service block.
Timo Sirainen <tss@iki.fi>
parents: 10825
diff changeset
117 drop_privileges();
10257
597f969a9870 lmtp: Improved logging.
Timo Sirainen <tss@iki.fi>
parents: 10134
diff changeset
118 master_service_init_log(master_service,
597f969a9870 lmtp: Improved logging.
Timo Sirainen <tss@iki.fi>
parents: 10134
diff changeset
119 t_strdup_printf("lmtp(%s): ", my_pid));
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
120
10130
d1384c2b08e5 Merged single and multi mail_storage_service_*() functions.
Timo Sirainen <tss@iki.fi>
parents: 10127
diff changeset
121 storage_service = mail_storage_service_init(master_service, set_roots,
d1384c2b08e5 Merged single and multi mail_storage_service_*() functions.
Timo Sirainen <tss@iki.fi>
parents: 10127
diff changeset
122 storage_service_flags);
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
123 restrict_access_allow_coredumps(TRUE);
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
124
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
125 main_init();
16508
754d244b8249 Call master_service_init_finish() only after all of the initialization is done.
Timo Sirainen <tss@iki.fi>
parents: 15715
diff changeset
126 master_service_init_finish(master_service);
9348
0c587f108916 lib-master has now a global master_service variable that all binaries use.
Timo Sirainen <tss@iki.fi>
parents: 9159
diff changeset
127 master_service_run(master_service, client_connected);
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
128
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
129 main_deinit();
10130
d1384c2b08e5 Merged single and multi mail_storage_service_*() functions.
Timo Sirainen <tss@iki.fi>
parents: 10127
diff changeset
130 mail_storage_service_deinit(&storage_service);
9348
0c587f108916 lib-master has now a global master_service variable that all binaries use.
Timo Sirainen <tss@iki.fi>
parents: 9159
diff changeset
131 master_service_deinit(&master_service);
9121
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
132 return 0;
a957a6be4af5 Initial implementation of LMTP server. Master process doesn't yet execute it though.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
133 }