diff options
Diffstat (limited to 'contrib/sendmail/src/envelope.c')
-rw-r--r-- | contrib/sendmail/src/envelope.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/contrib/sendmail/src/envelope.c b/contrib/sendmail/src/envelope.c index 50009a4..a607a15 100644 --- a/contrib/sendmail/src/envelope.c +++ b/contrib/sendmail/src/envelope.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2003, 2006 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: envelope.c,v 8.296 2006/03/31 18:53:50 ca Exp $") +SM_RCSID("@(#)$Id: envelope.c,v 8.302 2006/11/10 23:12:52 ca Exp $") /* ** CLRSESSENVELOPE -- clear session oriented data in an envelope @@ -75,9 +75,7 @@ newenvelope(e, parent, rpool) register ENVELOPE *parent; SM_RPOOL_T *rpool; { -#if _FFR_DM_PER_DAEMON - int sendmode; -#endif /* _FFR_DM_PER_DAEMON */ + int sendmode; /* ** This code used to read: @@ -88,12 +86,10 @@ newenvelope(e, parent, rpool) ** This meant macvalue() could go into an infinite loop. */ -#if _FFR_DM_PER_DAEMON if (parent != NULL) sendmode = parent->e_sendmode; else sendmode = DM_NOTSET; -#endif /* _FFR_DM_PER_DAEMON */ if (e == parent) parent = e->e_parent; @@ -101,11 +97,11 @@ newenvelope(e, parent, rpool) if (e == CurEnv) memmove((char *) &e->e_from, (char *) &NullAddress, - sizeof e->e_from); + sizeof(e->e_from)); else memmove((char *) &e->e_from, (char *) &CurEnv->e_from, - sizeof e->e_from); + sizeof(e->e_from)); e->e_parent = parent; assign_queueid(e); e->e_ctime = curtime(); @@ -130,10 +126,8 @@ newenvelope(e, parent, rpool) e->e_putbody = putbody; if (CurEnv->e_xfp != NULL) (void) sm_io_flush(CurEnv->e_xfp, SM_TIME_DEFAULT); -#if _FFR_DM_PER_DAEMON if (sendmode != DM_NOTSET) e->e_sendmode = sendmode; -#endif /* _FFR_DM_PER_DAEMON */ return e; } @@ -289,13 +283,13 @@ dropenvelope(e, fulldrop, split) { if (msg_timeout == MSG_NOT_BY) { - (void) sm_snprintf(buf, sizeof buf, + (void) sm_snprintf(buf, sizeof(buf), "delivery time expired %lds", e->e_deliver_by); } else { - (void) sm_snprintf(buf, sizeof buf, + (void) sm_snprintf(buf, sizeof(buf), "Cannot send message for %s", pintvl(TimeOuts.to_q_return[e->e_timeoutclass], false)); @@ -387,12 +381,12 @@ dropenvelope(e, fulldrop, split) { if (msg_timeout == MSG_WARN_BY) { - (void) sm_snprintf(buf, sizeof buf, + (void) sm_snprintf(buf, sizeof(buf), "Warning: Delivery time (%lds) exceeded", e->e_deliver_by); } else - (void) sm_snprintf(buf, sizeof buf, + (void) sm_snprintf(buf, sizeof(buf), "Warning: could not send message for past %s", pintvl(TimeOuts.to_q_warning[e->e_timeoutclass], false)); @@ -488,7 +482,7 @@ dropenvelope(e, fulldrop, split) if (failure_return) { - expand(PostMasterCopy, pcopy, sizeof pcopy, e); + expand(PostMasterCopy, pcopy, sizeof(pcopy), e); if (tTd(50, 8)) sm_dprintf("dropenvelope(%s): sending postmaster copy to %s\n", @@ -706,8 +700,8 @@ clearenvelope(e, fullclear, rpool) nhp = &e->e_header; while (bh != NULL) { - *nhp = (HDR *) sm_rpool_malloc_x(rpool, sizeof *bh); - memmove((char *) *nhp, (char *) bh, sizeof *bh); + *nhp = (HDR *) sm_rpool_malloc_x(rpool, sizeof(*bh)); + memmove((char *) *nhp, (char *) bh, sizeof(*bh)); bh = bh->h_link; nhp = &(*nhp)->h_link; } @@ -766,11 +760,11 @@ initsys(e) */ /* process id */ - (void) sm_snprintf(buf, sizeof buf, "%d", (int) CurrentPid); + (void) sm_snprintf(buf, sizeof(buf), "%d", (int) CurrentPid); macdefine(&e->e_macro, A_TEMP, 'p', buf); /* hop count */ - (void) sm_snprintf(buf, sizeof buf, "%d", e->e_hopcount); + (void) sm_snprintf(buf, sizeof(buf), "%d", e->e_hopcount); macdefine(&e->e_macro, A_TEMP, 'c', buf); /* time as integer, unix time, arpa time */ @@ -788,7 +782,7 @@ initsys(e) { if (strrchr(p, '/') != NULL) p = strrchr(p, '/') + 1; - (void) sm_strlcpy(ybuf, sizeof ybuf, p); + (void) sm_strlcpy(ybuf, sizeof(ybuf), p); macdefine(&e->e_macro, A_PERM, 'y', ybuf); } } @@ -817,14 +811,14 @@ settime(e) register struct tm *tm; now = curtime(); - (void) sm_snprintf(buf, sizeof buf, "%ld", (long) now); + (void) sm_snprintf(buf, sizeof(buf), "%ld", (long) now); macdefine(&e->e_macro, A_TEMP, macid("{time}"), buf); tm = gmtime(&now); - (void) sm_snprintf(buf, sizeof buf, "%04d%02d%02d%02d%02d", + (void) sm_snprintf(buf, sizeof(buf), "%04d%02d%02d%02d%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min); macdefine(&e->e_macro, A_TEMP, 't', buf); - (void) sm_strlcpy(buf, ctime(&now), sizeof buf); + (void) sm_strlcpy(buf, ctime(&now), sizeof(buf)); p = strchr(buf, '\n'); if (p != NULL) *p = '\0'; @@ -1013,7 +1007,7 @@ setsender(from, e, delimptr, delimchar, internal) if (host == NULL) host = MyHostName; - (void) sm_snprintf(ebuf, sizeof ebuf, + (void) sm_snprintf(ebuf, sizeof(ebuf), "%.*s@%.*s", MAXNAME, realname, MAXNAME, host); p = ebuf; @@ -1041,7 +1035,7 @@ setsender(from, e, delimptr, delimchar, internal) char nbuf[100]; SuprErrs = true; - expand("\201n", nbuf, sizeof nbuf, e); + expand("\201n", nbuf, sizeof(nbuf), e); from = sm_rpool_strdup_x(e->e_rpool, nbuf); if (parseaddr(from, &e->e_from, RF_COPYALL, ' ', NULL, e, false) == NULL && @@ -1152,7 +1146,8 @@ setsender(from, e, delimptr, delimchar, internal) ** links in the net. */ - pvp = prescan(from, delimchar, pvpbuf, sizeof pvpbuf, NULL, NULL, false); + pvp = prescan(from, delimchar, pvpbuf, sizeof(pvpbuf), NULL, + IntTokenTab, false); if (pvp == NULL) { /* don't need to give error -- prescan did that already */ @@ -1167,11 +1162,11 @@ setsender(from, e, delimptr, delimchar, internal) (void) REWRITE(pvp, 4, e); macdefine(&e->e_macro, A_PERM, macid("{addr_type}"), NULL); bp = buf + 1; - cataddr(pvp, NULL, bp, sizeof buf - 2, '\0'); + cataddr(pvp, NULL, bp, sizeof(buf) - 2, '\0', false); if (*bp == '@' && !bitnset(M_NOBRACKET, e->e_from.q_mailer->m_flags)) { /* heuristic: route-addr: add angle brackets */ - (void) sm_strlcat(bp, ">", sizeof buf - 1); + (void) sm_strlcat(bp, ">", sizeof(buf) - 1); *--bp = '<'; } e->e_sender = sm_rpool_strdup_x(e->e_rpool, bp); |