From a1a07282b81ef40984485f9a1fb6e14620112d83 Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Mon, 6 Jan 1986 02:49:17 -0800 Subject: [PATCH] rewrite reply-to and resent-reply-to; save errorqueueu in qf file; some performance hacking; some alias handling cleanup; delete leading spaces from SMTP lines SCCS-vsn: usr.sbin/sendmail/src/stats.c 5.7 SCCS-vsn: usr.sbin/sendmail/src/alias.c 5.9 SCCS-vsn: usr.sbin/sendmail/src/version.c 5.39 SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 5.18 --- usr/src/usr.sbin/sendmail/src/alias.c | 23 ++++++++++++++++++++--- usr/src/usr.sbin/sendmail/src/srvrsmtp.c | 8 ++++++-- usr/src/usr.sbin/sendmail/src/stats.c | 11 ++--------- usr/src/usr.sbin/sendmail/src/version.c | 4 ++-- 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/alias.c b/usr/src/usr.sbin/sendmail/src/alias.c index 5c3ea7aabb..8464f6576e 100644 --- a/usr/src/usr.sbin/sendmail/src/alias.c +++ b/usr/src/usr.sbin/sendmail/src/alias.c @@ -10,9 +10,9 @@ #ifndef lint # ifdef DBM -static char SccsId[] = "@(#)alias.c 5.8 (Berkeley) %G% (with DBM)"; +static char SccsId[] = "@(#)alias.c 5.9 (Berkeley) %G% (with DBM)"; # else DBM -static char SccsId[] = "@(#)alias.c 5.8 (Berkeley) %G% (without DBM)"; +static char SccsId[] = "@(#)alias.c 5.9 (Berkeley) %G% (without DBM)"; # endif DBM #endif not lint @@ -195,12 +195,28 @@ initaliases(aliasfile, init) ** to us to rebuild it. */ - dbminit(aliasfile); + if (!init) + dbminit(aliasfile); atcnt = SafeAlias * 2; if (atcnt > 0) { while (!init && atcnt-- >= 0 && aliaslookup("@") == NULL) + { + /* + ** Reinitialize alias file in case the new + ** one is mv'ed in instead of cp'ed in. + ** + ** Only works with new DBM -- old one will + ** just consume file descriptors forever. + ** If you have a dbmclose() it can be + ** added before the sleep(30). + */ + sleep(30); +# ifdef NDBM + dbminit(aliasfile); +# endif NDBM + } } else atcnt = 1; @@ -344,6 +360,7 @@ readaliases(aliasfile, init) (void) signal(SIGINT, oldsigint); return; } + dbminit(aliasfile); (void) strcpy(line, aliasfile); (void) strcat(line, ".pag"); if (close(creat(line, DBMMODE)) < 0) diff --git a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c index fee71eee96..7f56f2d771 100644 --- a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c +++ b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c @@ -15,12 +15,12 @@ # ifndef SMTP # ifndef lint -static char SccsId[] = "@(#)srvrsmtp.c 5.17 (Berkeley) %G% (no SMTP)"; +static char SccsId[] = "@(#)srvrsmtp.c 5.18 (Berkeley) %G% (no SMTP)"; # endif not lint # else SMTP # ifndef lint -static char SccsId[] = "@(#)srvrsmtp.c 5.17 (Berkeley) %G%"; +static char SccsId[] = "@(#)srvrsmtp.c 5.18 (Berkeley) %G%"; # endif not lint /* @@ -170,6 +170,10 @@ smtp() *cmd++ = *p++; *cmd = '\0'; + /* throw away leading whitespace */ + while (isspace(*p)) + p++; + /* decode command */ for (c = CmdTab; c->cmdname != NULL; c++) { diff --git a/usr/src/usr.sbin/sendmail/src/stats.c b/usr/src/usr.sbin/sendmail/src/stats.c index 6290165fe9..0d69879040 100644 --- a/usr/src/usr.sbin/sendmail/src/stats.c +++ b/usr/src/usr.sbin/sendmail/src/stats.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char SccsId[] = "@(#)stats.c 5.6 (Berkeley) %G%"; +static char SccsId[] = "@(#)stats.c 5.7 (Berkeley) %G%"; #endif not lint # include "sendmail.h" @@ -42,14 +42,7 @@ markstats(e, to) { if (to == NULL) { - - /* - ** If is possible to get mail from an unparseable address, - ** in this case, the q_mailer field is null, so that the - ** indirection below causes a dereference of a NULL pointer. - */ - - if (e->e_from.q_mailer != NULL ) + if (e->e_from.q_mailer != NULL) { Stat.stat_nf[e->e_from.q_mailer->m_mno]++; Stat.stat_bf[e->e_from.q_mailer->m_mno] += diff --git a/usr/src/usr.sbin/sendmail/src/version.c b/usr/src/usr.sbin/sendmail/src/version.c index 0679821d3b..ddaa061fa5 100644 --- a/usr/src/usr.sbin/sendmail/src/version.c +++ b/usr/src/usr.sbin/sendmail/src/version.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char SccsId[] = "@(#)version.c 5.38 (Berkeley) %G%"; +static char SccsId[] = "@(#)version.c 5.39 (Berkeley) %G%"; #endif not lint -char Version[] = "5.38"; +char Version[] = "5.39"; -- 2.20.1