finally make suppression of sender in mailing lists work -- this version
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 23 Sep 1981 02:33:29 +0000 (18:33 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 23 Sep 1981 02:33:29 +0000 (18:33 -0800)
also works correctly on simple aliases.

SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.44
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.23
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.36

usr/src/usr.sbin/sendmail/src/recipient.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/version.c

index 1af3764..72893a6 100644 (file)
@@ -3,7 +3,7 @@
 # include <sys/stat.h>
 # include "sendmail.h"
 
 # include <sys/stat.h>
 # include "sendmail.h"
 
-static char SccsId[] = "@(#)recipient.c        3.22    %G%";
+static char SccsId[] = "@(#)recipient.c        3.23    %G%";
 
 /*
 **  SENDTO -- Designate a send list.
 
 /*
 **  SENDTO -- Designate a send list.
@@ -34,6 +34,7 @@ sendto(list, copyf, ctladdr)
        register char *p;
        bool more;              /* set if more addresses to send to */
        ADDRESS *al;            /* list of addresses to send to */
        register char *p;
        bool more;              /* set if more addresses to send to */
        ADDRESS *al;            /* list of addresses to send to */
+       bool firstone;          /* set on first address sent */
 
 # ifdef DEBUG
        if (Debug > 1)
 
 # ifdef DEBUG
        if (Debug > 1)
@@ -41,6 +42,7 @@ sendto(list, copyf, ctladdr)
 # endif DEBUG
 
        more = TRUE;
 # endif DEBUG
 
        more = TRUE;
+       firstone = TRUE;
        al = NULL;
        for (p = list; more; )
        {
        al = NULL;
        for (p = list; more; )
        {
@@ -68,7 +70,11 @@ sendto(list, copyf, ctladdr)
                /* put it on the local send list */
                a->q_next = al;
                a->q_alias = ctladdr;
                /* put it on the local send list */
                a->q_next = al;
                a->q_alias = ctladdr;
+               if (ctladdr == NULL ||
+                   (firstone && !more && bitset(QPRIMARY, ctladdr->q_flags)))
+                       a->q_flags |= QPRIMARY;
                al = a;
                al = a;
+               firstone = FALSE;
        }
 
        /* arrange to send to everyone on the local send list */
        }
 
        /* arrange to send to everyone on the local send list */
@@ -158,7 +164,8 @@ recipient(a)
 # endif DEBUG
                        if (Verbose && !bitset(QDONTSEND, a->q_flags))
                                message(Arpa_Info, "duplicate suppressed");
 # endif DEBUG
                        if (Verbose && !bitset(QDONTSEND, a->q_flags))
                                message(Arpa_Info, "duplicate suppressed");
-                       q->q_flags |= a->q_flags;
+                       if (!bitset(QPRIMARY, q->q_flags))
+                               q->q_flags |= a->q_flags;
                        return;
                }
        }
                        return;
                }
        }
index 7f50aa3..d744c3a 100644 (file)
@@ -1,7 +1,7 @@
 /*
 **  SENDMAIL.H -- Global definitions for sendmail.
 **
 /*
 **  SENDMAIL.H -- Global definitions for sendmail.
 **
-**     @(#)sendmail.h  3.43    %G%
+**     @(#)sendmail.h  3.44    %G%
 */
 
 
 */
 
 
@@ -68,6 +68,7 @@ typedef struct address ADDRESS;
 # define QDONTSEND     000001  /* don't send to this address */
 # define QBADADDR      000002  /* this address is verified bad */
 # define QGOODUID      000004  /* the q_uid q_gid fields are good */
 # define QDONTSEND     000001  /* don't send to this address */
 # define QBADADDR      000002  /* this address is verified bad */
 # define QGOODUID      000004  /* the q_uid q_gid fields are good */
+# define QPRIMARY      000010  /* set from argv */
 
 
 
 
 
 
index 3067811..e4f89ea 100644 (file)
@@ -1,3 +1,3 @@
-static char    SccsId[] = "@(#)SendMail version 3.35 of %G%";
+static char    SccsId[] = "@(#)SendMail version 3.36 of %G%";
 
 
-char   Version[] = "3.35 [%G%]";
+char   Version[] = "3.36 [%G%]";