Quoting from Mikhail Zabaluev's mail on Wed, Oct 02, 2002 at 12:36:26PM +0400:
I'm having problems making fetchmail 6.1.0 retrieve my POP3 mailbox.
It stumbles over the first message, which is left there by the IMAP
server:
Oops! This was due to my patch to optimise for retained mails. The
problem is that readbody cannot be suppressed for POP3 as the body is
already being sent. Here is a patch which suppresses reading the body
only if the protocol supports it. This logic is extended to transient
(dns) and refused (duplicate mail) errors.
=======================================================================
diff -Naur fetchmail-6.1.0.orig/driver.c fetchmail-6.1.0/driver.c
--- fetchmail-6.1.0.orig/driver.c Mon Sep 9 13:34:26 2002
+++ fetchmail-6.1.0/driver.c Thu Oct 3 14:10:51 2002
@@ -493,11 +493,25 @@
err = readheaders(mailserver_socket, len, msgsizes[num-1],
ctl, num);
if (err == PS_RETAINED)
- suppress_readbody = suppress_forward = suppress_delete =
retained = TRUE;
+ {
+ suppress_forward = suppress_delete = retained = TRUE;
+ /* do not read the body only if the underlying protocol
+ * allows the body to be fetched separately */
+ if (ctl->server.base_protocol->fetch_body)
+ suppress_readbody = TRUE;
+ }
else if (err == PS_TRANSIENT)
+ {
suppress_delete = suppress_forward = TRUE;
+ if (ctl->server.base_protocol->fetch_body)
+ suppress_readbody = TRUE;
+ }
else if (err == PS_REFUSED)
+ {
suppress_forward = TRUE;
+ if (ctl->server.base_protocol->fetch_body)
+ suppress_readbody = TRUE;
+ }
#if 0
/*
* readheaders does not read the body when it
=======================================================================
Sunil Shetye.