cases that work (but is still safe -- I hope)
SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.23
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.40
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.30
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.9
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.18
# include "sendmail.h"
# ifdef DBM
# include "sendmail.h"
# ifdef DBM
-static char SccsId[] = "@(#)alias.c 3.22 %G% (with DBM)";
+static char SccsId[] = "@(#)alias.c 3.23 %G% (with DBM)";
-static char SccsId[] = "@(#)alias.c 3.22 %G% (without DBM)";
+static char SccsId[] = "@(#)alias.c 3.23 %G% (without DBM)";
message(Arpa_Info, "aliased to %s", p);
a->q_flags |= QDONTSEND;
AliasLevel++;
message(Arpa_Info, "aliased to %s", p);
a->q_flags |= QDONTSEND;
AliasLevel++;
+ sendto(p, 1, (a->q_alias == NULL) ? &From : a);
# include <syslog.h>
# endif LOG
# include <syslog.h>
# endif LOG
-static char SccsId[] = "@(#)deliver.c 3.39 %G%";
+static char SccsId[] = "@(#)deliver.c 3.40 %G%";
/*
** DELIVER -- Deliver a message to a list of addresses.
/*
** DELIVER -- Deliver a message to a list of addresses.
stb.st_mode = 0;
if (bitset(0111, stb.st_mode))
exit(EX_CANTCREAT);
stb.st_mode = 0;
if (bitset(0111, stb.st_mode))
exit(EX_CANTCREAT);
+ if (ctladdr == NULL)
+ ctladdr = &From;
if (!bitset(S_ISGID, stb.st_mode) || setgid(stb.st_gid) < 0)
(void) setgid(ctladdr->q_gid);
if (!bitset(S_ISUID, stb.st_mode) || setuid(stb.st_uid) < 0)
if (!bitset(S_ISGID, stb.st_mode) || setgid(stb.st_gid) < 0)
(void) setgid(ctladdr->q_gid);
if (!bitset(S_ISUID, stb.st_mode) || setuid(stb.st_uid) < 0)
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)headers.c 3.8 %G%";
+static char SccsId[] = "@(#)headers.c 3.9 %G%";
/*
** CHOMPHEADER -- process and save a header line.
/*
** CHOMPHEADER -- process and save a header line.
free(h->h_value);
h->h_value = newstr(fvalue);
if (!def && GrabTo && bitset(H_ADDR, h->h_flags))
free(h->h_value);
h->h_value = newstr(fvalue);
if (!def && GrabTo && bitset(H_ADDR, h->h_flags))
- sendto(h->h_value, 0, &From);
+ sendto(h->h_value, 0, NULL);
# include <sys/stat.h>
# include "sendmail.h"
# include <sys/stat.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)recipient.c 3.17 %G%";
+static char SccsId[] = "@(#)recipient.c 3.18 %G%";
/*
** SENDTO -- Designate a send list.
/*
** SENDTO -- Designate a send list.
a->q_mailer = MN_PROG;
m = Mailer[MN_PROG];
a->q_user++;
a->q_mailer = MN_PROG;
m = Mailer[MN_PROG];
a->q_user++;
- if (getctladdr(a) == &From && Debug == 0)
+ if (getctladdr(a) == NULL && Debug == 0)
{
usrerr("Cannot mail directly to programs");
a->q_flags |= QDONTSEND;
{
usrerr("Cannot mail directly to programs");
a->q_flags |= QDONTSEND;
if (strncmp(a->q_user, ":include:", 9) == 0)
{
a->q_flags |= QDONTSEND;
if (strncmp(a->q_user, ":include:", 9) == 0)
{
a->q_flags |= QDONTSEND;
- if (getctladdr(a) == &From && Debug == 0)
+ if (getctladdr(a) == NULL && Debug == 0)
usrerr("Cannot mail directly to :include:s");
else
{
usrerr("Cannot mail directly to :include:s");
else
{
if ((p = rindex(buf, '/')) != NULL)
{
/* check if writable or creatable */
if ((p = rindex(buf, '/')) != NULL)
{
/* check if writable or creatable */
- if (getctladdr(a) == &From && Debug == 0)
+ if (getctladdr(a) == NULL && Debug == 0)
{
usrerr("Cannot mail directly to files");
a->q_flags |= QDONTSEND;
{
usrerr("Cannot mail directly to files");
a->q_flags |= QDONTSEND;
{
while (a != NULL && a->q_home == NULL)
a = a->q_alias;
{
while (a != NULL && a->q_home == NULL)
a = a->q_alias;
- if (a == NULL)
- return (&From);
-static char SccsId[] = "@(#)SendMail version 3.29 of %G%";
+static char SccsId[] = "@(#)SendMail version 3.30 of %G%";
-char Version[] = "3.29 [%G%]";
+char Version[] = "3.30 [%G%]";