[fetchmail]BUG (?) fetchmail 6.2.5 hangs with 'idle' on OpenBSD

Casper Gripenberg casper@iki.fi
Mon, 20 Feb 2006 22:55:16 +0200


Matthias Andree wrote:
> please retry with 6.3.2 which has several dozen bugfixes over 6.2.5
> including fixes for parsing untagged responses and timeout bugs (I'm not
> sure if this particular was addressed; it was not attacked explicitly,
> but it may profit from a related fix).

Hi..thanks for the suggestion, and this is actually what I did.
6.3.2 has the exact same problem. I posted full a full trace to
fetchmail-devel on berlios, but nobody has replied so far. Maybe
I really should have posted on the users list instead(?)

Anyway, I got impatient and tried to debug the code myself, and
the result is the following patch to 6.3.2. It completely fixes
the problem for me..but I'm unsure if I did the Right Thing.
Not really being familiar with the code I can't be sure it won't
break on other IMAP servers, but it works like a dream on mine,
and I get my mails instantly, without the poll delay.

Here's the patch (also posted it to fetchmail-devel on berlios):

-------------------------------------------------------------
*** imap_orig.c Mon Feb 20 02:26:35 2006
--- imap.c      Mon Feb 20 02:17:05 2006
***************
*** 110,115 ****
--- 110,118 ----

                     mytimeout = saved_timeout;
                     stage = STAGE_FETCH;
+
+                   recentcount = count;
+                   return PS_SUCCESS;
                 }
             }
             else if (strstr(buf, " RECENT"))
-------------------------------------------------------------

Casper