changeset 9653:ad5d34c9031d HEAD

If imap/pop3 service is tried to be started without being auth_dest_service, log better error. If login_executable=imap/pop3, give better error message.
author Timo Sirainen <tss@iki.fi>
date Fri, 24 Jul 2009 20:59:49 -0400
parents 1644c25bfbef
children 5714aba539f0
files src/imap/main.c src/pop3/main.c
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/imap/main.c	Fri Jul 24 16:57:17 2009 -0400
+++ b/src/imap/main.c	Fri Jul 24 20:59:49 2009 -0400
@@ -206,11 +206,15 @@
 	input.module = "imap";
 	input.service = "imap";
 	input.username = getenv("USER");
+	if (input.username == NULL && IS_STANDALONE())
+		input.username = getlogin();
 	if (input.username == NULL) {
-		if (IS_STANDALONE())
-			input.username = getlogin();
-		if (input.username == NULL)
+		if (getenv(MASTER_UID_ENV) == NULL)
 			i_fatal("USER environment missing");
+		else {
+			i_fatal("login_executable setting must be imap-login, "
+				"not imap");
+		}
 	}
 	if ((value = getenv("IP")) != NULL)
 		net_addr2ip(value, &input.remote_ip);
--- a/src/pop3/main.c	Fri Jul 24 16:57:17 2009 -0400
+++ b/src/pop3/main.c	Fri Jul 24 20:59:49 2009 -0400
@@ -113,11 +113,15 @@
 	input.module = "pop3";
 	input.service = "pop3";
 	input.username = getenv("USER");
+	if (input.username == NULL && IS_STANDALONE())
+		input.username = getlogin();
 	if (input.username == NULL) {
-		if (IS_STANDALONE())
-			input.username = getlogin();
-		if (input.username == NULL)
+		if (getenv(MASTER_UID_ENV) == NULL)
 			i_fatal("USER environment missing");
+		else {
+			i_fatal("login_executable setting must be pop3-login, "
+				"not pop3");
+		}
 	}
 	if ((value = getenv("IP")) != NULL)
 		net_addr2ip(value, &input.remote_ip);