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
# 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.
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)
# endif DEBUG
more = TRUE;
# endif DEBUG
more = TRUE;
al = NULL;
for (p = list; more; )
{
al = NULL;
for (p = list; more; )
{
/* 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;
}
/* arrange to send to everyone on the local send list */
}
/* arrange to send to everyone on the local send list */
# 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;
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
-** @(#)sendmail.h 3.43 %G%
+** @(#)sendmail.h 3.44 %G%
# 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 */
-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%]";