aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2002-07-10 13:56:20 +0000
committerEric S. Raymond <esr@thyrsus.com>2002-07-10 13:56:20 +0000
commit16e90f0c2139d5600083013e30a1338d9894e255 (patch)
treee09cc59cd8193c58b9a01a1aa5da88e8d3bb5269 /pop3.c
parent25d874ba0762ce219279e8640ee4f6f921fe7828 (diff)
downloadfetchmail-16e90f0c2139d5600083013e30a1338d9894e255.tar.gz
fetchmail-16e90f0c2139d5600083013e30a1338d9894e255.tar.bz2
fetchmail-16e90f0c2139d5600083013e30a1338d9894e255.zip
More fixes from Sunil.
svn path=/trunk/; revision=3660
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c12
1 files changed, 10 insertions, 2 deletions
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 */