From 8bcce4657be81d8479962ab2e857468b5751926e Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Tue, 23 Feb 1993 17:19:10 -0800 Subject: [PATCH] fix botch in SMTP VRFY code (assumed all users were local) SCCS-vsn: usr.sbin/sendmail/src/recipient.c 6.17 SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 6.20 SCCS-vsn: usr.sbin/sendmail/src/alias.c 6.17 SCCS-vsn: usr.sbin/sendmail/src/udb.c 6.12 --- usr/src/usr.sbin/sendmail/src/alias.c | 15 +++++++++------ usr/src/usr.sbin/sendmail/src/recipient.c | 6 +++--- usr/src/usr.sbin/sendmail/src/sendmail.h | 5 +++-- usr/src/usr.sbin/sendmail/src/udb.c | 9 ++++++--- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/alias.c b/usr/src/usr.sbin/sendmail/src/alias.c index cb1a17f221..7e11747f9b 100644 --- a/usr/src/usr.sbin/sendmail/src/alias.c +++ b/usr/src/usr.sbin/sendmail/src/alias.c @@ -29,15 +29,15 @@ ERROR: DBM is no longer supported -- use NDBM instead. #ifndef lint #ifdef NEWDB #ifdef NDBM -static char sccsid[] = "@(#)alias.c 6.16 (Berkeley) %G% (with NEWDB and NDBM)"; +static char sccsid[] = "@(#)alias.c 6.17 (Berkeley) %G% (with NEWDB and NDBM)"; #else -static char sccsid[] = "@(#)alias.c 6.16 (Berkeley) %G% (with NEWDB)"; +static char sccsid[] = "@(#)alias.c 6.17 (Berkeley) %G% (with NEWDB)"; #endif #else #ifdef NDBM -static char sccsid[] = "@(#)alias.c 6.16 (Berkeley) %G% (with NDBM)"; +static char sccsid[] = "@(#)alias.c 6.17 (Berkeley) %G% (with NDBM)"; #else -static char sccsid[] = "@(#)alias.c 6.16 (Berkeley) %G% (without NEWDB or NDBM)"; +static char sccsid[] = "@(#)alias.c 6.17 (Berkeley) %G% (without NEWDB or NDBM)"; #endif #endif #endif /* not lint */ @@ -121,7 +121,7 @@ alias(a, sendq, e) printf("alias(%s)\n", a->q_paddr); /* don't realias already aliased names */ - if (bitset(QDONTSEND, a->q_flags)) + if (bitset(QDONTSEND|QVERIFIED, a->q_flags)) return; e->e_to = a->q_paddr; @@ -145,9 +145,12 @@ alias(a, sendq, e) if (tTd(27, 1)) printf("%s (%s, %s) aliased to %s\n", a->q_paddr, a->q_host, a->q_user, p); - message("aliased to %s", p); if (bitset(EF_VRFYONLY, e->e_flags)) + { + a->q_flags |= QVERIFIED; return; + } + message("aliased to %s", p); #ifdef LOG if (LogLevel > 9) syslog(LOG_INFO, "%s: alias %s => %s", e->e_id, a->q_paddr, p); diff --git a/usr/src/usr.sbin/sendmail/src/recipient.c b/usr/src/usr.sbin/sendmail/src/recipient.c index 832c8704b8..c362a8d5d3 100644 --- a/usr/src/usr.sbin/sendmail/src/recipient.c +++ b/usr/src/usr.sbin/sendmail/src/recipient.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)recipient.c 6.16 (Berkeley) %G%"; +static char sccsid[] = "@(#)recipient.c 6.17 (Berkeley) %G%"; #endif /* not lint */ # include @@ -302,7 +302,7 @@ recipient(a, sendq, e) if (tTd(29, 7)) printf("at trylocaluser %s\n", a->q_user); - if (bitset(QDONTSEND, a->q_flags)) + if (bitset(QDONTSEND|QVERIFIED, a->q_flags)) return (a); if (m == InclMailer) @@ -373,7 +373,7 @@ recipient(a, sendq, e) # endif /* if it was an alias or a UDB expansion, just return now */ - if (bitset(QDONTSEND, a->q_flags)) + if (bitset(QDONTSEND|QVERIFIED, a->q_flags)) return (a); /* diff --git a/usr/src/usr.sbin/sendmail/src/sendmail.h b/usr/src/usr.sbin/sendmail/src/sendmail.h index b5377a610f..426a0b5331 100644 --- a/usr/src/usr.sbin/sendmail/src/sendmail.h +++ b/usr/src/usr.sbin/sendmail/src/sendmail.h @@ -5,7 +5,7 @@ * * %sccs.include.redist.c% * - * @(#)sendmail.h 6.19 (Berkeley) %G% + * @(#)sendmail.h 6.20 (Berkeley) %G% */ /* @@ -15,7 +15,7 @@ # ifdef _DEFINE # define EXTERN # ifndef lint -static char SmailSccsId[] = "@(#)sendmail.h 6.19 %G%"; +static char SmailSccsId[] = "@(#)sendmail.h 6.20 %G%"; # endif lint # else /* _DEFINE */ # define EXTERN extern @@ -120,6 +120,7 @@ typedef struct address ADDRESS; # define QSENT 000040 /* has been successfully delivered */ # define QNOTREMOTE 000100 /* not an address for remote forwarding */ # define QSELFREF 000200 /* this address references itself */ +# define QVERIFIED 000400 /* verified, but not expanded */ # define QPSEUDO 000040 /* only on the list for verification */ /* ** Mailer definition structure. diff --git a/usr/src/usr.sbin/sendmail/src/udb.c b/usr/src/usr.sbin/sendmail/src/udb.c index 30a257d0e8..e9e90ca5a0 100644 --- a/usr/src/usr.sbin/sendmail/src/udb.c +++ b/usr/src/usr.sbin/sendmail/src/udb.c @@ -8,9 +8,9 @@ #ifndef lint #ifdef USERDB -static char sccsid [] = "@(#)udb.c 6.11 (Berkeley) %G% (with USERDB)"; +static char sccsid [] = "@(#)udb.c 6.12 (Berkeley) %G% (with USERDB)"; #else -static char sccsid [] = "@(#)udb.c 6.11 (Berkeley) %G% (without USERDB)"; +static char sccsid [] = "@(#)udb.c 6.12 (Berkeley) %G% (without USERDB)"; #endif #endif @@ -123,7 +123,7 @@ udbexpand(a, sendq, e) printf("udbexpand(%s)\n", a->q_paddr); /* make certain we are supposed to send to this address */ - if (bitset(QDONTSEND, a->q_flags)) + if (bitset(QDONTSEND|QVERIFIED, a->q_flags)) return EX_OK; e->e_to = a->q_paddr; @@ -185,7 +185,10 @@ udbexpand(a, sendq, e) bcmp(key.data, keybuf, keylen) == 0) { if (bitset(EF_VRFYONLY, e->e_flags)) + { + a->q_flags |= QVERIFIED; return EX_OK; + } breakout = TRUE; if (info.size < sizeof buf) -- 2.20.1