dovecot-1.2: Log a warning at startup if there doesn't seem to b...

dovecot at dovecot.org dovecot at dovecot.org
Sun Dec 21 10:16:02 EET 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/0eac46c235e7
changeset: 8584:0eac46c235e7
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Dec 21 10:15:58 2008 +0200
description:
Log a warning at startup if there doesn't seem to be any way to log in from non-localhost.

diffstat:

1 file changed, 27 insertions(+)
src/master/master-settings.c |   27 +++++++++++++++++++++++++++

diffs (44 lines):

diff -r 2ff2cac3578b -r 0eac46c235e7 src/master/master-settings.c
--- a/src/master/master-settings.c	Sun Dec 21 09:43:20 2008 +0200
+++ b/src/master/master-settings.c	Sun Dec 21 10:15:58 2008 +0200
@@ -581,6 +581,26 @@ static bool settings_have_connect_socket
 	return FALSE;
 }
 
+static bool settings_have_nonplaintext_auths(struct settings *set)
+{
+	struct auth_settings *auth;
+	struct server_settings *server;
+	const char *const *tmp;
+
+	for (server = set->server; server != NULL; server = server->next) {
+		for (auth = server->auths; auth != NULL; auth = auth->next) {
+			tmp = t_strsplit_spaces(auth->mechanisms, " ");
+			for (; *tmp != NULL; tmp++) {
+				if (strcasecmp(*tmp, "PLAIN") != 0 &&
+				    strcasecmp(*tmp, "LOGIN") != 0)
+					return TRUE;
+			}
+		}
+	}
+
+	return FALSE;
+}
+
 static void unlink_auth_sockets(const char *path, const char *prefix)
 {
 	DIR *dirp;
@@ -838,6 +858,13 @@ static bool settings_verify(struct setti
 		return FALSE;
 	}
 #endif
+	if (set->ssl_disable && set->disable_plaintext_auth &&
+	    strncmp(set->listen, "127.", 4) != 0 &&
+	    !settings_have_nonplaintext_auths(set)) {
+		i_warning("There is no way to login to this server: "
+			  "disable_plaintext_auth=yes, ssl_disable=yes, "
+			  "no non-plaintext auth mechanisms.");
+	}
 
 	if (set->max_mail_processes < 1) {
 		i_error("max_mail_processes must be at least 1");


More information about the dovecot-cvs mailing list