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

dovecot at dovecot.org dovecot at dovecot.org
Wed Jan 21 00:35:51 EET 2009


details:   http://hg.dovecot.org/dovecot-1.1/rev/5cc6ca3ab289
changeset: 8110:5cc6ca3ab289
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jan 20 17:35:46 2009 -0500
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, 28 insertions(+)
src/master/master-settings.c |   28 ++++++++++++++++++++++++++++

diffs (45 lines):

diff -r a09a4c7e3eb7 -r 5cc6ca3ab289 src/master/master-settings.c
--- a/src/master/master-settings.c	Tue Jan 20 15:04:08 2009 -0500
+++ b/src/master/master-settings.c	Tue Jan 20 17:35:46 2009 -0500
@@ -552,6 +552,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;
@@ -806,6 +826,14 @@ static bool settings_verify(struct setti
 		return FALSE;
 	}
 #endif
+	if (set->ssl_disable && set->disable_plaintext_auth &&
+	    strcmp(set->protocols, "none") != 0 &&
+	    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=no, "
+			  "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