dovecot-2.0: Moved default service settings from master.conf to ...
dovecot at dovecot.org
dovecot at dovecot.org
Sat Oct 24 04:47:38 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/afe52d60989c
changeset: 10179:afe52d60989c
user: Timo Sirainen <tss at iki.fi>
date: Fri Oct 23 21:47:30 2009 -0400
description:
Moved default service settings from master.conf to source code.
diffstat:
23 files changed, 671 insertions(+), 236 deletions(-)
doc/example-config/conf.d/master.conf | 144 +++------------------------------
src/anvil/Makefile.am | 1
src/anvil/anvil-settings.c | 45 ++++++++++
src/auth/auth-settings.c | 79 ++++++++++++++++++
src/config/Makefile.am | 1
src/config/config-parser.c | 37 --------
src/config/config-settings.c | 45 ++++++++++
src/config/settings-get.pl | 15 +++
src/dict/dict-settings.c | 39 ++++++++
src/imap-login/imap-login-settings.c | 25 +++++
src/imap/imap-settings.c | 39 ++++++++
src/lib-master/Makefile.am | 1
src/lib-master/service-settings.h | 57 +++++++++++++
src/lib-settings/settings-parser.c | 141 ++++++++++++++++++++++++++++----
src/lib-settings/settings-parser.h | 3
src/lmtp/lmtp-settings.c | 39 ++++++++
src/log/Makefile.am | 1
src/log/log-settings.c | 32 +++++++
src/master/master-settings.c | 7 +
src/master/master-settings.h | 53 ------------
src/pop3-login/pop3-login-settings.c | 25 +++++
src/pop3/pop3-settings.c | 39 ++++++++
src/ssl-params/ssl-params-settings.c | 39 ++++++++
diffs (truncated from 1287 to 300 lines):
diff -r 272bec780e26 -r afe52d60989c doc/example-config/conf.d/master.conf
--- a/doc/example-config/conf.d/master.conf Fri Oct 23 20:11:59 2009 -0400
+++ b/doc/example-config/conf.d/master.conf Fri Oct 23 21:47:30 2009 -0400
@@ -2,70 +2,7 @@ default_client_limit = 1000
default_client_limit = 1000
default_vsz_limit = 256
-service config {
- type = config
- executable = config
-
- unix_listener config {
- mode = 0666
- }
-}
-
-service log {
- type = log
- executable = log
-
- process_limit = 1
-}
-
-service anvil {
- type = anvil
- executable = anvil
- process_limit = 1
- user = dovecot
- chroot = empty/
-
- unix_listener anvil {
- }
-}
-
-service auth {
- executable = auth
-
- unix_listener login/auth {
- mode = 0666
- }
-
- # Postfix smtp-auth
- #unix_listener /var/spool/postfix/private/auth {
- # mode = 0666
- #}
-
- # Dovecot LDA
- unix_listener auth-userdb {
- mode = 0600
- }
-
- unix_listener auth-master {
- mode = 0600
- }
-
- process_limit = 1
-}
-
-service auth-worker {
- executable = auth -w
- client_limit = 1
-
- unix_listener auth-worker {
- }
-}
-
service imap-login {
- protocol = imap
- type = login
- executable = imap-login
-
inet_listener {
port = 143
}
@@ -74,45 +11,16 @@ service imap-login {
ssl = yes
}
- user = dovecot
# Number of connections to handle before starting a new process. Typically
# the only useful values are 0 (unlimited) or 1. 1 is more secure, but 0
# is faster. <doc/wiki/LoginProcess.txt>
- service_count = 1
+ #service_count = 1
+
# If you set service_count=0, you probably need to grow this.
- vsz_limit = 64
- # The only reason not to chroot login process is if you wish to run the
- # whole Dovecot without roots. <doc/wiki/Rootless.txt>
- chroot = login
-}
-
-service imap {
- protocol = imap
-
- # This would write rawlogs into user's ~/dovecot.rawlog/, if it exists:
- # executable = rawlog /usr/libexec/dovecot/imap
- # <doc/wiki/Debugging/Rawlog.txt>
- #
- # This would attach gdb into the imap process and write backtraces into
- # /tmp/gdbhelper.* files:
- # executable = gdbhelper /usr/libexec/dovecot/imap
- executable = imap
-
- # Most of the memory goes to mmap()ing files. You may need to increase this
- # limit if you have huge mailboxes.
- #vsz_limit = 256
-
- service_count = 1
- unix_listener login/imap {
- mode = 0666
- }
+ #vsz_limit = 64
}
service pop3-login {
- protocol = pop3
- type = login
- executable = pop3-login
-
inet_listener {
port = 110
}
@@ -120,45 +28,23 @@ service pop3-login {
port = 995
ssl = yes
}
-
- # See imap-login service for description of these
- user = dovecot
- service_count = 1
- vsz_limit = 64
- chroot = login
-}
-
-service pop3 {
- protocol = pop3
- executable = pop3
-
- service_count = 1
- unix_listener login/pop3 {
- mode = 0666
- }
}
service lmtp {
- protocol = lmtp
- executable = lmtp
-
- unix_listener lmtp {
- mode = 0666
- }
+ #inet_listener {
+ # port =
+ #}
}
-service dict {
- executable = dict
-
- unix_listener dict {
- mode = 0666
- }
+service imap {
+ # Most of the memory goes to mmap()ing files. You may need to increase this
+ # limit if you have huge mailboxes.
+ #vsz_limit = 256
}
-service ssl-params {
- executable = ssl-params
-
- unix_listener login/ssl-params {
- mode = 0666
- }
+service auth {
+ # Postfix smtp-auth
+ #unix_listener /var/spool/postfix/private/auth {
+ # mode = 0666
+ #}
}
diff -r 272bec780e26 -r afe52d60989c src/anvil/Makefile.am
--- a/src/anvil/Makefile.am Fri Oct 23 20:11:59 2009 -0400
+++ b/src/anvil/Makefile.am Fri Oct 23 21:47:30 2009 -0400
@@ -16,6 +16,7 @@ anvil_SOURCES = \
anvil_SOURCES = \
main.c \
anvil-connection.c \
+ anvil-settings.c \
connect-limit.c
noinst_HEADERS = \
diff -r 272bec780e26 -r afe52d60989c src/anvil/anvil-settings.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/anvil/anvil-settings.c Fri Oct 23 21:47:30 2009 -0400
@@ -0,0 +1,45 @@
+/* Copyright (c) 2009 Dovecot authors, see the included COPYING file */
+
+#include "lib.h"
+#include "buffer.h"
+#include "settings-parser.h"
+#include "service-settings.h"
+
+#include <stddef.h>
+
+/* <settings checks> */
+static struct file_listener_settings anvil_unix_listeners_array[] = {
+ { "anvil", 0600, "", "" }
+};
+static struct file_listener_settings *anvil_unix_listeners[] = {
+ &anvil_unix_listeners_array[0]
+};
+static buffer_t anvil_unix_listeners_buf = {
+ anvil_unix_listeners, sizeof(anvil_unix_listeners), { 0, }
+};
+/* </settings checks> */
+
+struct service_settings anvil_service_settings = {
+ MEMBER(name) "anvil",
+ MEMBER(protocol) "",
+ MEMBER(type) "anvil",
+ MEMBER(executable) "anvil",
+ MEMBER(user) "dovecot",
+ MEMBER(group) "",
+ MEMBER(privileged_group) "",
+ MEMBER(extra_groups) "",
+ MEMBER(chroot) "empty",
+
+ MEMBER(drop_priv_before_exec) FALSE,
+
+ MEMBER(process_min_avail) 0,
+ MEMBER(process_limit) 1,
+ MEMBER(client_limit) 0,
+ MEMBER(service_count) 0,
+ MEMBER(vsz_limit) -1U,
+
+ MEMBER(unix_listeners) { { &anvil_unix_listeners_buf,
+ sizeof(anvil_unix_listeners[0]) } },
+ MEMBER(fifo_listeners) ARRAY_INIT,
+ MEMBER(inet_listeners) ARRAY_INIT
+};
diff -r 272bec780e26 -r afe52d60989c src/auth/auth-settings.c
--- a/src/auth/auth-settings.c Fri Oct 23 20:11:59 2009 -0400
+++ b/src/auth/auth-settings.c Fri Oct 23 21:47:30 2009 -0400
@@ -4,6 +4,7 @@
#include "array.h"
#include "settings-parser.h"
#include "master-service-settings.h"
+#include "service-settings.h"
#include "auth-settings.h"
#include <stddef.h>
@@ -12,6 +13,84 @@ extern const struct setting_parser_info
extern const struct setting_parser_info auth_root_setting_parser_info;
static bool auth_settings_check(void *_set, pool_t pool, const char **error_r);
+
+/* <settings checks> */
+static struct file_listener_settings auth_unix_listeners_array[] = {
+ { "login/auth", 0666, "", "" },
+ { "auth-userdb", 0600, "", "" },
+ { "auth-master", 0600, "", "" }
+};
+static struct file_listener_settings *auth_unix_listeners[] = {
+ &auth_unix_listeners_array[0],
+ &auth_unix_listeners_array[1],
+ &auth_unix_listeners_array[2]
+};
+static buffer_t auth_unix_listeners_buf = {
+ auth_unix_listeners, sizeof(auth_unix_listeners), { 0, }
+};
+/* </settings checks> */
+
+struct service_settings auth_service_settings = {
+ MEMBER(name) "auth",
+ MEMBER(protocol) "",
+ MEMBER(type) "",
+ MEMBER(executable) "auth",
+ MEMBER(user) "",
+ MEMBER(group) "",
+ MEMBER(privileged_group) "",
+ MEMBER(extra_groups) "",
+ MEMBER(chroot) "",
+
+ MEMBER(drop_priv_before_exec) FALSE,
+
+ MEMBER(process_min_avail) 0,
+ MEMBER(process_limit) 1,
+ MEMBER(client_limit) 0,
+ MEMBER(service_count) 0,
+ MEMBER(vsz_limit) -1U,
+
+ MEMBER(unix_listeners) { { &auth_unix_listeners_buf,
+ sizeof(auth_unix_listeners[0]) } },
+ MEMBER(fifo_listeners) ARRAY_INIT,
+ MEMBER(inet_listeners) ARRAY_INIT
+};
+
+/* <settings checks> */
+static struct file_listener_settings auth_worker_unix_listeners_array[] = {
More information about the dovecot-cvs
mailing list