fetchmail-friends
[Top] [All Lists]

[fetchmail]maxfetch and auto protocol

2001-05-25 22:30:53
Hi,

When the protocol is set to auto and a fetchlimit is put, during
polling, if the fetchlimit is reached, it switches to the next
protocol:

$ fetchmail -p auto -B 1 bombay.retortsoft.com
2 messages for shetye at bombay.retortsoft.com.
reading message 1 of 2 (401 header octets)  (8 body octets)  flushed
fetchmail: fetchlimit 1 reached; 1 messages left on server
1 message for shetye at bombay.retortsoft.com (409 octets).
reading message 1 of 1 (409 octets)  flushed

In the above case, it tried IMAP first and succeeded in downloading
one message. Then instead of quitting, it immediately switch to pop3
and downloaded the next.

The following patch causes it to quit on reaching the limit:

=====================================================================
diff -Naur fetchmail-5.8.4.orig/fetchmail.c fetchmail-5.8.4/fetchmail.c
--- fetchmail-5.8.4.orig/fetchmail.c    Mon May 14 12:01:55 2001
+++ fetchmail-5.8.4/fetchmail.c Fri May 25 15:30:17 2001
@@ -1376,7 +1376,7 @@
        for (i = 0; i < sizeof(autoprobe)/sizeof(autoprobe[0]); i++)
        {
            ctl->server.protocol = autoprobe[i];
-           if ((st = query_host(ctl)) == PS_SUCCESS || st == PS_NOMAIL || st 
== PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP)
+           if ((st = query_host(ctl)) == PS_SUCCESS || st == PS_NOMAIL || st 
== PS_AUTHFAIL || st == PS_LOCKBUSY || st == PS_SMTP || st == PS_MAXFETCH)
                break;
        }
        ctl->server.protocol = P_AUTO;
=====================================================================

Now, after patching, it goes as:

$ fetchmail -p auto -B 1 bombay.retortsoft.com
2 messages for shetye at bombay.retortsoft.com.
reading message 1 of 2 (401 header octets)  (8 body octets)  flushed
fetchmail: fetchlimit 1 reached; 1 messages left on server
fetchmail: Query status=13 (MAXFETCH)

Sunil Shetye.


<Prev in Thread] Current Thread [Next in Thread>
  • [fetchmail]maxfetch and auto protocol, Sunil Shetye <=