From f63186b4bd9a6439ff93ce48897f8df659062691 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 18 Oct 2002 15:29:36 +0000 Subject: Handle servers with LOGINDISABLED. svn path=/trunk/; revision=3747 --- imap.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'imap.c') 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]; -- cgit v1.2.3