From: Eric Allman Date: Mon, 21 Nov 1994 00:56:43 +0000 (-0800) Subject: check for "<<>>" etc as equivalent to "<>" X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/f43d47fc5249153ff785cb14a5a75c91a02b1b08?hp=bfd66a00cfe2fc679c70e6542ae990fc10b71524 check for "<<>>" etc as equivalent to "<>" SCCS-vsn: usr.sbin/sendmail/src/envelope.c 8.43 SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 8.40 SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.39 --- diff --git a/usr/src/usr.sbin/sendmail/src/envelope.c b/usr/src/usr.sbin/sendmail/src/envelope.c index 2151c82b47..f8e09e7ecb 100644 --- a/usr/src/usr.sbin/sendmail/src/envelope.c +++ b/usr/src/usr.sbin/sendmail/src/envelope.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)envelope.c 8.42 (Berkeley) %G%"; +static char sccsid[] = "@(#)envelope.c 8.43 (Berkeley) %G%"; #endif /* not lint */ #include "sendmail.h" @@ -125,8 +125,7 @@ dropenvelope(e) bitset(QPINGONFAILURE, q->q_flags)) { failure_return = TRUE; - if (q->q_owner == NULL && - strcmp(e->e_from.q_paddr, "<>") != 0) + if (q->q_owner == NULL && !emptyaddr(&e->e_from)) (void) sendtolist(e->e_from.q_paddr, NULL, &e->e_errorqueue, e); } diff --git a/usr/src/usr.sbin/sendmail/src/parseaddr.c b/usr/src/usr.sbin/sendmail/src/parseaddr.c index 36c5bf79cc..aa32d1aa73 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.39 (Berkeley) %G%"; +static char sccsid[] = "@(#)parseaddr.c 8.40 (Berkeley) %G%"; #endif /* not lint */ #include "sendmail.h" @@ -1942,7 +1942,24 @@ printaddr(a, follow) if (first) printf("[NULL]\n"); } + /* +** EMPTYADDR -- return TRUE if this address is empty (``<>'') +** +** Parameters: +** a -- pointer to the address +** +** Returns: +** TRUE -- if this address is "empty" (i.e., no one should +** ever generate replies to it. +** FALSE -- if it is a "regular" (read: replyable) address. +*/ +bool +emptyaddr(a) + register ADDRESS *a; +{ + return strcmp(a->q_paddr, "<>") == 0 || strcmp(a->q_user, "<>") == 0; +} /* ** REMOTENAME -- return the name relative to the current mailer ** diff --git a/usr/src/usr.sbin/sendmail/src/savemail.c b/usr/src/usr.sbin/sendmail/src/savemail.c index 508ab45cf3..c4b0a47b9c 100644 --- a/usr/src/usr.sbin/sendmail/src/savemail.c +++ b/usr/src/usr.sbin/sendmail/src/savemail.c @@ -7,7 +7,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)savemail.c 8.38 (Berkeley) %G%"; +static char sccsid[] = "@(#)savemail.c 8.39 (Berkeley) %G%"; #endif /* not lint */ # include "sendmail.h" @@ -231,7 +231,7 @@ savemail(e) (void) sendtolist("postmaster", NULLADDR, &e->e_errorqueue, e); } - if (strcmp(e->e_from.q_paddr, "<>") != 0) + if (!emptyaddr(&e->e_from)) { (void) sendtolist(e->e_from.q_paddr, NULLADDR, &e->e_errorqueue, e);