finish implementing envelopes. it's not completely clear to me that
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 1 Jun 1982 06:33:06 +0000 (22:33 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Tue, 1 Jun 1982 06:33:06 +0000 (22:33 -0800)
this is really the way to go, but it seems clearly better than what
i had before.  this delta includes many other minor changes, so it
should probably not be blithely removed.

SCCS-vsn: usr.sbin/sendmail/src/alias.c 3.32
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 3.80
SCCS-vsn: usr.sbin/sendmail/src/collect.c 3.39
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 3.70
SCCS-vsn: usr.sbin/sendmail/src/parseaddr.c 3.42
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 3.30
SCCS-vsn: usr.sbin/sendmail/src/version.c 3.108
SCCS-vsn: usr.sbin/sendmail/src/main.c 3.76
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 3.25
SCCS-vsn: usr.sbin/sendmail/src/macro.c 3.12
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.19
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 3.10
SCCS-vsn: usr.sbin/sendmail/src/queue.c 3.14

13 files changed:
usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/collect.c
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/headers.c
usr/src/usr.sbin/sendmail/src/macro.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/parseaddr.c
usr/src/usr.sbin/sendmail/src/queue.c
usr/src/usr.sbin/sendmail/src/readcf.c
usr/src/usr.sbin/sendmail/src/savemail.c
usr/src/usr.sbin/sendmail/src/sendmail.h
usr/src/usr.sbin/sendmail/src/usersmtp.c
usr/src/usr.sbin/sendmail/src/version.c

index 0155787..1715982 100644 (file)
@@ -4,9 +4,9 @@
 # include "sendmail.h"
 
 # ifdef DBM
 # include "sendmail.h"
 
 # ifdef DBM
-SCCSID(@(#)alias.c     3.31.1.1                %G%     (with DBM));
+SCCSID(@(#)alias.c     3.32            %G%     (with DBM));
 # else DBM
 # else DBM
-SCCSID(@(#)alias.c     3.31.1.1                %G%     (without DBM));
+SCCSID(@(#)alias.c     3.32            %G%     (without DBM));
 # endif DBM
 
 /*
 # endif DBM
 
 /*
index 82774f5..c3df7a6 100644 (file)
@@ -1,7 +1,7 @@
 # include <errno.h>
 # include "sendmail.h"
 
 # include <errno.h>
 # include "sendmail.h"
 
-SCCSID(@(#)collect.c   3.38.1.1                %G%);
+SCCSID(@(#)collect.c   3.39            %G%);
 
 /*
 **  COLLECT -- read & parse message header & make temp file.
 
 /*
 **  COLLECT -- read & parse message header & make temp file.
@@ -60,7 +60,7 @@ maketemp(from)
                finis();
        }
        chmod(tempfname, 0600);
                finis();
        }
        chmod(tempfname, 0600);
-       InFileName = tempfname;
+       CurEnv->e_df = tempfname;
 
        /*
        **  Create the Mail-From line if we want to.
 
        /*
        **  Create the Mail-From line if we want to.
@@ -194,12 +194,12 @@ maketemp(from)
                {
                        if (errno == ENOSPC)
                        {
                {
                        if (errno == ENOSPC)
                        {
-                               (void) freopen(InFileName, "w", tf);
+                               (void) freopen(CurEnv->e_df, "w", tf);
                                fputs("\nMAIL DELETED BECAUSE OF LACK OF DISK SPACE\n\n", tf);
                                usrerr("452 Out of disk space for temp file");
                        }
                        else
                                fputs("\nMAIL DELETED BECAUSE OF LACK OF DISK SPACE\n\n", tf);
                                usrerr("452 Out of disk space for temp file");
                        }
                        else
-                               syserr("collect: Cannot write %s", InFileName);
+                               syserr("collect: Cannot write %s", CurEnv->e_df);
                        (void) freopen("/dev/null", "w", tf);
                }
        }
                        (void) freopen("/dev/null", "w", tf);
                }
        }
@@ -273,8 +273,8 @@ maketemp(from)
                .... so we will ignore the problem for the time being */
        }
 
                .... so we will ignore the problem for the time being */
        }
 
-       if ((TempFile = fopen(InFileName, "r")) == NULL)
-               syserr("Cannot reopen %s", InFileName);
+       if ((TempFile = fopen(CurEnv->e_df, "r")) == NULL)
+               syserr("Cannot reopen %s", CurEnv->e_df);
 
 # ifdef DEBUG
        if (Debug)
 
 # ifdef DEBUG
        if (Debug)
index eb5ae2a..1e72dd0 100644 (file)
@@ -6,7 +6,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-SCCSID(@(#)deliver.c   3.79.1.1                %G%);
+SCCSID(@(#)deliver.c   3.80            %G%);
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
@@ -350,6 +350,7 @@ deliver(firstto)
                if (clever)
                        smtpquit(pv[0]);
 # endif SMTP
                if (clever)
                        smtpquit(pv[0]);
 # endif SMTP
+               define('g', NULL);
                return (0);
        }
 
                return (0);
        }
 
@@ -404,6 +405,7 @@ deliver(firstto)
 # endif QUEUE
 
        errno = 0;
 # endif QUEUE
 
        errno = 0;
+       define('g', NULL);
        return (i);
 }
 \f/*
        return (i);
 }
 \f/*
index d10f949..58d3462 100644 (file)
@@ -1,7 +1,7 @@
 # include <errno.h>
 # include "sendmail.h"
 
 # include <errno.h>
 # include "sendmail.h"
 
-SCCSID(@(#)headers.c   3.18.1.1                %G%);
+SCCSID(@(#)headers.c   3.19            %G%);
 
 /*
 **  CHOMPHEADER -- process and save a header line.
 
 /*
 **  CHOMPHEADER -- process and save a header line.
index e6611d9..82e41a6 100644 (file)
@@ -1,7 +1,7 @@
 # include "sendmail.h"
 # include "conf.h"
 
 # include "sendmail.h"
 # include "conf.h"
 
-SCCSID(@(#)macro.c     3.11.1.1                %G%);
+SCCSID(@(#)macro.c     3.12            %G%);
 
 /*
 **  EXPAND -- macro expand a string using $x escapes.
 
 /*
 **  EXPAND -- macro expand a string using $x escapes.
index 1ac13f3..1ee8417 100644 (file)
@@ -7,7 +7,7 @@
 # include <syslog.h>
 # endif LOG
 
 # include <syslog.h>
 # endif LOG
 
-SCCSID(@(#)main.c      3.75            %G%);
+SCCSID(@(#)main.c      3.76            %G%);
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
 
 /*
 **  SENDMAIL -- Post mail to a set of destinations.
@@ -737,11 +737,11 @@ finis()
 # ifdef QUEUE
                queueup(CurEnv);
 # else QUEUE
 # ifdef QUEUE
                queueup(CurEnv);
 # else QUEUE
-               syserr("finis: trying to queue %s", InFileName);
+               syserr("finis: trying to queue %s", CurEnv->e_df);
 # endif QUEUE
        }
        else
 # endif QUEUE
        }
        else
-               (void) unlink(InFileName);
+               (void) unlink(CurEnv->e_df);
        exit(ExitStat);
 }
 \f/*
        exit(ExitStat);
 }
 \f/*
@@ -1033,4 +1033,6 @@ newenvelope(e)
        e->e_sendqueue = NULL;
        e->e_parent = CurEnv;
        e->e_df = NULL;
        e->e_sendqueue = NULL;
        e->e_parent = CurEnv;
        e->e_df = NULL;
+
+       return (e);
 }
 }
index ede613c..313ec37 100644 (file)
@@ -1,6 +1,6 @@
 # include "sendmail.h"
 
 # include "sendmail.h"
 
-SCCSID(@(#)parseaddr.c 3.41.1.1                %G%);
+SCCSID(@(#)parseaddr.c 3.42            %G%);
 
 /*
 **  PARSE -- Parse an address
 
 /*
 **  PARSE -- Parse an address
index 4df8a9f..ff3c15d 100644 (file)
@@ -5,10 +5,10 @@
 # include <errno.h>
 
 # ifndef QUEUE
 # include <errno.h>
 
 # ifndef QUEUE
-SCCSID(@(#)queue.c     3.13.1.1                %G%     (no queueing));
+SCCSID(@(#)queue.c     3.14            %G%     (no queueing));
 # else QUEUE
 
 # else QUEUE
 
-SCCSID(@(#)queue.c     3.13.1.1                %G%);
+SCCSID(@(#)queue.c     3.14            %G%);
 
 /*
 **  QUEUEUP -- queue a message up for future transmission.
 
 /*
 **  QUEUEUP -- queue a message up for future transmission.
@@ -477,6 +477,7 @@ dowork(w)
                */
 
                QueueRun = TRUE;
                */
 
                QueueRun = TRUE;
+               MailBack = TRUE;
                (void) strcpy(buf, QueueDir);
                (void) strcat(buf, "/tfXXXXXX");
                (void) mktemp(buf);
                (void) strcpy(buf, QueueDir);
                (void) strcat(buf, "/tfXXXXXX");
                (void) mktemp(buf);
@@ -587,10 +588,10 @@ readqf(cf)
                        break;
 
                  case 'D':             /* data file name */
                        break;
 
                  case 'D':             /* data file name */
-                       InFileName = newstr(&buf[1]);
-                       TempFile = fopen(InFileName, "r");
+                       CurEnv->e_df = newstr(&buf[1]);
+                       TempFile = fopen(CurEnv->e_df, "r");
                        if (TempFile == NULL)
                        if (TempFile == NULL)
-                               syserr("readqf: cannot open %s", InFileName);
+                               syserr("readqf: cannot open %s", CurEnv->e_df);
                        break;
 
                  case 'T':             /* timeout */
                        break;
 
                  case 'T':             /* timeout */
@@ -639,6 +640,7 @@ timeout(w)
        if (Debug > 0)
                printf("timeout(%s)\n", w->w_name);
 # endif DEBUG
        if (Debug > 0)
                printf("timeout(%s)\n", w->w_name);
 # endif DEBUG
+       message(Arpa_Info, "Message has timed out");
 
        /* return message to sender */
        (void) returntosender("Cannot send mail for three days",
 
        /* return message to sender */
        (void) returntosender("Cannot send mail for three days",
index faf3704..f2cffe4 100644 (file)
@@ -1,6 +1,6 @@
 # include "sendmail.h"
 
 # include "sendmail.h"
 
-SCCSID(@(#)readcf.c    3.24            %G%);
+SCCSID(@(#)readcf.c    3.25            %G%);
 
 /*
 **  READCF -- read control file.
 
 /*
 **  READCF -- read control file.
index b7fe1fc..bab00fe 100644 (file)
@@ -1,7 +1,7 @@
 # include <pwd.h>
 # include "sendmail.h"
 
 # include <pwd.h>
 # include "sendmail.h"
 
-SCCSID(@(#)savemail.c  3.29.1.1                %G%);
+SCCSID(@(#)savemail.c  3.30            %G%);
 
 /*
 **  SAVEMAIL -- Save mail on error
 
 /*
 **  SAVEMAIL -- Save mail on error
@@ -68,13 +68,16 @@ savemail()
        **      Fundamentally, this is the mailback case except that
        **      it returns an OK exit status (assuming the return
        **      worked).
        **      Fundamentally, this is the mailback case except that
        **      it returns an OK exit status (assuming the return
        **      worked).
+       **  Also, if the from address is not local, mail it back.
        */
 
        if (BerkNet)
        {
                ExitStat = EX_OK;
        */
 
        if (BerkNet)
        {
                ExitStat = EX_OK;
-               MailBack++;
+               MailBack = TRUE;
        }
        }
+       if (!bitset(M_LOCAL, CurEnv->e_from.q_mailer->m_flags))
+               MailBack = TRUE;
 
        /*
        **  If writing back, do it.
 
        /*
        **  If writing back, do it.
@@ -89,7 +92,7 @@ savemail()
                p = ttypath();
                if (p == NULL || freopen(p, "w", stdout) == NULL)
                {
                p = ttypath();
                if (p == NULL || freopen(p, "w", stdout) == NULL)
                {
-                       MailBack++;
+                       MailBack = TRUE;
                        errno = 0;
                }
                else
                        errno = 0;
                }
                else
@@ -204,7 +207,7 @@ returntosender(msg, returnto, sendbody)
        extern ENVELOPE *newenvelope();
        ENVELOPE errenvelope;
 
        extern ENVELOPE *newenvelope();
        ENVELOPE errenvelope;
 
-       NoAlias++;
+       NoAlias = TRUE;
        SendBody = sendbody;
        ee = newenvelope(&errenvelope);
        ee->e_puthdr = putheader;
        SendBody = sendbody;
        ee = newenvelope(&errenvelope);
        ee->e_puthdr = putheader;
index c374f38..f588cbb 100644 (file)
@@ -7,7 +7,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 3.69            %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 3.70            %G%";
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
 # endif lint
 # else  _DEFINE
 # define EXTERN extern
@@ -363,7 +363,6 @@ EXTERN int  HopCount;       /* hop count */
 EXTERN int     AliasLevel;     /* depth of aliasing */
 EXTERN time_t  QueueIntvl;     /* intervals between running the queue */
 EXTERN char    *HostName;      /* name of this host for SMTP messages */
 EXTERN int     AliasLevel;     /* depth of aliasing */
 EXTERN time_t  QueueIntvl;     /* intervals between running the queue */
 EXTERN char    *HostName;      /* name of this host for SMTP messages */
-EXTERN char    *InFileName;    /* input file name */
 EXTERN char    *Transcript;    /* the transcript file name */
 extern char    *XcriptFile;    /* template for Transcript */
 extern char    *AliasFile;     /* location of alias file */
 EXTERN char    *Transcript;    /* the transcript file name */
 extern char    *XcriptFile;    /* template for Transcript */
 extern char    *AliasFile;     /* location of alias file */
index 9cef933..7ab2676 100644 (file)
@@ -3,10 +3,10 @@
 # include "sendmail.h"
 
 # ifndef SMTP
 # include "sendmail.h"
 
 # ifndef SMTP
-SCCSID(@(#)usersmtp.c  3.9.1.1         %G%     (no SMTP));
+SCCSID(@(#)usersmtp.c  3.10            %G%     (no SMTP));
 # else SMTP
 
 # else SMTP
 
-SCCSID(@(#)usersmtp.c  3.9.1.1         %G%);
+SCCSID(@(#)usersmtp.c  3.10            %G%);
 
 /*
 **  SMTPINIT -- initialize SMTP.
 
 /*
 **  SMTPINIT -- initialize SMTP.
index 1a0236b..7bce454 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 3.107 of %G%";
+static char    SccsId[] = "@(#)SendMail version 3.108 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "3.107 [%G%]";
+char   Version[] = "3.108 [%G%]";