fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]fetchmail 5.9.13: SOCKET error when fetching mail

2002-06-26 05:18:45
Quoting from Eric S. Raymond's mail on Wed, Jun 26, 2002 at 03:39:03AM -0400:
My current plan is to retain the previous patch and add a FAQ iterm that 
explains the "auth password" workaround.

Ok. Here is a better patch than the previous one. It treats socket
error as CAPA not supported only if authentication have never occurred
before. (I was going to add a new flag, however this should be
sufficient for the purpose.)

Please consider this for the next version.

===============================================================
diff -Naur fetchmail-5.9.13.orig/driver.c fetchmail-5.9.13/driver.c
--- fetchmail-5.9.13.orig/driver.c      Sun Jun 23 02:37:12 2002
+++ fetchmail-5.9.13/driver.c   Wed Jun 26 17:29:01 2002
@@ -1423,7 +1423,7 @@
 
     cleanUp:
        /* we only get here on error */
-       if (err != 0 && err != PS_SOCKET)
+       if (err != 0 && err != PS_SOCKET && err != PS_REPOLL)
        {
            stage = STAGE_LOGOUT;
            (ctl->server.base_protocol->logout_cmd)(mailserver_socket, ctl);
diff -Naur fetchmail-5.9.13.orig/pop3.c fetchmail-5.9.13/pop3.c
--- fetchmail-5.9.13.orig/pop3.c        Sun Jun 23 01:33:15 2002
+++ fetchmail-5.9.13/pop3.c     Wed Jun 26 17:29:01 2002
@@ -229,7 +229,13 @@
                }
            }
            /* 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 */
===============================================================

Sunil Shetye.