fetchmail-friends
[Top] [All Lists]

[fetchmail] keep and top

2003-05-22 04:10:53
Hi,

I wanted to use the "keep" option on a server where TOP should be used
and saw, that "keep" forces TOP to be disabled. On first thought this is
sensible, but only if "uidl" is not enabled, because then fetchmail can
determine which messages are new. My patch below fixes this. It also
uses this check made for peek_cabable to reduce code redundancy.
In the end I think think usage of TOP or RETR should be configurable
(what has fetchall to do with it?).



--- fetchmail-6.2.2/pop3.c      Fri Feb 28 12:44:57 2003
+++ fetchmail-6.2.2-2/pop3.c    Thu May 22 12:58:42 2003
@@ -467,7 +467,7 @@
     sleep(3); /* to be _really_ safe, probably need sleep(5)! */

     /* we're peek-capable if use of TOP is enabled */
-    peek_capable = !(ctl->fetchall || ctl->keep);
+    peek_capable = !(ctl->fetchall || (ctl->keep &&
!ctl->server.uidl));

     /* we're approved */
     return(PS_SUCCESS);
@@ -812,10 +812,10 @@
      * The line count passed (99999999) is the maximum value CompuServe
will
      * accept; it's much lower than the natural value 2147483646 (the
maximum
      * twos-complement signed 32-bit integer minus 1) */
-    if (ctl->keep || ctl->fetchall)
-       gen_send(sock, "RETR %d", number);
-    else
+    if (peek_capable)
        gen_send(sock, "TOP %d 99999999", number);
+    else
+       gen_send(sock, "RETR %d", number);
     if ((ok = pop3_ok(sock, buf)) != 0)
        return(ok);



<Prev in Thread] Current Thread [Next in Thread>