diff options
author | peter <peter@FreeBSD.org> | 1999-02-07 09:40:41 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-02-07 09:40:41 +0000 |
commit | 19c8fca2df7a6f39e5208229f428ec269fb3adbf (patch) | |
tree | 880a7cd01e2b6a0483601535c1a4c1b63a131b51 /contrib/sendmail/src/headers.c | |
parent | d7ac03c10c41129058bfcad4473d778394642703 (diff) | |
download | FreeBSD-src-19c8fca2df7a6f39e5208229f428ec269fb3adbf.zip FreeBSD-src-19c8fca2df7a6f39e5208229f428ec269fb3adbf.tar.gz |
Import sendmail 8.9.3 onto vendor branch, replacing previous interim
8.9.2 + patches version.
Obtained from: ftp.sendmail.org
Diffstat (limited to 'contrib/sendmail/src/headers.c')
-rw-r--r-- | contrib/sendmail/src/headers.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/contrib/sendmail/src/headers.c b/contrib/sendmail/src/headers.c index fcf1d9c..6c43dcb 100644 --- a/contrib/sendmail/src/headers.c +++ b/contrib/sendmail/src/headers.c @@ -11,7 +11,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)headers.c 8.134 (Berkeley) 11/29/1998"; +static char sccsid[] = "@(#)headers.c 8.136 (Berkeley) 1/26/1999"; #endif /* not lint */ # include <errno.h> @@ -77,6 +77,7 @@ chompheader(line, def, hdrp, e) bool headeronly; STAB *s; struct hdrinfo *hi; + bool nullheader = FALSE; BITMAP mopts; if (tTd(31, 6)) @@ -123,11 +124,17 @@ chompheader(line, def, hdrp, e) return 0; } *fvalue = '\0'; - fvalue = p; /* strip field value on front */ - if (*fvalue == ' ') - fvalue++; + if (*p == ' ') + p++; + fvalue = p; + + /* if the field is null, go ahead and use the default */ + while (isascii(*p) && isspace(*p)) + p++; + if (*p == '\0') + nullheader = TRUE; /* security scan: long field names are end-of-header */ if (strlen(fname) > 100) @@ -236,6 +243,11 @@ chompheader(line, def, hdrp, e) bitset(H_DEFAULT, h->h_flags) && !bitset(H_FORCE, h->h_flags)) { + if (nullheader) + { + /* user-supplied value was null */ + return 0; + } h->h_value = NULL; if (!cond) { @@ -1149,6 +1161,7 @@ crackaddr(addr) ** mci -- the connection information. ** h -- the header to put. ** e -- envelope to use. +** flags -- MIME conversion flags. ** ** Returns: ** none. @@ -1165,10 +1178,11 @@ crackaddr(addr) #endif void -putheader(mci, hdr, e) +putheader(mci, hdr, e, flags) register MCI *mci; HDR *hdr; register ENVELOPE *e; + int flags; { register HDR *h; char buf[MAX(MAXLINE,BUFSIZ)]; @@ -1251,9 +1265,16 @@ putheader(mci, hdr, e) } #endif - /* suppress Content-Transfer-Encoding: if we are MIMEing */ + /* + ** Suppress Content-Transfer-Encoding: if we are MIMEing + ** and we are potentially converting from 8 bit to 7 bit + ** MIME. If converting, add a new CTE header in + ** mime8to7(). + */ if (bitset(H_CTE, h->h_flags) && - bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags)) + bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, + mci->mci_flags) && + !bitset(M87F_NO8TO7, flags)) { if (tTd(34, 11)) printf(" (skipped (content-transfer-encoding))\n"); |