Skip to content

Commit 6c50a57

Browse files
rheniumgitster
authored andcommitted
imap-send: check for NOLOGIN capability only when using LOGIN command
Don't check for NOLOGIN (LOGINDISABLED) capability when imap.authMethod is specified. LOGINDISABLED capability doesn't forbid using AUTHENTICATE, so it should be allowed, or we can't connect to IMAP servers which only accepts AUTHENTICATE command. Signed-off-by: Kazuki Yamaguchi <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d95553a commit 6c50a57

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

imap-send.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,11 +1095,6 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f
10951095
srvc->pass = xstrdup(cred.password);
10961096
}
10971097

1098-
if (CAP(NOLOGIN)) {
1099-
fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host);
1100-
goto bail;
1101-
}
1102-
11031098
if (srvc->auth_method) {
11041099
struct imap_cmd_cb cb;
11051100

@@ -1123,6 +1118,11 @@ static struct imap_store *imap_open_store(struct imap_server_conf *srvc, char *f
11231118
goto bail;
11241119
}
11251120
} else {
1121+
if (CAP(NOLOGIN)) {
1122+
fprintf(stderr, "Skipping account %s@%s, server forbids LOGIN\n",
1123+
srvc->user, srvc->host);
1124+
goto bail;
1125+
}
11261126
if (!imap->buf.sock.ssl)
11271127
imap_warn("*** IMAP Warning *** Password is being "
11281128
"sent in the clear\n");

0 commit comments

Comments
 (0)