Sam Varshavchik wrote:
Bowie Bailey writes:
Here is a second try. This time I monitored the maillog and made
sure not to close the trace file before the error was logged. It
took a while, but it finally logged the error.
The message I am working with is 00138028.4497F75D.00003DEB. In
this trace, it was processed by pid 422.
Ok, that helps. The remote server is timing out:
422 select(8, [], [7], NULL, {300, 0} <unfinished …>
422 <... select resumed> ) = 0 (Timeout)
422 close(7) = 0
422 close(-1) = -1 EBADF (Bad file
descriptor)
The timeout occurs first, but the redundant close, that follows,
breaks error reporting.
With the following fix you will now get a proper "Connection timed
out" error message.
diff -U3 -r1.49 esmtpclient.c
--- courier/module.esmtp/esmtpclient.c 23 Jan 2006 23:22:10 -0000
1.49
+++ courier/module.esmtp/esmtpclient.c 20 Jun 2006 22:31:48 -0000
@@ -968,13 +968,15 @@
if (wait_write())
{
- sox_close(sockfd);
+ if (sockfd >= 0)
+ sox_close(sockfd);
sockfd= -1;
return;
}
if ((n=sox_write(sockfd, writebuf, writebufptr-writebuf)) <= 0)
{
- sox_close(sockfd);
+ if (sockfd >= 0)
+ sox_close(sockfd);
sockfd= -1;
return;
}
This patch did the trick. I haven't seen any more "Bad file
descriptor" errors logged since installing it.
Thanks for the help!