aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-02-21 03:45:49 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-02-21 03:45:49 +0000
commit4005acb9924f35b7c51328c44b4b3986d3be2bee (patch)
treefa56e11169895af72b5bff9f61bf2a182f88ecd6 /imap.c
parent18121bbdd9912ff5a7d3a8714c50b1608b96ae4a (diff)
downloadfetchmail-4005acb9924f35b7c51328c44b4b3986d3be2bee.tar.gz
fetchmail-4005acb9924f35b7c51328c44b4b3986d3be2bee.tar.bz2
fetchmail-4005acb9924f35b7c51328c44b4b3986d3be2bee.zip
Craig's patches in response to cmetz3.
svn path=/trunk/; revision=1664
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/imap.c b/imap.c
index b4f52489..0924a822 100644
--- a/imap.c
+++ b/imap.c
@@ -122,7 +122,7 @@ static int do_otp(int sock, struct query *ctl)
char challenge[OPIE_CHALLENGE_MAX+1];
char response[OPIE_RESPONSE_MAX+1];
- gen_send(sock, "AUTHENTICATE OTP");
+ gen_send(sock, "AUTHENTICATE X-OTP");
if (rval = gen_recv(sock, buffer, sizeof(buffer)))
return rval;
@@ -597,10 +597,11 @@ int imap_getauth(int sock, struct query *ctl, char *greeting)
peek_capable = (imap_version >= IMAP4);
#if OPIE
- if ((ctl->server.protocol == P_IMAP) && strstr(capabilities, "AUTH=OTP")) {
+ if ((ctl->server.protocol == P_IMAP) && strstr(capabilities, "AUTH=X-OTP")) {
if (outlevel == O_VERBOSE)
error(0, 0, "OTP authentication is supported");
- return do_otp(sock, ctl);
+ if (do_otp(sock, ctl) == PS_SUCCESS)
+ return PS_SUCCESS;
};
#endif /* OPIE */
@@ -647,6 +648,11 @@ int imap_getauth(int sock, struct query *ctl, char *greeting)
}
#endif /* KERBEROS_V4 */
+ if ((imap_version >= IMAP4) && (!strstr(capabilities, "AUTH=LOGIN"))) {
+ error(0,-1, "Required LOGIN capability not supported by server");
+ return PS_AUTHFAIL;
+ };
+
/* try to get authorized in the ordinary (AUTH=LOGIN) way */
ok = gen_transact(sock, "LOGIN %s \"%s\"", ctl->remotename, ctl->password);
if (ok)