From cef2be5fb553b05f421f86c1ef497f0dc29d069e Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 24 Jul 2009 20:59:49 -0400 Subject: [PATCH] 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. --HG-- branch : HEAD --- src/imap/main.c | 10 +++++++--- src/pop3/main.c | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/imap/main.c b/src/imap/main.c index cf8733898c..88a5ef03af 100644 --- a/src/imap/main.c +++ b/src/imap/main.c @@ -206,11 +206,15 @@ int main(int argc, char *argv[], char *envp[]) 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); diff --git a/src/pop3/main.c b/src/pop3/main.c index 6d86aeb9af..528a826a92 100644 --- a/src/pop3/main.c +++ b/src/pop3/main.c @@ -113,11 +113,15 @@ int main(int argc, char *argv[], char *envp[]) 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); -- 2.47.3