diff options
author | peter <peter@FreeBSD.org> | 1995-11-20 23:32:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-11-20 23:32:21 +0000 |
commit | fffd71d4c49dfb70e69f1eaf9606566b5baab25a (patch) | |
tree | 3858aa025c2a42d22bcd71bfd00771f238940433 /usr.sbin | |
parent | 2827d00525b22d9e0509e6683a5bf42b84582b98 (diff) | |
download | FreeBSD-src-fffd71d4c49dfb70e69f1eaf9606566b5baab25a.zip FreeBSD-src-fffd71d4c49dfb70e69f1eaf9606566b5baab25a.tar.gz |
If sendmail is collecting a message *not* via SMTP, then this patch will
turn off the read data block timeouts. This was inspired by the same fix
in sendmail-8.7, but the code in this area is somewhat different. (8.7
is much more sensible). This will stop the infamous
"timeout waiting for input during message body read" on long running jobs,
eg: /etc/daily | mail root.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/sendmail/src/collect.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/sendmail/src/collect.c b/usr.sbin/sendmail/src/collect.c index b77f6e9..29546ce 100644 --- a/usr.sbin/sendmail/src/collect.c +++ b/usr.sbin/sendmail/src/collect.c @@ -73,6 +73,7 @@ collect(smtpmode, requeueflag, e) { register FILE *tf; bool ignrdot = smtpmode ? FALSE : IgnrDot; + time_t dbto = smtpmode ? TimeOuts.to_datablock : 0; char buf[MAXLINE], buf2[MAXLINE]; register char *workbuf, *freebuf; bool inputerr = FALSE; @@ -103,13 +104,13 @@ collect(smtpmode, requeueflag, e) message("354 Enter mail, end with \".\" on a line by itself"); /* set global timer to monitor progress */ - sfgetset(TimeOuts.to_datablock); + sfgetset(dbto); /* ** Try to read a UNIX-style From line */ - if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock, + if (sfgets(buf, MAXLINE, InChannel, dbto, "initial message read") == NULL) goto readerr; fixcrlf(buf, FALSE); @@ -119,7 +120,7 @@ collect(smtpmode, requeueflag, e) if (!flusheol(buf, InChannel)) goto readerr; eatfrom(buf, e); - if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock, + if (sfgets(buf, MAXLINE, InChannel, dbto, "message header read") == NULL) goto readerr; fixcrlf(buf, FALSE); @@ -166,8 +167,7 @@ collect(smtpmode, requeueflag, e) { int clen; - if (sfgets(freebuf, MAXLINE, InChannel, - TimeOuts.to_datablock, + if (sfgets(freebuf, MAXLINE, InChannel, dbto, "message header read") == NULL) { freebuf[0] = '\0'; @@ -247,7 +247,7 @@ collect(smtpmode, requeueflag, e) if (*workbuf == '\0') { /* throw away a blank line */ - if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock, + if (sfgets(buf, MAXLINE, InChannel, dbto, "message separator read") == NULL) goto readerr; } @@ -283,7 +283,7 @@ collect(smtpmode, requeueflag, e) fputs("\n", tf); if (ferror(tf)) tferror(tf, e); - if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock, + if (sfgets(buf, MAXLINE, InChannel, dbto, "message body read") == NULL) goto readerr; } |