]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If imap/pop3 service is tried to be started without being auth_dest_service, log...
authorTimo Sirainen <tss@iki.fi>
Sat, 25 Jul 2009 00:59:49 +0000 (20:59 -0400)
committerTimo Sirainen <tss@iki.fi>
Sat, 25 Jul 2009 00:59:49 +0000 (20:59 -0400)
If login_executable=imap/pop3, give better error message.

--HG--
branch : HEAD

src/imap/main.c
src/pop3/main.c

index cf8733898ce779252d0629b2792f37def8fe52a2..88a5ef03af2be7ceaf33fd52f7324488475b5e6b 100644 (file)
@@ -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);
index 6d86aeb9af1080183f70d122de32bfc48620cd8a..528a826a921ad97c40cf4dc5c3457c9adc34f3e1 100644 (file)
@@ -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);