aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-10-18 15:29:36 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-10-18 15:29:36 +0000
commitf63186b4bd9a6439ff93ce48897f8df659062691 (patch)
tree84b92ec5e40bf1d48fc317fd4c916c20e5f9f5ff /imap.c
parent0f19cf5f3f3ee4637609c61d0ac2b862d82204ad (diff)
downloadfetchmail-f63186b4bd9a6439ff93ce48897f8df659062691.tar.gz
fetchmail-f63186b4bd9a6439ff93ce48897f8df659062691.tar.bz2
fetchmail-f63186b4bd9a6439ff93ce48897f8df659062691.zip
Handle servers with LOGINDISABLED.
svn path=/trunk/; revision=3747
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];