aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--driver.c16
2 files changed, 15 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 7b1364ad..d6fdb521 100644
--- a/NEWS
+++ b/NEWS
@@ -14,8 +14,9 @@
fetchmail-4.3.2 ()
* More slow-UIDL patches from Wolfgang Wander.
* Yet another attempt to fix IMAP-K4. This one, my beta-testers say, works.
+* Only re-poll on actual dispatches (not just fetches).
-There are 266 people on fetchmail-friends and 46 on fetchmail-announce.
+There are 262 people on fetchmail-friends and 54 on fetchmail-announce.
fetchmail-4.3.1 (Mon Oct 13 17:12:40 EDT 1997)
* Minor portation fixes for early AIX versions and NextSTEP.
diff --git a/driver.c b/driver.c
index 6c22a49e..82654676 100644
--- a/driver.c
+++ b/driver.c
@@ -1467,7 +1467,7 @@ const struct method *proto; /* protocol method table */
{
char buf [POPBUFSIZE+1], *realhost;
int *msgsizes, len, num, count, new, deletions = 0;
- int port, fetches;
+ int port, fetches, dispatches;
struct idlist *idp;
/* execute pre-initialization command, if any */
@@ -1555,6 +1555,7 @@ const struct method *proto; /* protocol method table */
for (idp = ctl->mailboxes; idp; idp = idp->next)
{
do {
+ dispatches = 0;
++pass;
if (outlevel >= O_VERBOSE)
@@ -1797,6 +1798,10 @@ const struct method *proto; /* protocol method table */
}
}
+ /* count # messages forwarded on this pass */
+ if (!suppress_forward)
+ dispatches++;
+
/*
* Check to see if the numbers matched?
*
@@ -1898,15 +1903,20 @@ const struct method *proto; /* protocol method table */
}
} while
/*
- * Only re-poll if we allowed deletions and had no errors.
+ * Only re-poll if we had some actual forwards, allowed
+ * deletions and had no errors.
* Otherwise it is far too easy to get into infinite loops.
*/
- (fetches && protocol->retry && !ctl->keep && !ctl->errcount);
+ (dispatches && protocol->retry && !ctl->keep && !ctl->errcount);
}
no_error:
set_timeout(ctl->server.timeout);
ok = (protocol->logout_cmd)(sock, ctl);
+ /*
+ * Hmmmm...arguably this would be incorrect if we had fetches but
+ * no dispatches (due to oversized messages, etc.)
+ */
if (ok == 0)
ok = (fetches > 0) ? PS_SUCCESS : PS_NOMAIL;
set_timeout(0);