aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--driver.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 509e37f9..f73bd083 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,11 @@ features --
* The host that ETRN specifies is now set by the smtphost option.
+bugs --
+
+* The counter referred to by the batchlimit option used to count not only
+ fetched messages but skipped ones. This has been fixed.
+
------------------------------------------------------------------------------
fetchmail-3.4 (Wed Feb 12 19:23:06 EST 1997)
diff --git a/driver.c b/driver.c
index c6a67b81..94711453 100644
--- a/driver.c
+++ b/driver.c
@@ -1284,6 +1284,8 @@ const struct method *proto; /* protocol method table */
}
else if (count > 0)
{
+ int force_retrieval, fetches;
+
/*
* What forces this code is that in POP3 and IMAP2BIS you can't
* fetch a message without having it marked `seen'. In IMAP4,
@@ -1306,9 +1308,9 @@ const struct method *proto; /* protocol method table */
* previous pass and forcing all messages to be considered new
* if it's nonzero.
*/
- int force_retrieval = !peek_capable && (ctl->errcount > 0);
+ force_retrieval = !peek_capable && (ctl->errcount > 0);
- ctl->errcount = 0;
+ ctl->errcount = fetches = 0;
/* read, forward, and delete messages */
for (num = 1; num <= count; num++)
@@ -1367,6 +1369,8 @@ const struct method *proto; /* protocol method table */
goto cleanUp;
vtalarm(ctl->server.timeout);
}
+
+ fetches++;
}
/*
@@ -1396,7 +1400,7 @@ const struct method *proto; /* protocol method table */
error_complete(0, 0, " not flushed");
/* perhaps this as many as we're ready to handle */
- if (ctl->fetchlimit && ctl->fetchlimit <= num)
+ if (ctl->fetchlimit && ctl->fetchlimit <= fetches)
break;
}