From 4005acb9924f35b7c51328c44b4b3986d3be2bee Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 21 Feb 1998 03:45:49 +0000 Subject: Craig's patches in response to cmetz3. svn path=/trunk/; revision=1664 --- imap.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'imap.c') 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) -- cgit v1.2.3