From c7ecafff50cf485f606f01833ba9a4ffc020643b Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 9 Dec 1996 17:43:09 +0000 Subject: Add full IMAP4 capability. svn path=/trunk/; revision=620 --- driver.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index 8d673078..b85b4e14 100644 --- a/driver.c +++ b/driver.c @@ -47,6 +47,7 @@ int batchlimit; /* how often to tear down the delivery connection */ int batchcount; /* count of messages sent in current batch */ +int peek_capable; /* can we peek for better error recovery? */ static const struct method *protocol; static jmp_buf restart; @@ -935,16 +936,19 @@ const struct method *proto; /* protocol method table */ else if (count > 0) { /* - * What forces this code is that in POP3 you can't fetch a - * message without having it marked `seen'. + * What forces this code is that in POP3 and IMAP2BIS you can't + * fetch a message without having it marked `seen'. In IMAP4, + * on the other hand, you can (peek_capable is set to convey + * this). * - * The result is that if there's any kind of transient error - * (DNS lookup failure, or sendmail refusing delivery due to - * process-table limits) the message will be marked "seen" on - * the server without having been delivered. This is not a - * big problem if fetchmail is running in foreground, because - * the user will see a "skipped" message when it next runs and - * get clued in. + * The result of being unable to peek is that if there's + * any kind of transient error (DNS lookup failure, or + * sendmail refusing delivery due to process-table limits) + * the message will be marked "seen" on the server without + * having been delivered. This is not a big problem if + * fetchmail is running in foreground, because the user + * will see a "skipped" message when it next runs and get + * clued in. * * But in daemon mode this leads to the message being silently * ignored forever. This is not acceptable. @@ -953,7 +957,7 @@ const struct method *proto; /* protocol method table */ * previous pass and forcing all messages to be considered new * if it's nonzero. */ - int force_retrieval = (ctl->errcount > 0); + int force_retrieval = !peek_capable && (ctl->errcount > 0); ctl->errcount = 0; -- cgit v1.2.3