From e1f691b3de0cb574758f24da769ae31729e5addd Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Sat, 25 Mar 1995 15:39:37 -0800 Subject: [PATCH] don't pass through NOTIFY= unless it was given in the SMTP RCPT SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.40 SCCS-vsn: usr.sbin/sendmail/src/recipient.c 8.74 SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.60 SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.106 SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.61 --- usr/src/usr.sbin/sendmail/src/parseaddr.c | 3 +- usr/src/usr.sbin/sendmail/src/recipient.c | 4 +- usr/src/usr.sbin/sendmail/src/sendmail.h | 5 ++- usr/src/usr.sbin/sendmail/src/srvrsmtp.c | 5 ++- usr/src/usr.sbin/sendmail/src/usersmtp.c | 51 ++++++++++++----------- 5 files changed, 37 insertions(+), 31 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/parseaddr.c b/usr/src/usr.sbin/sendmail/src/parseaddr.c index 672fcf75fc..0315056daa 100644 --- a/usr/src/usr.sbin/sendmail/src/parseaddr.c +++ b/usr/src/usr.sbin/sendmail/src/parseaddr.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)parseaddr.c 8.59 (Berkeley) %G%"; +static char sccsid[] = "@(#)parseaddr.c 8.60 (Berkeley) %G%"; #endif /* not lint */ #include "sendmail.h" @@ -1982,6 +1982,7 @@ struct qflags AddressFlags[] = "QPINGONSUCCESS", QPINGONSUCCESS, "QPINGONFAILURE", QPINGONFAILURE, "QPINGONDELAY", QPINGONDELAY, + "QHASNOTIFY", QHASNOTIFY, "QRELAYED", QRELAYED, NULL }; diff --git a/usr/src/usr.sbin/sendmail/src/recipient.c b/usr/src/usr.sbin/sendmail/src/recipient.c index 9cb3bffb5a..dc74e8a3a3 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 8.73 (Berkeley) %G%"; +static char sccsid[] = "@(#)recipient.c 8.74 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -48,7 +48,7 @@ static char sccsid[] = "@(#)recipient.c 8.73 (Berkeley) %G%"; #define MAXRCRSN 10 /* maximum levels of alias recursion */ /* q_flags bits inherited from ctladdr */ -#define QINHERITEDBITS (QPINGONSUCCESS|QPINGONFAILURE|QPINGONDELAY) +#define QINHERITEDBITS (QPINGONSUCCESS|QPINGONFAILURE|QPINGONDELAY|QHASNOTIFY) int ADDRESS * diff --git a/usr/src/usr.sbin/sendmail/src/sendmail.h b/usr/src/usr.sbin/sendmail/src/sendmail.h index c1669cbffc..b911e54f14 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 8.105 (Berkeley) %G% + * @(#)sendmail.h 8.106 (Berkeley) %G% */ /* @@ -15,7 +15,7 @@ # ifdef _DEFINE # define EXTERN # ifndef lint -static char SmailSccsId[] = "@(#)sendmail.h 8.105 %G%"; +static char SmailSccsId[] = "@(#)sendmail.h 8.106 %G%"; # endif # else /* _DEFINE */ # define EXTERN extern @@ -144,6 +144,7 @@ typedef struct address ADDRESS; # define QPINGONSUCCESS 0x00001000 /* give return on successful delivery */ # define QPINGONFAILURE 0x00002000 /* give return on failure */ # define QPINGONDELAY 0x00004000 /* give return on message delay */ +# define QHASNOTIFY 0x00008000 /* propogate notify parameter */ # define QRELAYED 0x00020000 /* relayed to non-DSN aware mailer */ # define NULLADDR ((ADDRESS *) NULL) diff --git a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c index aa96d68289..8e9eedb906 100644 --- a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c +++ b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c @@ -10,9 +10,9 @@ #ifndef lint #ifdef SMTP -static char sccsid[] = "@(#)srvrsmtp.c 8.60 (Berkeley) %G% (with SMTP)"; +static char sccsid[] = "@(#)srvrsmtp.c 8.61 (Berkeley) %G% (with SMTP)"; #else -static char sccsid[] = "@(#)srvrsmtp.c 8.60 (Berkeley) %G% (without SMTP)"; +static char sccsid[] = "@(#)srvrsmtp.c 8.61 (Berkeley) %G% (without SMTP)"; #endif #endif /* not lint */ @@ -888,6 +888,7 @@ rcpt_esmtp_args(a, kp, vp, e) /* NOTREACHED */ } a->q_flags &= ~(QPINGONSUCCESS|QPINGONFAILURE|QPINGONDELAY); + a->q_flags |= QHASNOTIFY; if (strcasecmp(vp, "never") == 0) return; for (p = vp; p != NULL; vp = p) diff --git a/usr/src/usr.sbin/sendmail/src/usersmtp.c b/usr/src/usr.sbin/sendmail/src/usersmtp.c index 0d109465b0..4086589137 100644 --- a/usr/src/usr.sbin/sendmail/src/usersmtp.c +++ b/usr/src/usr.sbin/sendmail/src/usersmtp.c @@ -10,9 +10,9 @@ #ifndef lint #ifdef SMTP -static char sccsid[] = "@(#)usersmtp.c 8.39 (Berkeley) %G% (with SMTP)"; +static char sccsid[] = "@(#)usersmtp.c 8.40 (Berkeley) %G% (with SMTP)"; #else -static char sccsid[] = "@(#)usersmtp.c 8.39 (Berkeley) %G% (without SMTP)"; +static char sccsid[] = "@(#)usersmtp.c 8.40 (Berkeley) %G% (without SMTP)"; #endif #endif /* not lint */ @@ -494,31 +494,34 @@ smtprcpt(to, m, mci, e) strcpy(optbuf, ""); if (bitset(MCIF_DSN, mci->mci_flags)) { - bool firstone = TRUE; - /* NOTIFY= parameter */ - strcat(optbuf, " NOTIFY="); - if (bitset(QPINGONSUCCESS, to->q_flags)) - { - strcat(optbuf, "SUCCESS"); - firstone = FALSE; - } - if (bitset(QPINGONFAILURE, to->q_flags)) + if (bitset(QHASNOTIFY, to->q_flags)) { - if (!firstone) - strcat(optbuf, ","); - strcat(optbuf, "FAILURE"); - firstone = FALSE; - } - if (bitset(QPINGONDELAY, to->q_flags)) - { - if (!firstone) - strcat(optbuf, ","); - strcat(optbuf, "DELAY"); - firstone = FALSE; + bool firstone = TRUE; + + strcat(optbuf, " NOTIFY="); + if (bitset(QPINGONSUCCESS, to->q_flags)) + { + strcat(optbuf, "SUCCESS"); + firstone = FALSE; + } + if (bitset(QPINGONFAILURE, to->q_flags)) + { + if (!firstone) + strcat(optbuf, ","); + strcat(optbuf, "FAILURE"); + firstone = FALSE; + } + if (bitset(QPINGONDELAY, to->q_flags)) + { + if (!firstone) + strcat(optbuf, ","); + strcat(optbuf, "DELAY"); + firstone = FALSE; + } + if (firstone) + strcat(optbuf, "NEVER"); } - if (firstone) - strcat(optbuf, "NEVER"); /* ORCPT= parameter */ if (to->q_orcpt != NULL) -- 2.20.1