From 16e90f0c2139d5600083013e30a1338d9894e255 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 10 Jul 2002 13:56:20 +0000 Subject: More fixes from Sunil. svn path=/trunk/; revision=3660 --- pop3.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'pop3.c') diff --git a/pop3.c b/pop3.c index 01770aa1..75b52318 100644 --- a/pop3.c +++ b/pop3.c @@ -70,7 +70,9 @@ static int pop3_ok (int sock, char *argbuf) } else if (strncmp(buf,"-ERR", 4) == 0) { - if (stage > STAGE_GETAUTH) + if (stage == STAGE_FETCH) + ok = PS_TRANSIENT; + else if (stage > STAGE_GETAUTH) ok = PS_PROTOCOL; /* * We're checking for "lock busy", "unable to lock", @@ -229,7 +231,13 @@ static int pop3_getauth(int sock, struct query *ctl, char *greeting) } } /* we are in STAGE_GETAUTH! */ - else if (ok == PS_AUTHFAIL) + else if (ok == PS_AUTHFAIL || + /* Some servers directly close the socket. However, if we + * have already authenticated before, then a previous CAPA + * must have succeeded. In that case, treat this as a + * genuine socket error and do not change the auth method. + */ + (ok == PS_SOCKET && !ctl->wehaveauthed)) { ctl->server.authenticate = A_PASSWORD; /* repoll immediately */ -- cgit v1.2.3