dovecot-2.0: master: If ssl=no, skip inet_listeners with ssl=yes.

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 31 23:15:04 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/331cf0bd593e
changeset: 9841:331cf0bd593e
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 31 16:14:56 2009 -0400
description:
master: If ssl=no, skip inet_listeners with ssl=yes.

diffstat:

3 files changed, 7 insertions(+)
src/master/master-settings.c |    2 ++
src/master/master-settings.h |    1 +
src/master/service.c         |    4 ++++

diffs (47 lines):

diff -r 2dc1e03cad11 -r 331cf0bd593e src/master/master-settings.c
--- a/src/master/master-settings.c	Mon Aug 31 14:14:29 2009 -0400
+++ b/src/master/master-settings.c	Mon Aug 31 16:14:56 2009 -0400
@@ -190,6 +190,7 @@ static struct setting_define master_sett
 	DEF(SET_STR, base_dir),
 	DEF(SET_STR, libexec_dir),
 	DEF(SET_STR, protocols),
+	DEF(SET_ENUM, ssl),
 	DEF(SET_UINT, default_process_limit),
 	DEF(SET_UINT, default_client_limit),
 
@@ -211,6 +212,7 @@ static struct master_settings master_def
 	MEMBER(base_dir) PKG_RUNDIR,
 	MEMBER(libexec_dir) PKG_LIBEXECDIR,
 	MEMBER(protocols) "imap pop3 lmtp",
+	MEMBER(ssl) "yes:no:required",
 	MEMBER(default_process_limit) 100,
 	MEMBER(default_client_limit) 1000,
 
diff -r 2dc1e03cad11 -r 331cf0bd593e src/master/master-settings.h
--- a/src/master/master-settings.h	Mon Aug 31 14:14:29 2009 -0400
+++ b/src/master/master-settings.h	Mon Aug 31 16:14:56 2009 -0400
@@ -49,6 +49,7 @@ struct master_settings {
 	const char *base_dir;
 	const char *libexec_dir;
 	const char *protocols;
+	const char *ssl;
 	unsigned int default_process_limit;
 	unsigned int default_client_limit;
 
diff -r 2dc1e03cad11 -r 331cf0bd593e src/master/service.c
--- a/src/master/service.c	Mon Aug 31 14:14:29 2009 -0400
+++ b/src/master/service.c	Mon Aug 31 16:14:56 2009 -0400
@@ -128,9 +128,13 @@ service_create_inet_listeners(struct ser
 {
 	static struct service_listener *l;
 	const char *const *tmp;
+	bool ssl_disabled = strcmp(service->set->master_set->ssl, "no") == 0;
 
 	tmp = t_strsplit_spaces(set->address, ", ");
 	for (; *tmp != NULL; tmp++) {
+		if (set->ssl && ssl_disabled)
+			continue;
+
 		l = service_create_one_inet_listener(service, set, *tmp,
 						     error_r);
 		if (l == NULL)


More information about the dovecot-cvs mailing list