fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]loosing messages

2004-12-02 17:05:45
"Reinhard Haller" <reinhard(_dot_)haller(_at_)interactive-net(_dot_)de> writes:

I suspect a TCP handling error in fetchmail 6.2.5_2
on FreeBSD 4.10.


[...]

It starts with the end of the transmission of a large mail (approx 7.5
M).  At 09:34:33.563671 my system acks the last data packet. The virus
checker takes a little bit longer on this message and finishes his
work at 09:36:49 and now comes also the SMTP session to an end.
Fetchmail is flushing the message (DELE 1), but has ignored the TCP
end-of-session request for more than a minute, which is a little bit
to long for the POP server.

After that the POP session ends and all other messages on the pop
server are marked as "seen". Specifying "fetchall" in fetchmailrc
leads to a never ending fetch of the big mail.

Does this patch improve the situation?

Index: transact.c
===================================================================
--- transact.c  (Revision 4014)
+++ transact.c  (Arbeitskopie)
@@ -1503,7 +1503,10 @@
     va_end(ap);
 
     snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "\r\n");
-    SockWrite(sock, buf, strlen(buf));
+    if (SockWrite(sock, buf, strlen(buf)) < strlen(buf)) {
+       /* short write, bail out */
+       return PS_SOCKET;
+    }
 
     if (outlevel >= O_MONITOR)
     {


-- 
Matthias Andree


<Prev in Thread] Current Thread [Next in Thread>