From 4967f6bb9c5d7bb7ff3fd1cb28244a249bdea755 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 22 Nov 1997 07:26:03 +0000 Subject: Ready to ship, I think. svn path=/trunk/; revision=1538 --- pop3.c | 60 ++++++++++++++++++++++++------------------------------------ 1 file changed, 24 insertions(+), 36 deletions(-) (limited to 'pop3.c') diff --git a/pop3.c b/pop3.c index 0cdf3179..a8808836 100644 --- a/pop3.c +++ b/pop3.c @@ -104,44 +104,32 @@ int pop3_getauth(int sock, struct query *ctl, char *greeting) case P_POP3: ok = gen_transact(sock, "USER %s", ctl->remotename); - if (ok != 0) #ifdef RPA_ENABLE - /* if CompuServe rejected our userid, try RPA */ - if (strstr(greeting, "csi.com")) - { - /* AUTH command should return a list of available mechanisms */ - if (gen_transact(sock, "AUTH") == 0) - { - char buffer[10]; - flag has_rpa = FALSE; - flag authenticated = FALSE; - - while ((ok = gen_recv(sock, buffer, sizeof(buffer))) == 0) - { - - if (buffer[0] == '.') - break; - if (strncasecmp(buffer, "rpa", 3) == 0) - has_rpa = TRUE; - } - if(has_rpa) { - if (POP3_auth_rpa(ctl->remotename, - ctl->password, sock) == PS_SUCCESS) - { - authenticated = TRUE; - break; - } - } - if (authenticated) { - /* we could return(PS_SUCCESS) here */ - ok = PS_SUCCESS; - break; - } - } - } - else /* not a CompuServe host, fail in the ordinary way */ + /* + * CompuServe has changed its RPA behavior. Used to be they didn't + * accept USER, but I'm told this changed in mid-November. + */ + if (strstr(greeting, "csi.com")) + { + /* AUTH command should return a list of available mechanisms */ + if (gen_transact(sock, "AUTH") == 0) + { + char buffer[10]; + flag has_rpa = FALSE; + + while ((ok = gen_recv(sock, buffer, sizeof(buffer))) == 0) + { + if (buffer[0] == '.') + break; + if (strncasecmp(buffer, "rpa", 3) == 0) + has_rpa = TRUE; + } + if (has_rpa && !POP3_auth_rpa(ctl->remotename, + ctl->password, sock)) + return(PS_SUCCESS); + } + } #endif /* RPA_ENABLE */ - break; #if defined(HAVE_LIBOPIE) && defined(OPIE_ENABLE) /* see RFC1938: A One-Time Password System */ -- cgit v1.2.3