Lines Matching +full:early +full:- +full:to +full:- +full:mid

2  * Copyright (c) 1998-2004, 2006, 2007 Proofpoint, Inc. and its suppliers.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
8 * By using this file, you agree to the terms and conditions set
18 SM_RCSID("@(#)$Id: headers.c,v 8.320 2013-11-22 20:51:55 ca Exp $")
26 ** SETUPHEADERS -- initialize headers in symbol table
41 for (hi = HdrInfo; hi->hi_field != NULL; hi++) in setupheaders()
43 s = stab(hi->hi_field, ST_HEADER, ST_ENTER); in setupheaders()
44 s->s_header.hi_flags = hi->hi_flags; in setupheaders()
45 s->s_header.hi_ruleset = NULL; in setupheaders()
50 ** DOCHOMPHEADER -- process and save a header line.
55 ** line -- header as a text line.
56 ** pflag -- flags for chompheader() (from sendmail.h)
57 ** hdrp -- a pointer to the place to save the header.
58 ** e -- the envelope including this header.
78 unsigned char mid = '\0'; local
94 hdrp = &e->e_header;
121 mid = (unsigned char) *p++;
139 mid = (unsigned char) macid(p);
140 if (bitset(0200, mid))
142 p += strlen(macname(mid)) + 2;
195 /* security scan: long field names are end-of-header */
199 /* check to see if it represents a ruleset call */
220 s->s_header.hi_ruleset != NULL)
224 s->s_header.hi_ruleset, p);
225 s->s_header.hi_ruleset = newstr(p);
227 s->s_header.hi_flags |= H_STRIPCOMM;
236 hi = &s->s_header;
246 hi->hi_flags,
247 hi->hi_ruleset == NULL ? "<NULL>"
248 : hi->hi_ruleset);
253 bitset(H_RESENT, hi->hi_flags))
254 e->e_flags |= EF_RESENT;
256 /* if this is an Errors-To: header keep track of it now */
258 bitset(H_ERRORSTO, hi->hi_flags))
259 (void) sendtolist(fvalue, NULLADDR, &e->e_errorqueue, 0, e);
262 if (!headeronly && bitset(H_EOH, hi->hi_flags))
263 return hi->hi_flags;
266 ** Horrible hack to work around problem with Lotus Notes SMTP
273 if (bitset(H_FROM, hi->hi_flags) && SingleLineFromHeader)
289 if (!bitset(hi->hi_flags, H_FROM|H_RCPT))
293 rs = hi->hi_ruleset;
299 rs = (&s->s_header)->hi_ruleset;
300 if (bitset((&s->s_header)->hi_flags,
305 else if (bitset(hi->hi_flags, H_STRIPCOMM))
317 /* - 3 to avoid problems with " at the end */
319 fvalue[k] != '\0' && l < sizeof(qval) - 3
320 && xlen < MAXNAME - 3;
359 ** in the EAI case: to get the "real" length
360 ** ilenx() would have to be applied to fvalue.
366 sm_syslog(LOG_WARNING, e->e_id,
370 macdefine(&e->e_macro, A_TEMP,
372 macdefine(&e->e_macro, A_TEMP,
376 macdefine(&e->e_macro, A_TEMP, macid("{hdrlen}"), qval);
377 if (bitset(H_FROM, hi->hi_flags))
378 macdefine(&e->e_macro, A_PERM,
380 else if (bitset(H_RCPT, hi->hi_flags))
381 macdefine(&e->e_macro, A_PERM,
384 macdefine(&e->e_macro, A_PERM,
387 NULL, e->e_id, NULL, NULL);
393 ** This is to make MH (which doesn't always give a full name)
398 p = "resent-from";
399 if (!bitset(EF_RESENT, e->e_flags))
402 !bitset(EF_QUEUERUN, e->e_flags) && SM_STRCASEEQ(fname, p))
404 if (e->e_from.q_paddr != NULL &&
405 e->e_from.q_mailer != NULL &&
406 bitnset(M_LOCALMAILER, e->e_from.q_mailer->m_flags) &&
407 (strcmp(fvalue, e->e_from.q_paddr) == 0 ||
408 strcmp(fvalue, e->e_from.q_user) == 0))
413 fvalue, e->e_from.q_paddr, e->e_from.q_user,
419 for (hp = hdrp; (h = *hp) != NULL; hp = &h->h_link)
421 if (SM_STRCASEEQ(fname, h->h_field) &&
422 !bitset(H_USER, h->h_flags) &&
423 !bitset(H_FORCE, h->h_flags))
427 /* user-supplied value was null */
433 h->h_flags |= H_USER;
436 ** If the MH hack is selected, allow to turn
437 ** it off via a mailer flag to avoid problems
443 e->e_from.q_mailer->m_flags))
445 h->h_flags &= ~H_CHECK;
447 return hi->hi_flags;
449 h->h_value = NULL;
453 memmove((char *) mopts, (char *) h->h_mflags,
456 h->h_macro = mid;
461 h = (HDR *) sm_rpool_malloc_tagged_x(e->e_rpool, sizeof(*h), "header",
463 h->h_field = sm_rpool_strdup_tagged_x(e->e_rpool, fname, "h_field",
465 h->h_value = sm_rpool_strdup_tagged_x(e->e_rpool, fvalue, "h_value",
467 h->h_link = NULL;
468 memmove((char *) h->h_mflags, (char *) mopts, sizeof(mopts));
469 h->h_macro = mid;
471 h->h_flags = hi->hi_flags;
473 h->h_flags |= H_USER;
477 h->h_flags &= ~H_EOH;
479 h->h_flags |= H_DEFAULT;
480 if (cond || mid != '\0')
481 h->h_flags |= H_CHECK;
483 /* hack to see if this is a new format message */
485 bitset(H_RCPT|H_FROM, h->h_flags) &&
489 e->e_flags &= ~EF_OLDSTYLE;
492 return h->h_flags;
496 ** CHOMPHEADER -- process and save a header line.
498 ** Called by collect, readcf, and readqf to deal with header lines.
502 ** line -- header as a text line.
503 ** pflag -- flags for chompheader() (from sendmail.h)
504 ** hdrp -- a pointer to the place to save the header.
505 ** e -- the envelope including this header.
557 ** ALLOCHEADER -- allocate a header entry
560 ** field -- the name of the header field (will not be copied).
561 ** value -- the value of the field (will be copied).
562 ** flags -- flags to add to h_flags.
563 ** rp -- resource pool for allocations
564 ** space -- add leading space?
567 ** Pointer to a newly allocated and populated HDR.
572 ** o maybe add more flags to decide:
573 ** - what to copy (field/value)
574 ** - whether to convert value to an internal format
593 h->h_field = field;
605 h->h_value = n;
608 h->h_value = sm_rpool_strdup_x(rp, value);
609 h->h_flags = flags;
611 h->h_flags |= s->s_header.hi_flags;
612 clrbitmap(h->h_mflags);
613 h->h_macro = '\0';
619 ** ADDHEADER -- add a header entry to the end of the queue.
624 ** field -- the name of the header field (will not be copied).
625 ** value -- the value of the field (will be copied).
626 ** flags -- flags to add to h_flags.
627 ** e -- envelope.
628 ** space -- add leading space?
650 HDR **hdrlist = &e->e_header;
652 /* find current place in list -- keep back pointer? */
653 for (hp = hdrlist; (h = *hp) != NULL; hp = &h->h_link)
655 if (SM_STRCASEEQ(field, h->h_field))
660 h = allocheader(field, value, flags, e->e_rpool, space);
661 h->h_link = *hp;
666 ** INSHEADER -- insert a header entry at the specified index
670 ** idx -- index into the header list at which to insert
671 ** field -- the name of the header field (will be copied).
672 ** value -- the value of the field (will be copied).
673 ** flags -- flags to add to h_flags.
674 ** e -- envelope.
675 ** space -- add leading space?
684 ** - field and value must be in internal format, i.e.,
686 ** - the header list contains headers that might not be
688 ** reliable way to insert a header at an exact position
704 h = allocheader(field, value, flags, e->e_rpool, space);
707 for (srch = e->e_header; srch != NULL && idx > 0;
708 srch = srch->h_link, idx--)
711 if (e->e_header == NULL)
713 e->e_header = h;
714 h->h_link = NULL;
719 last->h_link = h;
720 h->h_link = NULL;
724 h->h_link = srch->h_link;
725 srch->h_link = h;
730 ** HVALUE -- return value of a header.
736 ** field -- the field name.
737 ** header -- the header list.
740 ** pointer to the value part (internal format).
754 for (h = header; h != NULL; h = h->h_link)
756 if (!bitset(H_DEFAULT, h->h_flags) &&
757 SM_STRCASEEQ(h->h_field, field))
761 s = h->h_value;
773 ** ISHEADER -- predicate telling if argument is a header.
780 ** to make MIME work out. Without this we could have a technically
781 ** legal header such as ``--"foo:bar"'' that would also be a legal
785 ** h -- string to check for possible headerness.
802 if (s[0] == '-' && s[1] == '-')
819 ** EATHEADER -- run through the stored header and extract info.
822 ** e -- the envelope to process.
823 ** full -- if set, do full processing (e.g., compute
826 ** needed to compute the priority is wrong.
827 ** log -- call logsender()?
852 macdefine(&e->e_macro, A_PERM, 'f', e->e_sender);
853 macdefine(&e->e_macro, A_PERM, 'g', e->e_sender);
854 if (e->e_origrcpt != NULL && *e->e_origrcpt != '\0')
855 macdefine(&e->e_macro, A_PERM, 'u', e->e_origrcpt);
857 macdefine(&e->e_macro, A_PERM, 'u', NULL);
860 p = hvalue("full-name", e->e_header);
871 p = addquotes(p, e->e_rpool);
873 macdefine(&e->e_macro, A_PERM, 'x', p);
877 sm_dprintf("----- collected header -----\n");
878 e->e_msgid = NULL;
879 for (h = e->e_header; h != NULL; h = h->h_link)
882 sm_dprintf("%s:", h->h_field);
883 if (h->h_value == NULL)
890 /* do early binding */
891 if (bitset(H_DEFAULT, h->h_flags) &&
892 !bitset(H_BINDLATE, h->h_flags))
897 xputs(sm_debug_file(), h->h_value);
900 expand(h->h_value, buf, sizeof(buf), e);
904 if (bitset(H_FROM, h->h_flags))
907 h->h_value = sm_rpool_strdup_x(e->e_rpool, buf);
908 h->h_flags &= ~H_DEFAULT;
913 xputs(sm_debug_file(), h->h_value);
918 if (bitset(H_TRACE, h->h_flags))
921 /* send to this person if we so desire */
922 if (GrabTo && bitset(H_RCPT, h->h_flags) &&
923 !bitset(H_DEFAULT, h->h_flags) &&
924 (!bitset(EF_RESENT, e->e_flags) ||
925 bitset(H_RESENT, h->h_flags)))
928 int saveflags = e->e_flags;
931 (void) sendtolist(denlstring(h->h_value, true, false),
932 NULLADDR, &e->e_sendqueue, 0, e);
942 e->e_flags &= ~EF_FATALERRS;
946 /* save the message-id for logging */
947 p = "resent-message-id";
948 if (!bitset(EF_RESENT, e->e_flags))
950 if (SM_STRCASEEQ(h->h_field, p))
952 e->e_msgid = h->h_value;
953 while (SM_ISSPACE(*e->e_msgid))
954 e->e_msgid++;
955 macdefine(&e->e_macro, A_PERM, macid("{msg_id}"),
956 e->e_msgid);
960 sm_dprintf("----------------------------\n");
962 /* if we are just verifying (that is, sendmail -t -bv), drop out now */
967 if (hopcnt > e->e_hopcount)
969 e->e_hopcount = hopcnt;
970 (void) sm_snprintf(buf, sizeof(buf), "%d", e->e_hopcount);
971 macdefine(&e->e_macro, A_TEMP, 'c', buf);
975 p = hvalue("precedence", e->e_header);
977 e->e_class = priencode(p);
978 if (e->e_class < 0)
979 e->e_timeoutclass = TOC_NONURGENT;
980 else if (e->e_class > 0)
981 e->e_timeoutclass = TOC_URGENT;
984 e->e_msgpriority = e->e_msgsize
985 - e->e_class * WkClassFact
986 + e->e_nrcpts * WkRecipFact;
989 /* check for DSN to properly set e_timeoutclass */
990 p = hvalue("content-type", e->e_header);
1012 /* Look for report-type=delivery-status */
1015 /* skip to semicolon separator */
1023 /* look for report-type */
1024 if (!SM_STRCASEEQ(*pvp++, "report-type"))
1033 SM_STRCASEEQ(*pvp, "delivery-status"))
1034 e->e_timeoutclass = TOC_DSN;
1036 /* found report-type, no need to continue */
1043 p = hvalue("priority", e->e_header);
1048 e->e_timeoutclass = TOC_URGENT;
1050 e->e_timeoutclass = TOC_NORMAL;
1051 else if (SM_STRCASEEQ(p, "non-urgent"))
1052 e->e_timeoutclass = TOC_NONURGENT;
1053 else if (bitset(EF_RESPONSE, e->e_flags))
1054 e->e_timeoutclass = TOC_DSN;
1056 else if (bitset(EF_RESPONSE, e->e_flags))
1057 e->e_timeoutclass = TOC_DSN;
1060 p = hvalue("posted-date", e->e_header);
1062 p = hvalue("date", e->e_header);
1064 macdefine(&e->e_macro, A_PERM, 'a', p);
1066 /* check to see if this is a MIME message */
1067 if ((e->e_bodytype != NULL &&
1068 SM_STRCASEEQ(e->e_bodytype, "8bitmime")) ||
1069 hvalue("MIME-Version", e->e_header) != NULL)
1071 e->e_flags |= EF_IS_MIME;
1073 e->e_bodytype = "8BITMIME";
1075 else if ((p = hvalue("Content-Type", e->e_header)) != NULL)
1082 e->e_flags |= EF_DONT_MIME;
1088 ** required by UK Grey Book e-mail gateways (sigh)
1095 for (hi = HdrInfo; hi->hi_field != NULL; hi++)
1097 if (bitset(H_FROM, hi->hi_flags) &&
1098 (!bitset(H_RESENT, hi->hi_flags) ||
1099 bitset(EF_RESENT, e->e_flags)) &&
1100 (p = hvalue(hi->hi_field, e->e_header)) != NULL)
1103 if (hi->hi_field != NULL)
1107 hi->hi_field, p);
1118 e->e_id, bitset(EF_LOGSENDER, e->e_flags), LogLevel,
1120 if (log && bitset(EF_LOGSENDER, e->e_flags) && LogLevel > 4)
1122 logsender(e, e->e_msgid);
1123 e->e_flags &= ~EF_LOGSENDER;
1128 ** LOGSENDER -- log sender information
1131 ** e -- the envelope to log
1132 ** msgid -- the message id
1152 /* 850 - 100 for original MSGIDLOGLEN */
1174 char hbuf[MAXNAME + 1]; /* EAI:ok; restricted to short size */
1181 if (bitset(EF_RESPONSE, e->e_flags))
1205 if (NULL != e->e_from.q_paddr)
1207 xstr = e->e_from.q_paddr;
1209 (void) dequote_internal_chars(e->e_from.q_paddr, xbuf, sizeof(xbuf));
1217 PRT_NONNEGL(e->e_msgsize), e->e_class, e->e_nrcpts);
1229 if (e->e_bodytype != NULL)
1232 ", bodytype=%.20s", e->e_bodytype);
1259 sm_syslog(LOG_INFO, e->e_id, "%.*s, relay=%s", FIRSTLOGLEN, sbuf, name);
1263 sm_syslog(LOG_INFO, e->e_id,
1265 e->e_from.q_paddr == NULL ? "<NONE>"
1266 : shortenstring(e->e_from.q_paddr,
1268 sm_syslog(LOG_INFO, e->e_id,
1270 PRT_NONNEGL(e->e_msgsize), e->e_class, e->e_nrcpts);
1277 sm_syslog(LOG_INFO, e->e_id,
1283 if (e->e_bodytype != NULL)
1286 "bodytype=%.20s, ", e->e_bodytype);
1296 sm_syslog(LOG_INFO, e->e_id,
1302 ** PRIENCODE -- encode external priority names into internal values.
1305 ** p -- priority in ascii.
1331 ** CRACKADDR -- parse an address and turn it into a macro
1333 ** This doesn't actually parse the address -- it just extracts
1335 ** and isn't even guaranteed to leave something syntactically
1336 ** identical to what it started with. However, it does leave
1341 ** to "Real Name <$g> (Comment)".
1343 ** This algorithm has been cleaned up to handle a wider range
1344 ** of cases -- notably quoted and backslash escaped strings.
1349 ** addr -- the address to be cracked. [A]
1350 ** e -- the current envelope.
1353 ** a pointer to the new version.
1360 ** be copied if it is to be reused.
1371 ** Append a character to bp if we have room.
1405 bool quoteit = false; /* need to quote next character */
1419 buflim = bufend = &buf[sizeof(buf) - 1];
1443 ** Try to keep legal syntax using spare buffer space
1453 /* arrange to quote the address */
1460 p--;
1475 buflim--;
1493 buflim--;
1507 cmtlev--;
1508 copylev--;
1511 realcmtlev--;
1521 bp--;
1528 bracklev--;
1564 --p;
1566 isascii(*--p) && isspace(*p))
1580 bp--;
1604 /* check for characters that may have to be quoted */
1610 ** quoted, they will have to be quoted. Note that
1628 /* oops -- have to change our mind */
1633 buflim--;
1643 --p;
1645 isascii(*--p) && isspace(*p))
1663 bp--;
1679 anglelev--;
1691 bp--;
1704 if (bp > buf && bp[-1] == ')')
1715 while (realcmtlev-- > 0 && bp < bufend)
1730 sm_syslog(LOG_ALERT, e->e_id,
1744 ** PUTHEADER -- put the header part of a message from the in-core copy
1747 ** mci -- the connection information.
1748 ** hdr -- the header to put.
1749 ** e -- envelope to use.
1750 ** flags -- MIME conversion flags.
1771 sm_dprintf("--- putheader, mailer = %s ---\n",
1772 mci->mci_mailer->m_name);
1780 if (!bitset(MCIF_INMIME, mci->mci_flags))
1781 mci->mci_flags |= MCIF_INHEADER;
1783 for (h = hdr; h != NULL; h = h->h_link)
1785 register char *p = h->h_value;
1790 sm_dprintf(" %s:", h->h_field);
1801 /* heuristic shortening of MIME fields to avoid MUA overflows */
1803 wordinclass(h->h_field,
1811 sm_syslog(LOG_ALERT, e->e_id,
1812 "Truncated MIME %s header due to field size (length = %ld) (possible attack)",
1813 h->h_field, (unsigned long) len);
1815 sm_dprintf(" truncated MIME %s header due to field size (length = %ld) (possible attack)\n",
1816 h->h_field,
1822 wordinclass(h->h_field,
1830 h->h_value[MaxMimeHeaderLength - 1] = '\0';
1831 sm_syslog(LOG_ALERT, e->e_id,
1833 h->h_field, (unsigned long) len);
1836 h->h_field,
1842 wordinclass(h->h_field,
1847 len = strlen(h->h_value);
1848 if (shorten_rfc822_string(h->h_value,
1854 sm_syslog(LOG_ALERT, e->e_id,
1856 h->h_field);
1859 h->h_field);
1864 sm_syslog(LOG_ALERT, e->e_id,
1866 h->h_field,
1870 h->h_field,
1877 ** Suppress Content-Transfer-Encoding: if we are MIMEing
1878 ** and we are potentially converting from 8 bit to 7 bit
1883 if (bitset(H_CTE, h->h_flags) &&
1885 mci->mci_flags) &&
1889 sm_dprintf(" (skipped (content-transfer-encoding))\n");
1893 if (bitset(MCIF_INMIME, mci->mci_flags))
1902 if (bitset(H_CHECK|H_ACHECK, h->h_flags) &&
1903 !bitintersect(h->h_mflags, mci->mci_mailer->m_flags) &&
1904 (h->h_macro == '\0' ||
1905 (q = macvalue(bitidx(h->h_macro), e)) == NULL ||
1913 /* handle Resent-... headers specially */
1914 if (bitset(H_RESENT, h->h_flags) && !bitset(EF_RESENT, e->e_flags))
1922 if (bitset(H_RECEIPTTO, h->h_flags) &&
1923 (RrtImpliesDsn || bitset(EF_NORECEIPT, e->e_flags)))
1931 if (bitset(H_DEFAULT, h->h_flags) ||
1932 bitset(H_BINDLATE, h->h_flags))
1939 sm_dprintf(" (skipped -- null value)\n");
1944 if (bitset(H_BCC, h->h_flags) && !KeepBcc)
1946 /* Bcc: field -- either truncate or delete */
1947 if (bitset(EF_DELETE_BCC, e->e_flags))
1950 sm_dprintf(" (skipped -- bcc)\n");
1956 h->h_field, ":");
1966 if (bitset(H_FROM|H_RCPT, h->h_flags))
1969 bool oldstyle = bitset(EF_OLDSTYLE, e->e_flags);
1971 if (bitset(H_FROM, h->h_flags))
1975 && bitnset(M_xSMTP, mci->mci_mailer->m_flags))
1986 ** If we are converting this to a MIME message, add the
1992 bitset(EF_HAS8BIT, e->e_flags) &&
1993 !bitset(EF_DONT_MIME, e->e_flags) &&
1994 !bitnset(M_8BITS, mci->mci_mailer->m_flags) &&
1995 !bitset(MCIF_CVT8TO7|MCIF_CVT7TO8|MCIF_INMIME, mci->mci_flags) &&
1996 hvalue("MIME-Version", e->e_header) == NULL)
1998 if (!putline("MIME-Version: 1.0", mci))
2000 if (hvalue("Content-Type", e->e_header) == NULL)
2003 "Content-Type: text/plain; charset=%s",
2008 if (hvalue("Content-Transfer-Encoding", e->e_header) == NULL
2009 && !putline("Content-Transfer-Encoding: 8bit", mci))
2020 ** PUT_VANILLA_HEADER -- output a fairly ordinary header
2023 ** h -- the structure describing this header
2024 ** v -- the value of this header
2025 ** mci -- the connection info for output
2043 if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags))
2045 (void) sm_snprintf(obuf, sizeof(obuf), "%.200s:", h->h_field);
2051 l = nlp - v;
2058 if (SPACELEFT(obuf, obp) - 1 < (size_t) l)
2059 l = SPACELEFT(obuf, obp) - 1;
2072 (int) (SPACELEFT(obuf, obp) - 1), v);
2080 ** COMMAIZE -- output a header field, making a comma-translated list.
2083 ** h -- the header field to output.
2084 ** p -- the value to put in it.
2085 ** oldstyle -- true if this is an old style header.
2086 ** mci -- the connection information.
2087 ** e -- the envelope containing the message.
2088 ** putflags -- flags for putxline()
2094 ** outputs "p" to "mci".
2118 sm_dprintf("commaize(%s:%s)\n", h->h_field, p);
2120 if (bitnset(M_7BITHDRS, mci->mci_mailer->m_flags))
2125 if (bitset(H_FROM, h->h_flags) && bitset(H_ASIS, h->h_flags))
2127 (void) sm_snprintf(obuf, sizeof(obuf), "%.200s:%s", h->h_field,
2128 h->h_value);
2134 (void) sm_snprintf(obp, SPACELEFT(obuf, obp), "%.200s:", h->h_field);
2136 opos = strlen(h->h_field) + 1;
2152 ** Restrict number of spaces to half the length of buffer
2166 omax = mci->mci_mailer->m_linelimit - 2;
2186 ** necessarily delimit an old-style name -- at
2212 /* look to see if we have an at sign */
2230 p--;
2241 --p;
2245 /* translate the name to be relative */
2247 if (bitset(H_FROM, h->h_flags))
2250 else if (e->e_from.q_mailer != NULL &&
2251 bitnset(M_UDBRECIPIENT, e->e_from.q_mailer->m_flags))
2255 q = udbsender(name, e->e_rpool);
2261 name = remotename(name, mci->mci_mailer, flags, &status, e);
2262 if (status != EX_OK && bitnset(M_xSMTP, mci->mci_mailer->m_flags))
2265 mci->mci_flags |= MCIF_NOTSTICKY;
2304 obuf[sizeof(obuf) - 1] = '\0';
2312 ** COPYHEADER -- copy header list
2317 ** header -- list of header structures to copy.
2318 ** rpool -- resource pool, or NULL
2341 tail = &newhdr->h_link;
2342 header = header->h_link;
2350 ** FIX_MIME_HEADER -- possibly truncate/rebalance parameters in a MIME header
2354 ** to MaxMimeFieldLength.
2357 ** h -- the header to truncate/rebalance
2358 ** e -- the current envelope
2372 char *begin = h->h_value;
2397 sm_syslog(LOG_ALERT, e->e_id,
2399 h->h_field);
2402 h->h_field);
2420 /* copy character by character due to overlap */