aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/imap.c b/imap.c
index 708f610a..64dc4efb 100644
--- a/imap.c
+++ b/imap.c
@@ -451,10 +451,15 @@ static int imap_getauth(int sock, struct query *ctl, char *greeting)
}
#endif /* __UNUSED__ */
- /* we're stuck with sending the password en clair */
- if ((ctl->server.authenticate == A_ANY
- || ctl->server.authenticate == A_PASSWORD)
- && !strstr (capabilities, "LOGINDISABLED"))
+ /*
+ * We're stuck with sending the password en clair.
+ * The reason for this odd-looking logic is that some
+ * servers return LOGINDISABLED even though login
+ * actually works. So arrange things in such a way that
+ * setting auth passwd makes it ignore this capability.
+ */
+ if((ctl->server.authenticate==A_ANY&&!strstr(capabilities,"LOGINDISABLED"))
+ || ctl->server.authenticate == A_PASSWORD)
{
/* these sizes guarantee no buffer overflow */
char remotename[NAMELEN*2+1], password[PASSWORDLEN*2+1];