SCCS-vsn: usr.sbin/sendmail/src/conf.c 3.23
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.32
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.13
SCCS-vsn: usr.sbin/sendmail/src/main.c 3.27
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.5
-static char SccsId[] = "@(#)conf.c 3.22 %G%";
+static char SccsId[] = "@(#)conf.c 3.23 %G%";
# include <whoami.h> /* definitions of machine id's at berkeley */
# include <whoami.h> /* definitions of machine id's at berkeley */
"original-from", H_DELETE, 0, /* internal */
"sender", 0, 0,
"full-name", H_ACHECK, M_FULLNAME,
"original-from", H_DELETE, 0, /* internal */
"sender", 0, 0,
"full-name", H_ACHECK, M_FULLNAME,
- "to", 0, 0,
- "cc", 0, 0,
- "bcc", 0, 0,
+ "to", H_ADDR|H_FORCE, 0,
+ "cc", H_ADDR|H_FORCE, 0,
+ "bcc", H_ADDR|H_DELETE|H_FORCE,0,
"message-id", H_CHECK, M_MSGID,
"message", H_EOH, 0,
"text", H_EOH, 0,
"message-id", H_CHECK, M_MSGID,
"message", H_EOH, 0,
"text", H_EOH, 0,
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-static char SccsId[] = "@(#)headers.c 3.4 %G%";
+static char SccsId[] = "@(#)headers.c 3.5 %G%";
/*
** CHOMPHEADER -- process and save a header line.
/*
** CHOMPHEADER -- process and save a header line.
if (h->h_value != NULL)
free(h->h_value);
h->h_value = newstr(fvalue);
if (h->h_value != NULL)
free(h->h_value);
h->h_value = newstr(fvalue);
+ if (!def && GrabTo && bitset(H_ADDR, h->h_flags))
+ sendto(h->h_value, 0);
# include <syslog.h>
# endif LOG
# include <syslog.h>
# endif LOG
-static char SccsId[] = "@(#)main.c 3.26 %G%";
+static char SccsId[] = "@(#)main.c 3.27 %G%";
/*
** SENDMAIL -- Post mail to a set of destinations.
/*
** SENDMAIL -- Post mail to a set of destinations.
** front of messages.
** -v Give blow-by-blow description of
** everything that happens.
** front of messages.
** -v Give blow-by-blow description of
** everything that happens.
+** -t Read "to" addresses from message.
+** Looks at To:, Cc:, and Bcc: lines.
** -Cfilename Use alternate configuration file.
** -Afilename Use alternate alias file.
** -DXvalue Define macro X to have value.
** -Cfilename Use alternate configuration file.
** -Afilename Use alternate alias file.
** -DXvalue Define macro X to have value.
bool IgnrDot; /* if set, ignore dot when collecting mail */
bool SuprErrs; /* supress errors if set */
bool Verbose; /* set if blow-by-blow desired */
bool IgnrDot; /* if set, ignore dot when collecting mail */
bool SuprErrs; /* supress errors if set */
bool Verbose; /* set if blow-by-blow desired */
+bool GrabTo; /* if set, read recipient addresses from msg */
int Debug; /* debug level */
int Errors; /* count of errors */
int AliasLevel; /* current depth of aliasing */
int Debug; /* debug level */
int Errors; /* count of errors */
int AliasLevel; /* current depth of aliasing */
+ case 't': /* read recipients from message */
+ GrabTo = TRUE;
+ break;
+
default:
/* at Eric Schmidt's suggestion, this will not be an error....
syserr("Unknown flag %s", p);
default:
/* at Eric Schmidt's suggestion, this will not be an error....
syserr("Unknown flag %s", p);
+ if (argc <= 0 && !GrabTo)
usrerr("Usage: /etc/sendmail [flags] addr...");
/*
usrerr("Usage: /etc/sendmail [flags] addr...");
/*
/* if we have had errors sofar, drop out now */
if (Errors > 0 && ExitStat == EX_OK)
ExitStat = EX_USAGE;
/* if we have had errors sofar, drop out now */
if (Errors > 0 && ExitStat == EX_OK)
ExitStat = EX_USAGE;
- if ((ArpaMode > ARPA_OLD && ExitStat != EX_OK) || verifyonly)
+ if ((ArpaMode > ARPA_OLD && ExitStat != EX_OK) ||
+ (verifyonly && !GrabTo))
finis();
/* no errors, tell arpanet to go ahead */
finis();
/* no errors, tell arpanet to go ahead */
printf("From person = \"%s\"\n", From.q_paddr);
# endif DEBUG
printf("From person = \"%s\"\n", From.q_paddr);
# endif DEBUG
+ if (verifyonly && GrabTo)
+ finis();
+
/*
** Arrange that the person who is sending the mail
** will not be expanded (unless explicitly requested).
/*
** Arrange that the person who is sending the mail
** will not be expanded (unless explicitly requested).
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
/*
** SENDMAIL.H -- Global definitions for sendmail.
**
-** @(#)sendmail.h 3.31 %G%
+** @(#)sendmail.h 3.32 %G%
# define H_CHECK 00020 /* check h_mflags against m_flags */
# define H_ACHECK 00040 /* ditto, but always (not just default) */
# define H_FORCE 00100 /* force this field, even if default */
# define H_CHECK 00020 /* check h_mflags against m_flags */
# define H_ACHECK 00040 /* ditto, but always (not just default) */
# define H_FORCE 00100 /* force this field, even if default */
+# define H_ADDR 00200 /* this field contains addresses */
extern bool IgnrDot; /* don't let dot end messages */
extern bool SaveFrom; /* save leading "From" lines */
extern bool Verbose; /* set if blow-by-blow desired */
extern bool IgnrDot; /* don't let dot end messages */
extern bool SaveFrom; /* save leading "From" lines */
extern bool Verbose; /* set if blow-by-blow desired */
+extern bool GrabTo; /* if set, get recipients from msg */
extern int Debug; /* debugging level */
extern int Errors; /* set if errors */
extern int ExitStat; /* exit status code */
extern int Debug; /* debugging level */
extern int Errors; /* set if errors */
extern int ExitStat; /* exit status code */
-static char SccsId[] = "@(#)SendMail version 3.12 of %G%";
+static char SccsId[] = "@(#)SendMail version 3.13 of %G%";
-char Version[] = "3.12 [%G%]";
+char Version[] = "3.13 [%G%]";