* Added Andrey Lelikov's recupe for Hotmail and Lycos Webmail.
* Switched to automake. (Matthias Andree)
* Build fixes for HESIOD and resolv.h trouble on FreeBSD. (Matthias Andree)
+* Fabrice Bellet's fix for Red Hat bug #113492, fetchmail hangs in IMAP
+ mode after EXPUNGE when the server (Dovecot 0.99.10) doesn't update
+ RECENT and EXISTS counts. (Matthias Andree)
fetchmail-6.2.5 (Wed Oct 15 18:39:22 EDT 2003), 23079 lines:
#define IMAP4rev1 1 /* IMAP4 rev 1, RFC2060 */
static int count = 0, recentcount = 0, unseen = 0, deletions = 0;
+static int recentcount_ok = 0;
static unsigned int startcount = 1;
static int expunged, expunge_period, saved_timeout = 0;
static int imap_version, preauth;
/* a space is required to avoid confusion with the \Recent flag */
else if (strstr(buf, " RECENT"))
{
+ recentcount_ok = 1;
recentcount = atoi(buf+2);
}
+ else if (strstr(buf, "EXPUNGE") && !strstr(buf, "OK"))
+ {
+ count -= atoi(buf+2);
+ if (count < 0)
+ count = 0;
+ }
else if (strstr(buf, "PREAUTH"))
preauth = TRUE;
/*
{
int ok;
+ recentcount_ok = 0;
+
if ((ok = gen_transact(sock, "EXPUNGE")))
return(ok);
+ /* some servers do not report RECENT after an EXPUNGE. in this case,
+ * the previous value of recentcount is just ignored. */
+ if (!recentcount_ok)
+ recentcount = 0;
+
expunged += deletions;
deletions = 0;
* for new mail.
*/
- /* some servers do not report RECENT after an EXPUNGE. this check
- * forces an incorrect recentcount to be ignored. */
- if (recentcount > count)
- recentcount = 0;
/* this is a while loop because imap_idle() might return on other
* mailbox changes also */
while (recentcount == 0 && do_idle) {