Your message dated Mon, 11 Dec 2006 16:55:10 +0100
with message-id <[EMAIL PROTECTED]>
has caused the Debian Bug report #312164,
regarding feature greet_pause produces false positives on empty connections
to be marked as having been forwarded to the upstream software
author(s) [EMAIL PROTECTED]
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
tag 312164 patch
stop
Hello,
As discussed earlier on comp.mail.sendmail [1], the greet_pause code
produces false positives for connections immediately closed by the
client. I.e. Sendmail logs
rejecting commands from X due to pre-greeting traffic
when it would be expected to log
X did not issue MAIL/EXPN/VRFY/ETRN during connection to stdin
One way of fixing this while preserving the existing I/O layering is to
check whether sm_io_getc() returns EOF, and, if not, to undo it with
sm_io_ungetc(). Patch for 8.13.8 below.
[1] <http://google.com/group/comp.mail.sendmail/msg/224f3a9253c21e88>
Thanks,
Matej
--- sendmail-8.13.8~/sendmail/srvrsmtp.c
+++ sendmail-8.13.8/sendmail/srvrsmtp.c
@@ -936,6 +936,7 @@
#if _FFR_LOG_GREET_PAUSE
struct timeval bp, ep, tp; /* {begin,end,total}pause */
#endif /* _FFR_LOG_GREET_PAUSE */
+ int eoftest;
/* pause for a moment */
timeout.tv_sec = msecs / 1000;
@@ -957,8 +958,10 @@
#endif /* _FFR_LOG_GREET_PAUSE */
if (select(fd + 1, FDSET_CAST &readfds,
NULL, NULL, &timeout) > 0 &&
- FD_ISSET(fd, &readfds))
+ FD_ISSET(fd, &readfds) &&
+ (eoftest = sm_io_getc(InChannel, SM_TIME_DEFAULT))
!= SM_IO_EOF)
{
+ sm_io_ungetc(InChannel, SM_TIME_DEFAULT,
eoftest);
#if _FFR_LOG_GREET_PAUSE
gettimeofday(&ep, NULL);
timersub(&ep, &bp, &tp);
--- End Message ---