dovecot-2.2: doveadm: Log better errors for failing passdb proxy...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jan 5 01:14:34 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/8bc9d40d77c4
changeset: 15535:8bc9d40d77c4
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Nov 28 03:32:31 2012 +0200
description:
doveadm: Log better errors for failing passdb proxy lookups.

diffstat:

 src/doveadm/doveadm-mail-server.c |  15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diffs (45 lines):

diff -r 755a2f08cde5 -r 8bc9d40d77c4 src/doveadm/doveadm-mail-server.c
--- a/src/doveadm/doveadm-mail-server.c	Wed Nov 28 03:32:01 2012 +0200
+++ b/src/doveadm/doveadm-mail-server.c	Wed Nov 28 03:32:31 2012 +0200
@@ -177,7 +177,7 @@
 	struct auth_master_connection *auth_conn;
 	struct auth_user_info info;
 	pool_t pool;
-	const char *proxy_host, *const *fields;
+	const char *auth_socket_path, *proxy_host, *const *fields;
 	unsigned int i;
 	bool proxying;
 	int ret;
@@ -195,14 +195,15 @@
 
 	pool = pool_alloconly_create("auth lookup", 1024);
 	auth_conn = mail_storage_service_get_auth_conn(ctx->storage_service);
+	auth_socket_path = auth_master_get_socket_path(auth_conn);
 	ret = auth_master_pass_lookup(auth_conn, input->username, &info,
 				      pool, &fields);
 	if (ret < 0) {
 		*error_r = fields[0] != NULL ?
 			t_strdup(fields[0]) : "passdb lookup failed";
-		*error_r = t_strdup_printf("%s (to see if user is proxied, "
+		*error_r = t_strdup_printf("%s: %s (to see if user is proxied, "
 					   "because doveadm_proxy_port is set)",
-					   *error_r);
+					   auth_socket_path, *error_r);
 	} else if (ret == 0) {
 		/* user not found from passdb. it could be in userdb though,
 		   so just continue with the default host */
@@ -218,7 +219,13 @@
 		if (!proxying)
 			ret = 0;
 		else if (proxy_host == NULL) {
-			*error_r = "Proxy is missing destination host";
+			*error_r = t_strdup_printf("%s: Proxy is missing destination host",
+						   auth_socket_path);
+			if (strstr(auth_socket_path, "/auth-userdb") != NULL) {
+				*error_r = t_strdup_printf(
+					"%s (maybe set auth_socket_path=director-userdb)",
+					*error_r);
+			}
 			ret = -1;
 		} else {
 			*host_r = t_strdup_printf("%s:%u", proxy_host,


More information about the dovecot-cvs mailing list