SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.15
SCCS-vsn: usr.sbin/sendmail/src/recipient.c 3.2
SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.15
# include "sendmail.h"
# ifdef DBM
# include "sendmail.h"
# ifdef DBM
-static char SccsId[] = "@(#)alias.c 3.14 %G% (with DBM)";
+static char SccsId[] = "@(#)alias.c 3.15 %G% (with DBM)";
-static char SccsId[] = "@(#)alias.c 3.14 %G% (without DBM)";
+static char SccsId[] = "@(#)alias.c 3.15 %G% (without DBM)";
/* good address -- look for .forward file in home */
define('z', user->q_home);
(void) expand("$z/.forward", buf, &buf[sizeof buf - 1]);
/* good address -- look for .forward file in home */
define('z', user->q_home);
(void) expand("$z/.forward", buf, &buf[sizeof buf - 1]);
- fp = fopen(buf, "r");
- if (fp == NULL)
+ if (access(buf, 4) < 0)
return;
/* we do have an address to forward to -- do it */
user->q_flags |= QDONTSEND;
return;
/* we do have an address to forward to -- do it */
user->q_flags |= QDONTSEND;
- (void) fgets(buf, sizeof buf, fp);
- if ((p = index(buf, '\n')) != NULL)
- *p = '\0';
- (void) fclose(fp);
- if (buf[0] == '\0')
- return;
- if (Verbose)
- message(Arpa_Info, "forwarded to %s", buf);
- AliasLevel++;
- sendto(buf, 1);
- AliasLevel--;
- return;
+ include(buf, "forwarding");
# include <syslog.h>
# endif LOG
# include <syslog.h>
# endif LOG
-static char SccsId[] = "@(#)recipient.c 3.1 %G%";
+static char SccsId[] = "@(#)recipient.c 3.2 %G%";
/*
** SENDTO -- Designate a send list.
/*
** SENDTO -- Designate a send list.
if (strncmp(a->q_user, ":include:", 9) == 0)
{
a->q_flags |= QDONTSEND;
if (strncmp(a->q_user, ":include:", 9) == 0)
{
a->q_flags |= QDONTSEND;
- include(&a->q_user[9]);
+ if (Verbose)
+ message(Arpa_Info, "including file %s", &a->q_user[9]);
+ include(&a->q_user[9], " sending");
**
** Parameters:
** fname -- filename to include.
**
** Parameters:
** fname -- filename to include.
+** msg -- message to print in verbose mode.
** listed in that file.
*/
** listed in that file.
*/
{
char buf[MAXLINE];
register FILE *fp;
{
char buf[MAXLINE];
register FILE *fp;
- if (Verbose)
- message(Arpa_Info, "Including file %s", fname);
fp = fopen(fname, "r");
if (fp == NULL)
{
fp = fopen(fname, "r");
if (fp == NULL)
{
continue;
To = fname;
if (Verbose)
continue;
To = fname;
if (Verbose)
- message(Arpa_Info, " >> %s", buf);
+ message(Arpa_Info, "%s to %s", msg, buf);
+ AliasLevel++;