headers.c (1a0fda2b547365c9453523592a445dfe21266d4b) headers.c (ba00ec3d539f213abbda3a45ef8c539306cac098)
1/*
2 * Copyright (c) 1998-2004, 2006, 2007 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15#include <sm/sendmail.h>
16
1/*
2 * Copyright (c) 1998-2004, 2006, 2007 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15#include <sm/sendmail.h>
16
17SM_RCSID("@(#)$Id: headers.c,v 8.317 2008/08/27 20:11:55 gshapiro Exp $")
17SM_RCSID("@(#)$Id: headers.c,v 8.318 2012/06/14 23:54:02 ca Exp $")
18
19static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *, bool));
20static size_t fix_mime_header __P((HDR *, ENVELOPE *));
21static int priencode __P((char *));
22static bool put_vanilla_header __P((HDR *, char *, MCI *));
23
24/*
25** SETUPHEADERS -- initialize headers in symbol table

--- 1121 unchanged lines hidden (view full) ---

1147 }
1148
1149 /* some versions of syslog only take 5 printf args */
1150#if (SYSLOG_BUFSIZE) >= 256
1151 sbp = sbuf;
1152 (void) sm_snprintf(sbp, SPACELEFT(sbuf, sbp),
1153 "from=%.200s, size=%ld, class=%d, nrcpts=%d",
1154 e->e_from.q_paddr == NULL ? "<NONE>" : e->e_from.q_paddr,
18
19static HDR *allocheader __P((char *, char *, int, SM_RPOOL_T *, bool));
20static size_t fix_mime_header __P((HDR *, ENVELOPE *));
21static int priencode __P((char *));
22static bool put_vanilla_header __P((HDR *, char *, MCI *));
23
24/*
25** SETUPHEADERS -- initialize headers in symbol table

--- 1121 unchanged lines hidden (view full) ---

1147 }
1148
1149 /* some versions of syslog only take 5 printf args */
1150#if (SYSLOG_BUFSIZE) >= 256
1151 sbp = sbuf;
1152 (void) sm_snprintf(sbp, SPACELEFT(sbuf, sbp),
1153 "from=%.200s, size=%ld, class=%d, nrcpts=%d",
1154 e->e_from.q_paddr == NULL ? "<NONE>" : e->e_from.q_paddr,
1155 e->e_msgsize, e->e_class, e->e_nrcpts);
1155 PRT_NONNEGL(e->e_msgsize), e->e_class, e->e_nrcpts);
1156 sbp += strlen(sbp);
1157 if (msgid != NULL)
1158 {
1159 (void) sm_snprintf(sbp, SPACELEFT(sbuf, sbp),
1160 ", msgid=%.100s", mbuf);
1161 sbp += strlen(sbp);
1162 }
1163 if (e->e_bodytype != NULL)

--- 22 unchanged lines hidden (view full) ---

1186
1187 sm_syslog(LOG_INFO, e->e_id,
1188 "from=%s",
1189 e->e_from.q_paddr == NULL ? "<NONE>"
1190 : shortenstring(e->e_from.q_paddr,
1191 83));
1192 sm_syslog(LOG_INFO, e->e_id,
1193 "size=%ld, class=%ld, nrcpts=%d",
1156 sbp += strlen(sbp);
1157 if (msgid != NULL)
1158 {
1159 (void) sm_snprintf(sbp, SPACELEFT(sbuf, sbp),
1160 ", msgid=%.100s", mbuf);
1161 sbp += strlen(sbp);
1162 }
1163 if (e->e_bodytype != NULL)

--- 22 unchanged lines hidden (view full) ---

1186
1187 sm_syslog(LOG_INFO, e->e_id,
1188 "from=%s",
1189 e->e_from.q_paddr == NULL ? "<NONE>"
1190 : shortenstring(e->e_from.q_paddr,
1191 83));
1192 sm_syslog(LOG_INFO, e->e_id,
1193 "size=%ld, class=%ld, nrcpts=%d",
1194 e->e_msgsize, e->e_class, e->e_nrcpts);
1194 PRT_NONNEGL(e->e_msgsize), e->e_class, e->e_nrcpts);
1195 if (msgid != NULL)
1196 sm_syslog(LOG_INFO, e->e_id,
1197 "msgid=%s",
1198 shortenstring(mbuf, 83));
1199 sbp = sbuf;
1200 *sbp = '\0';
1201 if (e->e_bodytype != NULL)
1202 {

--- 1122 unchanged lines hidden ---
1195 if (msgid != NULL)
1196 sm_syslog(LOG_INFO, e->e_id,
1197 "msgid=%s",
1198 shortenstring(mbuf, 83));
1199 sbp = sbuf;
1200 *sbp = '\0';
1201 if (e->e_bodytype != NULL)
1202 {

--- 1122 unchanged lines hidden ---