fetchmail-friends
[Top] [All Lists]

Re: [fetchmail] Re: Incorrect headers (again, but this time with more debug info)

2003-05-21 00:54:50
On Tue, 2003-05-20 at 10:24, Sunil Shetye wrote:

There is no delimiter line between headers and body. This is causing
the 'incorrect header' message.

My guess is that your pop3 server is sending just '.\n' as the mail
delimiter line. fetchmail is currently searching only for '.\r\n'.
Thus, fetchmail is waiting for more data and eventually times out.
Please try the following patch:

I tried your patch but I still have the same error. After inspecting the
code and using "everyones favorite debugging tool" (aka printf) I have
the following observations:
* The headers is fetched and readheaders returns PS_RETAINED, but the
error handling code in fetch_messages (driver.c) never sets
suppress_readbody, thus readbody will be called.
* The first time SockRead is called in readbody, -1 is returned and
fetchmail exits as no more data is available on the socket.

I tried to always set suppress_readbody when readheaders returns
PS_RETAINED as seen in the following patch:
--
-- fetchmail-6.2.2/driver.c    2003-02-28 11:53:57.000000000 +0100
+++ fetchmail-frank/driver.c    2003-05-21 08:45:13.000000000 +0200
@@ -515,8 +515,9 @@
                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;
+               //Try to always set suppress_readbody:
+               //if (ctl->server.base_protocol->fetch_body)
+               suppress_readbody = TRUE;
            }
            else if (err == PS_TRANSIENT)
            {
--
Doing this the other mails where fetched, but they did not seem to be
deleted, i.e. I downloaded all the messages but the corrupt one. The
next time I ran fetchmail, all mails where downloaded once more.

Please let me know if there are any more debugging I can do for you.
Unfortunately I do not have ftp access to the mail server so I can not
download the raw message.

Best regards

-- 

Frank A Ekern <list-account(_at_)ekern(_dot_)no>