]> Pileus Git - ~andy/fetchmail/blobdiff - pop3.c
Bring us up to date with gnuplot 1.37.
[~andy/fetchmail] / pop3.c
diff --git a/pop3.c b/pop3.c
index 01770aa1fb56fbaca84cfed9b9eb80a8240d4961..75b523189cdda24b9229eab2864cdaa3d4f70096 100644 (file)
--- 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 */