8.6.2: improved error return messages; better error handling on
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 16 Oct 1993 00:35:05 +0000 (16:35 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sat, 16 Oct 1993 00:35:05 +0000 (16:35 -0800)
hung connections or the name server is down; add "vendor code" on V line;
fix some X-Authentication-Warning: problems; portability fixes

SCCS-vsn: usr.sbin/sendmail/src/READ_ME 8.29
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 8.11
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.30
SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.38
SCCS-vsn: usr.sbin/sendmail/src/collect.c 8.5
SCCS-vsn: usr.sbin/sendmail/src/version.c 8.6.2.1
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.24
SCCS-vsn: usr.sbin/sendmail/src/savemail.c 8.14
SCCS-vsn: usr.sbin/sendmail/src/TODO 8.6
SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 8.17
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 8.13
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 8.31
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.41
SCCS-vsn: usr.sbin/sendmail/src/alias.c 8.17
SCCS-vsn: usr.sbin/sendmail/src/map.c 8.17

15 files changed:
usr/src/usr.sbin/sendmail/src/READ_ME
usr/src/usr.sbin/sendmail/src/TODO
usr/src/usr.sbin/sendmail/src/alias.c
usr/src/usr.sbin/sendmail/src/collect.c
usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h
usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/map.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/srvrsmtp.c
usr/src/usr.sbin/sendmail/src/usersmtp.c
usr/src/usr.sbin/sendmail/src/version.c

index a58e00b..9bd8bc3 100644 (file)
@@ -4,7 +4,7 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#      @(#)READ_ME     8.28 (Berkeley) %G%
+#      @(#)READ_ME     8.29 (Berkeley) %G%
 #
 
 This directory contains the source files for sendmail.
 #
 
 This directory contains the source files for sendmail.
@@ -40,6 +40,9 @@ IMPORTANT:  DO NOT USE OPTIMIZATION (``-O'') IF YOU ARE RUNNING GCC
 2.4.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO
 FAIL MISERABLY.
 
 2.4.x.  THERE IS A BUG IN THE GCC OPTIMIZER THAT CAUSES SENDMAIL TO
 FAIL MISERABLY.
 
+IMPORTANT:  Read the appropriate paragraphs in the section on
+``Operating System and Compile Quirks''.
+
 
 +----------------------+
 | DATABASE DEFINITIONS |
 
 +----------------------+
 | DATABASE DEFINITIONS |
@@ -333,6 +336,49 @@ Linux
        extern int opterr;
        extern int optind;
 
        extern int opterr;
        extern int optind;
 
+A/UX
+       Date: Tue, 12 Oct 1993 18:28:28 -0400 (EDT)
+       From: "Eric C. Hagberg" <hagberg@med.cornell.edu>
+       Subject: Fix for A/UX ndbm
+
+       I guess this isn't really a sendmail bug, however, it is something
+       that A/UX users should be aware of when compiling sendmail 8.6.
+
+       Apparently, the calls that sendmail is using to the ndbm routines
+       in A/UX 3.0.x contain calls to "broken" routines, in that the
+       aliases database will break when it gets "just a little big"
+       (sorry I don't have exact numbers here, but it broke somewhere
+       around 20-25 aliases for me.), making all aliases non-functional
+       after exceeding this point.
+
+       What I did was to get the gnu-dbm-1.6 package, compile it, and
+       then re-compile sendmail with "-lgdbm", "-DNDBM", and using the
+       ndbm.h header file that comes with the gnu-package. This makes
+       things behave properly.
+
+       I suppose porting the New Berkeley db package is another route,
+       however, I made a quick attempt at it, and found it difficult
+       (not easy at least); the gnu-dbm package "configured" and
+       compiled easily.
+
+DG/UX
+       Apparently, /bin/mail doesn't work properly for delivery on
+       DG/UX -- the person who has this working, Douglas Anderson
+       <dlander@afterlife.ncsc.mil>, used procmail instead.
+
+Non-DNS based sites
+       This version of sendmail always tries to connect to the Domain
+       Name System (DNS) to resolve names, regardless of the setting
+       of the `I' option.  On most systems that are not running DNS,
+       this will fail quickly and sendmail will continue, but on some
+       systems it has a long timeout.  If you have this problem, you
+       will have to recompile without NAMED_BIND.  Some people have
+       claimed that they have successfully used "OI+USEVC" to force
+       sendmail to use a virtual circuit -- this will always time out
+       quickly, but also tells sendmail that a failed connection
+       should requeue the message (probably not what you intended).
+       A future release of sendmail will correct this problem.
+
 Both NEWDB and NDBM
        If you use both -DNDBM and -DNEWDB, you must delete the module
        ndbm.o from libdb.a and delete the file "ndbm.h" from the files
 Both NEWDB and NDBM
        If you use both -DNDBM and -DNEWDB, you must delete the module
        ndbm.o from libdb.a and delete the file "ndbm.h" from the files
@@ -408,4 +454,4 @@ version.c   The version number and information about this
 
 Eric Allman
 
 
 Eric Allman
 
-(Version 8.28, last update %G% 16:01:21)
+(Version 8.29, last update %G% 08:34:23)
index 27d61e9..5da75a3 100644 (file)
@@ -1,4 +1,4 @@
-(Version 8.5 of %G%)
+(Version 8.6 of %G%)
 
 Key:
   X -- extension (user visible change)
 
 Key:
   X -- extension (user visible change)
@@ -6,8 +6,6 @@ Key:
   S -- security fix
   E -- enhancement to existing algorithm
 
   S -- security fix
   E -- enhancement to existing algorithm
 
-X **** Database (keyed lookup) locking and rebuild.
-
 X **** 8 -> 7 bit MIME conversion.
 
 E **** Change NoReturn to be an envelope flag. [8.7]
 X **** 8 -> 7 bit MIME conversion.
 
 E **** Change NoReturn to be an envelope flag. [8.7]
@@ -20,9 +18,7 @@ X ****        Merge Sun changes.  [8.7]
 X **** Provide a way to turn off all DNS lookup in the I option, e.g.,
        ``OIoff''.
 
 X **** Provide a way to turn off all DNS lookup in the I option, e.g.,
        ``OIoff''.
 
-E ***  Dynamically allocate MAXNAME buffers for headers.
-
-X ***  Should have new mailer flags to override LocalMailer stuff:
+X **** Should have new mailer flags to override LocalMailer stuff:
        - M_ALIASABLE (A) -- can use as the LHS of an alias.
        - M_HASPWENT (w) -- should have a /etc/passwd entry.  If not found
          there, implies user unknown.  Also implies .forward and UDB
        - M_ALIASABLE (A) -- can use as the LHS of an alias.
        - M_HASPWENT (w) -- should have a /etc/passwd entry.  If not found
          there, implies user unknown.  Also implies .forward and UDB
@@ -34,31 +30,61 @@ X ***       Should have new mailer flags to override LocalMailer stuff:
          should also be split apart.
        [8.8]
 
          should also be split apart.
        [8.8]
 
+E ***  Dynamically allocate MAXNAME buffers for headers.
+
 X ***  Add ability to disable Return-Receipt-To: on a privacy flag. [8.8]
 
 X ***  Add ability to disable Return-Receipt-To: on a privacy flag. [8.8]
 
-X **   Handle Expires: header field (if still in queue).
+X ***  Add -P to set precedence (e.g., -Pbulk). [8.8]  (BCX)
+
+X ***  Runtime option to enable/disable IDENT protocol.
+
+X ***  Allow $x in -bt mode to expand macro "x".  (BCX)  [8.8]
+
+X ***  Allow /address in -bt mode to expand address through ruleset 0,
+       aliases, etc. and display results.  [8.8]
+
+E ***  Don't send ErrMsgFile to postmaster bounces.  (Josh Smith,
+       josh@osiris.ac.hmc.edu).
+
+X ***  Add "user" map to look up a user name via getpwnam -- so that
+       non-local names can be forwarded to another site.  [8.8]
+
+E **   Allow :include: from command line (not SMTP) to assist in
+       "personal list" management -- i.e., creating lists that
+       cannot be EXPNed.
+
+X **   Database (keyed lookup) auto-rebuild.
 
 X **   Find a good test suite and include in the distribution.
 
 
 X **   Find a good test suite and include in the distribution.
 
-S **   [AEJ] You can use symbolic links to point into protected directories.
+S **   You can use symbolic links to point into protected directories.
+       (AEJ)
 
 X **   Extend OI to allow separate settings for canonification, MX, and A
 
 X **   Extend OI to allow separate settings for canonification, MX, and A
-       lookups. [8.8?]
+       lookups.  [8.8?]
 
 
-X **   Add $!x class to match any number of words not in class x [KRE].
+X **   Add $!x class to match any number of words not in class x. (KRE)
 
 X **   LOCAL_RULE_5 (Spencer Sun, spencer@phoenix.Princeton.EDU)
 
 
 X **   LOCAL_RULE_5 (Spencer Sun, spencer@phoenix.Princeton.EDU)
 
-X **   Add "null" map -- no transformation, always returns TRUE, to
-       allow you to break $&x into tokens.  Could be related to dequote.
-       [8.7?]
-
 X **   Add "bestmx" map -- returns "best MX host" for this address.
        Allows you to do automatic detection of when you are the best
        MX for a given address.  [8.7?]
 
 X **   Add "bestmx" map -- returns "best MX host" for this address.
        Allows you to do automatic detection of when you are the best
        MX for a given address.  [8.7?]
 
-E *    Don't send ErrMsgFile to postmaster bounces.  (Josh Smith,
-       josh@osiris.ac.hmc.edu).
+X **   Extend makemap to "gather" values -- i.e., merge entries that
+       have the same keys. [8.8]  (BCX)
+
+E **   Allow error messages on individual addresses in the qf file.
+       (BCX)
+
+X **   Multi-character option names.  [9.1]
+
+X **   User database extensions for mailing lists:
+       list:precedence -- Precedence: value for new message
+       list:envelopefrom -- envelope "from" value for new message
+       others?  [8.8]
+
+X *    Handle Expires: header field (if still in queue).
 
 X *    WIN/3B support (non-atomic rename, no h_addr_list, others?)
        (Bruce Lilly <blilly!bruce@uu.psi.com>)
 
 X *    WIN/3B support (non-atomic rename, no h_addr_list, others?)
        (Bruce Lilly <blilly!bruce@uu.psi.com>)
index d288ce2..d929b3a 100644 (file)
@@ -10,7 +10,7 @@
 # include <pwd.h>
 
 #ifndef lint
 # include <pwd.h>
 
 #ifndef lint
-static char sccsid[] = "@(#)alias.c    8.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)alias.c    8.17 (Berkeley) %G%";
 #endif /* not lint */
 
 
 #endif /* not lint */
 
 
@@ -254,11 +254,25 @@ setalias(spec)
 **  ALIASWAIT -- wait for distinguished @:@ token to appear.
 **
 **     This can decide to reopen or rebuild the alias file
 **  ALIASWAIT -- wait for distinguished @:@ token to appear.
 **
 **     This can decide to reopen or rebuild the alias file
+**
+**     Parameters:
+**             map -- a pointer to the map descriptor for this alias file.
+**             ext -- the filename extension (e.g., ".db") for the
+**                     database file.
+**             isopen -- if set, the database is already open, and we
+**                     should check for validity; otherwise, we are
+**                     just checking to see if it should be created.
+**
+**     Returns:
+**             TRUE -- if the database is open when we return.
+**             FALSE -- if the database is closed when we return.
 */
 
 */
 
-aliaswait(map, ext)
+bool
+aliaswait(map, ext, isopen)
        MAP *map;
        char *ext;
        MAP *map;
        char *ext;
+       int isopen;
 {
        int atcnt;
        time_t mtime;
 {
        int atcnt;
        time_t mtime;
@@ -277,7 +291,7 @@ aliaswait(map, ext)
        {
                auto int st;
 
        {
                auto int st;
 
-               while (atcnt-- >= 0 &&
+               while (isopen && atcnt-- >= 0 &&
                       map->map_class->map_lookup(map, "@", NULL, &st) == NULL)
                {
                        /*
                       map->map_class->map_lookup(map, "@", NULL, &st) == NULL)
                {
                        /*
@@ -290,7 +304,7 @@ aliaswait(map, ext)
 
                        map->map_class->map_close(map);
                        sleep(30);
 
                        map->map_class->map_close(map);
                        sleep(30);
-                       map->map_class->map_open(map, O_RDONLY);
+                       isopen = map->map_class->map_open(map, O_RDONLY);
                }
        }
 
                }
        }
 
@@ -300,14 +314,14 @@ aliaswait(map, ext)
                if (tTd(27, 3))
                        printf("aliaswait: not rebuildable\n");
                map->map_mflags &= ~MF_ALIASWAIT;
                if (tTd(27, 3))
                        printf("aliaswait: not rebuildable\n");
                map->map_mflags &= ~MF_ALIASWAIT;
-               return;
+               return isopen;
        }
        if (stat(map->map_file, &stb) < 0)
        {
                if (tTd(27, 3))
                        printf("aliaswait: no source file\n");
                map->map_mflags &= ~MF_ALIASWAIT;
        }
        if (stat(map->map_file, &stb) < 0)
        {
                if (tTd(27, 3))
                        printf("aliaswait: no source file\n");
                map->map_mflags &= ~MF_ALIASWAIT;
-               return;
+               return isopen;
        }
        mtime = stb.st_mtime;
        (void) strcpy(buf, map->map_file);
        }
        mtime = stb.st_mtime;
        (void) strcpy(buf, map->map_file);
@@ -319,7 +333,10 @@ aliaswait(map, ext)
                if (AutoRebuild && stb.st_ino != 0 && stb.st_uid == geteuid())
                {
                        message("auto-rebuilding alias database %s", buf);
                if (AutoRebuild && stb.st_ino != 0 && stb.st_uid == geteuid())
                {
                        message("auto-rebuilding alias database %s", buf);
+                       if (isopen)
+                               map->map_class->map_close(map);
                        rebuildaliases(map, TRUE);
                        rebuildaliases(map, TRUE);
+                       isopen = map->map_class->map_open(map, O_RDONLY);
                }
                else
                {
                }
                else
                {
@@ -332,6 +349,7 @@ aliaswait(map, ext)
                }
        }
        map->map_mflags &= ~MF_ALIASWAIT;
                }
        }
        map->map_mflags &= ~MF_ALIASWAIT;
+       return isopen;
 }
 \f/*
 **  REBUILDALIASES -- rebuild the alias database.
 }
 \f/*
 **  REBUILDALIASES -- rebuild the alias database.
index b192d64..3facd51 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)collect.c  8.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)collect.c  8.5 (Berkeley) %G%";
 #endif /* not lint */
 
 # include <errno.h>
 #endif /* not lint */
 
 # include <errno.h>
@@ -42,6 +42,7 @@ maketemp(from)
        bool ignrdot = smtpmode ? FALSE : IgnrDot;
        char buf[MAXLINE], buf2[MAXLINE];
        register char *workbuf, *freebuf;
        bool ignrdot = smtpmode ? FALSE : IgnrDot;
        char buf[MAXLINE], buf2[MAXLINE];
        register char *workbuf, *freebuf;
+       bool inputerr = FALSE;
        extern char *hvalue();
        extern bool isheader(), flusheol();
        extern char *index();
        extern char *hvalue();
        extern bool isheader(), flusheol();
        extern char *index();
@@ -216,7 +217,7 @@ maketemp(from)
        **  Collect the body of the message.
        */
 
        **  Collect the body of the message.
        */
 
-       do
+       for (;;)
        {
                register char *bp = buf;
 
        {
                register char *bp = buf;
 
@@ -240,33 +241,47 @@ maketemp(from)
                fputs("\n", tf);
                if (ferror(tf))
                        tferror(tf, e);
                fputs("\n", tf);
                if (ferror(tf))
                        tferror(tf, e);
-       } while (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock,
-                       "message body read") != NULL);
+               if (sfgets(buf, MAXLINE, InChannel, TimeOuts.to_datablock,
+                               "message body read") == NULL)
+                       goto readerr;
+       }
 
 
+       if (feof(InChannel) || ferror(InChannel))
+       {
 readerr:
 readerr:
+               inputerr = TRUE;
+       }
+
        if (fflush(tf) != 0)
                tferror(tf, e);
        (void) fsync(fileno(tf));
        (void) fclose(tf);
 
        /* An EOF when running SMTP is an error */
        if (fflush(tf) != 0)
                tferror(tf, e);
        (void) fsync(fileno(tf));
        (void) fclose(tf);
 
        /* An EOF when running SMTP is an error */
-       if ((feof(InChannel) || ferror(InChannel)) && OpMode == MD_SMTP)
+       if (inputerr && OpMode == MD_SMTP)
        {
                char *host;
        {
                char *host;
+               char *problem;
 
                host = RealHostName;
                if (host == NULL)
                        host = "localhost";
 
 
                host = RealHostName;
                if (host == NULL)
                        host = "localhost";
 
+               if (feof(InChannel))
+                       problem = "unexpected close";
+               else if (ferror(InChannel))
+                       problem = "I/O error";
+               else
+                       problem = "read timeout";
 # ifdef LOG
                if (LogLevel > 0 && feof(InChannel))
                        syslog(LOG_NOTICE,
 # ifdef LOG
                if (LogLevel > 0 && feof(InChannel))
                        syslog(LOG_NOTICE,
-                           "collect: unexpected close on connection from %s, sender=%s: %m\n",
-                           host, e->e_from.q_paddr);
+                           "collect: %s on connection from %s, sender=%s: %m\n",
+                           problem, host, e->e_from.q_paddr);
 # endif
                (feof(InChannel) ? usrerr : syserr)
 # endif
                (feof(InChannel) ? usrerr : syserr)
-                       ("451 collect: unexpected close on connection from %s, from=%s",
-                               host, e->e_from.q_paddr);
+                       ("451 collect: %s on connection from %s, from=%s",
+                               problem, host, e->e_from.q_paddr);
 
                /* don't return an error indication */
                e->e_to = NULL;
 
                /* don't return an error indication */
                e->e_to = NULL;
@@ -274,6 +289,8 @@ readerr:
                e->e_flags |= EF_CLRQUEUE;
 
                /* and don't try to deliver the partial message either */
                e->e_flags |= EF_CLRQUEUE;
 
                /* and don't try to deliver the partial message either */
+               if (InChild)
+                       ExitStat = EX_QUIT;
                finis();
        }
 
                finis();
        }
 
index 08bd876..06b2f27 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     8.40 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     8.41 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -730,6 +730,22 @@ getla()
 #else
 #if LA_TYPE == LA_SUBR
 
 #else
 #if LA_TYPE == LA_SUBR
 
+#ifdef DGUX
+
+#include <sys/dg_sys_info.h>
+
+int getla()
+{
+       struct dg_sys_info_load_info load_info;
+
+       dg_sys_info((long *)&load_info,
+               DG_SYS_INFO_LOAD_INFO_TYPE, DG_SYS_INFO_LOAD_VERSION_0);
+
+       return((int) (load_info.one_minute + 0.5));
+}
+
+#else
+
 getla()
 {
        double avenrun[3];
 getla()
 {
        double avenrun[3];
@@ -745,6 +761,7 @@ getla()
        return ((int) (avenrun[0] + 0.5));
 }
 
        return ((int) (avenrun[0] + 0.5));
 }
 
+#endif /* DGUX */
 #else
 #if LA_TYPE == LA_MACH
 
 #else
 #if LA_TYPE == LA_MACH
 
@@ -1165,6 +1182,28 @@ setsid __P ((void))
 # endif
 }
 
 # endif
 }
 
+#endif
+\f/*
+**  DGUX_INET_ADDR -- inet_addr for DG/UX
+**
+**     Data General DG/UX version of inet_addr returns a struct in_addr
+**     instead of a long.  This patches things.
+*/
+
+#ifdef DGUX
+
+#undef inet_addr
+
+long
+dgux_inet_addr(host)
+       char *host;
+{
+       struct in_addr haddr;
+
+       haddr = inet_addr(host);
+       return haddr.s_addr;
+}
+
 #endif
 \f/*
 **  GETOPT -- for old systems or systems with bogus implementations
 #endif
 \f/*
 **  GETOPT -- for old systems or systems with bogus implementations
@@ -1317,7 +1356,7 @@ vsprintf(s, fmt, ap)
 #endif
 
 #ifdef HASSTATFS
 #endif
 
 #ifdef HASSTATFS
-# if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV)
+# if defined(IRIX) || defined(apollo) || defined(_SCO_unix_) || defined(UMAXV) || defined(DGUX)
 #  include <sys/statfs.h>
 # else
 #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE)
 #  include <sys/statfs.h>
 # else
 #  if (defined(sun) && !defined(BSD)) || defined(__hpux) || defined(_CONVEX_SOURCE) || defined(NeXT) || defined(_AUX_SOURCE)
@@ -1357,7 +1396,7 @@ freespace(dir, bsize)
 # if defined(HASUSTAT)
        if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
 # else
 # if defined(HASUSTAT)
        if (stat(dir, &statbuf) == 0 && ustat(statbuf.st_dev, &fs) == 0)
 # else
-#  if defined(IRIX) || defined(apollo) || defined(UMAXV)
+#  if defined(IRIX) || defined(apollo) || defined(UMAXV) || defined(DGUX)
        if (statfs(dir, &fs, sizeof fs, 0) == 0)
 #  else
 #   if defined(ultrix)
        if (statfs(dir, &fs, sizeof fs, 0) == 0)
 #  else
 #   if defined(ultrix)
@@ -1663,3 +1702,20 @@ getcfname()
                return ConfFile;
        return _PATH_SENDMAILCF;
 }
                return ConfFile;
        return _PATH_SENDMAILCF;
 }
+\f/*
+**  SETVENDOR -- process vendor code from V configuration line
+**
+**     Parameters:
+**             vendor -- string representation of vendor.
+**
+**     Returns:
+**             TRUE -- if ok.
+**             FALSE -- if vendor code could not be processed.
+*/
+
+bool
+setvendor(vendor)
+       char *vendor;
+{
+       return (strcasecmp(vendor, "Berkeley") == 0);
+}
index a777e79..0d07145 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      8.37 (Berkeley) %G%
+ *     @(#)conf.h      8.38 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 # endif
 #endif
 
 # endif
 #endif
 
+/*
+** DG/UX 5.4.2
+*/
+
+#ifdef DGUX
+# define SYSTEM5       1
+# define LA_TYPE       LA_SUBR
+# define HASSTATFS     1       /* has the statfs(2) syscall */
+# define HASSETREUID   1       /* has setreuid(2) call */
+# define HASUNAME      1       /* use System V uname(2) system call */
+# define HASSETSID     1       /* has Posix setsid(2) call */
+# define HASINITGROUPS 1       /* has initgroups(3) call */
+# define HASSETVBUF    1       /* we have setvbuf(3) in libc */
+# undef IDENTPROTO             /* TCP/IP implementation is broken */
+# undef SETPROCTITLE
+# define inet_addr     dgux_inet_addr
+extern long    dgux_inet_addr();
+#endif
+
 
 /*
 **  Digital Ultrix 4.2A or 4.3
 
 /*
 **  Digital Ultrix 4.2A or 4.3
@@ -276,7 +295,7 @@ typedef int         pid_t;
 # define HASSTATFS     1       /* has the statfs(2) syscall */
 # define FORK          fork
 # define MAXPATHLEN    PATHSIZE
 # define HASSTATFS     1       /* has the statfs(2) syscall */
 # define FORK          fork
 # define MAXPATHLEN    PATHSIZE
-# define LA_TYPE       LA_ZERO
+# define LA_TYPE       LA_SHORT
 #endif
 
 
 #endif
 
 
@@ -359,6 +378,7 @@ typedef int         pid_t;
 # define HASUSTAT      1       /* use System V ustat(2) syscall */
 # define HASSETVBUF    1       /* we have setvbuf(3) in libc */
 # define SIGFUNC_DEFINED       /* sigfunc_t already defined */
 # define HASUSTAT      1       /* use System V ustat(2) syscall */
 # define HASSETVBUF    1       /* we have setvbuf(3) in libc */
 # define SIGFUNC_DEFINED       /* sigfunc_t already defined */
+# undef IDENTPROTO             /* TCP/IP implementation is broken */
 # define FORK          fork
 # ifndef _PATH_SENDMAILCF
 #  define _PATH_SENDMAILCF     "/usr/lib/sendmail.cf"
 # define FORK          fork
 # ifndef _PATH_SENDMAILCF
 #  define _PATH_SENDMAILCF     "/usr/lib/sendmail.cf"
@@ -431,8 +451,8 @@ extern struct group *getgrent(), *getgrnam(), *getgrgid();
 
 /* general POSIX defines */
 #ifdef _POSIX_VERSION
 
 /* general POSIX defines */
 #ifdef _POSIX_VERSION
-# define HASSETSID     1       /* has setsid(2) call */
-# define HASWAITPID    1       /* has waitpid(2) call */
+# define HASSETSID     1       /* has Posix setsid(2) call */
+# define HASWAITPID    1       /* has Posix waitpid(2) call */
 #endif
 
 /*
 #endif
 
 /*
@@ -472,6 +492,10 @@ extern struct group        *getgrent(), *getgrnam(), *getgrgid();
 # define EX_CONFIG     78      /* configuration error */
 # endif
 
 # define EX_CONFIG     78      /* configuration error */
 # endif
 
+/* pseudo-code used in server SMTP */
+# define EX_QUIT       22      /* drop out of server immediately */
+
+
 /*
 **  These are used in a few cases where we need some special
 **  error codes, but where the system doesn't provide something
 /*
 **  These are used in a few cases where we need some special
 **  error codes, but where the system doesn't provide something
index 781000a..d6b74d3 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)deliver.c  8.30 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c  8.31 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -591,6 +591,7 @@ deliver(e, firstto)
        char rpathbuf[MAXNAME];         /* translated return path */
        extern int checkcompat();
        extern FILE *fdopen();
        char rpathbuf[MAXNAME];         /* translated return path */
        extern int checkcompat();
        extern FILE *fdopen();
+       extern char SmtpError[];
 
        errno = 0;
        if (!ForceMail && bitset(QDONTSEND|QPSEUDO, to->q_flags))
 
        errno = 0;
        if (!ForceMail && bitset(QDONTSEND|QPSEUDO, to->q_flags))
@@ -608,6 +609,7 @@ deliver(e, firstto)
        host = to->q_host;
        CurEnv = e;                     /* just in case */
        e->e_statmsg = NULL;
        host = to->q_host;
        CurEnv = e;                     /* just in case */
        e->e_statmsg = NULL;
+       SmtpError[0] = '\0';
 
        if (tTd(10, 1))
                printf("\n--deliver, mailer=%d, host=`%s', first user=`%s'\n",
 
        if (tTd(10, 1))
                printf("\n--deliver, mailer=%d, host=`%s', first user=`%s'\n",
@@ -718,7 +720,7 @@ deliver(e, firstto)
                *pvp = NULL;
 # else /* SMTP */
                /* oops!  we don't implement SMTP */
                *pvp = NULL;
 # else /* SMTP */
                /* oops!  we don't implement SMTP */
-               syserr("554 SMTP style mailer");
+               syserr("554 SMTP style mailer not implemented");
                return (EX_SOFTWARE);
 # endif /* SMTP */
        }
                return (EX_SOFTWARE);
 # endif /* SMTP */
        }
@@ -928,6 +930,7 @@ deliver(e, firstto)
 
        curhost = NULL;
        SmtpPhase = NULL;
 
        curhost = NULL;
        SmtpPhase = NULL;
+       mci = NULL;
 
 #ifdef XDEBUG
        {
 
 #ifdef XDEBUG
        {
@@ -939,7 +942,6 @@ deliver(e, firstto)
        }
 #endif
 
        }
 #endif
 
-
        /* check for Local Person Communication -- not for mortals!!! */
        if (strcmp(m->m_mailer, "[LPC]") == 0)
        {
        /* check for Local Person Communication -- not for mortals!!! */
        if (strcmp(m->m_mailer, "[LPC]") == 0)
        {
@@ -970,7 +972,7 @@ deliver(e, firstto)
                if (!clever)
                {
                        syserr("554 non-clever IPC");
                if (!clever)
                {
                        syserr("554 non-clever IPC");
-                       rcode = EX_OSERR;
+                       rcode = EX_CONFIG;
                        goto give_up;
                }
                if (pv[2] != NULL)
                        goto give_up;
                }
                if (pv[2] != NULL)
@@ -978,18 +980,20 @@ deliver(e, firstto)
                else
                        port = 0;
 tryhost:
                else
                        port = 0;
 tryhost:
-               mci = NULL;
                while (*curhost != '\0')
                {
                        register char *p;
                        static char hostbuf[MAXNAME];
 
                while (*curhost != '\0')
                {
                        register char *p;
                        static char hostbuf[MAXNAME];
 
-                       mci = NULL;
-
                        /* pull the next host from the signature */
                        p = strchr(curhost, ':');
                        if (p == NULL)
                                p = &curhost[strlen(curhost)];
                        /* pull the next host from the signature */
                        p = strchr(curhost, ':');
                        if (p == NULL)
                                p = &curhost[strlen(curhost)];
+                       if (p == curhost)
+                       {
+                               syserr("deliver: null host name in signature");
+                               continue;
+                       }
                        strncpy(hostbuf, curhost, p - curhost);
                        hostbuf[p - curhost] = '\0';
                        if (*p != '\0')
                        strncpy(hostbuf, curhost, p - curhost);
                        hostbuf[p - curhost] = '\0';
                        if (*p != '\0')
@@ -1037,16 +1041,24 @@ tryhost:
                                printf("openmailer: makeconnection => stat=%d, errno=%d\n",
                                        i, errno);
 
                                printf("openmailer: makeconnection => stat=%d, errno=%d\n",
                                        i, errno);
 
-
                        /* enter status of this host */
                        setstat(i);
                        /* enter status of this host */
                        setstat(i);
+
+                       /* should print some message here for -v mode */
+               }
+               if (mci == NULL)
+               {
+                       syserr("deliver: no host name");
+                       rcode = EX_OSERR;
+                       goto give_up;
                }
                mci->mci_pid = 0;
 #else /* no DAEMON */
                syserr("554 openmailer: no IPC");
                if (tTd(11, 1))
                        printf("openmailer: NULL\n");
                }
                mci->mci_pid = 0;
 #else /* no DAEMON */
                syserr("554 openmailer: no IPC");
                if (tTd(11, 1))
                        printf("openmailer: NULL\n");
-               return NULL;
+               rcode = EX_UNAVAILABLE;
+               goto give_up;
 #endif /* DAEMON */
        }
        else
 #endif /* DAEMON */
        }
        else
@@ -1387,7 +1399,8 @@ tryhost:
 #endif
 
        /* arrange a return receipt if requested */
 #endif
 
        /* arrange a return receipt if requested */
-       if (e->e_receiptto != NULL && bitnset(M_LOCALMAILER, m->m_flags))
+       if (rcode == EX_OK && e->e_receiptto != NULL &&
+           bitnset(M_LOCALMAILER, m->m_flags))
        {
                e->e_flags |= EF_SENDRECEIPT;
                /* do we want to send back more info? */
        {
                e->e_flags |= EF_SENDRECEIPT;
                /* do we want to send back more info? */
@@ -1411,6 +1424,12 @@ tryhost:
                {
                        to->q_flags |= QSENT;
                        e->e_nsent++;
                {
                        to->q_flags |= QSENT;
                        e->e_nsent++;
+                       if (e->e_receiptto != NULL &&
+                           bitnset(M_LOCALMAILER, m->m_flags))
+                       {
+                               fprintf(e->e_xfp, "%s... Successfully delivered\n",
+                                       to->q_paddr);
+                       }
                }
        }
 
                }
        }
 
@@ -1640,7 +1659,13 @@ giveresponse(stat, m, mci, e)
        */
 
        if (stat == EX_OK || stat == EX_TEMPFAIL)
        */
 
        if (stat == EX_OK || stat == EX_TEMPFAIL)
+       {
+               extern char MsgBuf[];
+
                message(&statmsg[4], errstring(errno));
                message(&statmsg[4], errstring(errno));
+               if (stat == EX_TEMPFAIL && e->e_xfp != NULL)
+                       fprintf(e->e_xfp, "%s\n", &MsgBuf[4]);
+       }
        else
        {
                Errors++;
        else
        {
                Errors++;
@@ -1855,7 +1880,7 @@ putbody(fp, m, e, separator)
 
                if (ferror(e->e_dfp))
                {
 
                if (ferror(e->e_dfp))
                {
-                       syserr("putbody: read error");
+                       syserr("putbody: %s: read error", e->e_df);
                        ExitStat = EX_IOERR;
                }
        }
                        ExitStat = EX_IOERR;
                }
        }
index c01fe87..baf0057 100644 (file)
@@ -13,7 +13,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     8.29 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     8.30 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -73,6 +73,7 @@ char          *UserEnviron[MAXUSERENVIRON + 2];
                                /* saved user environment */
 char           RealUserName[256];      /* the actual user id on this host */
 char           *CommandLineArgs;       /* command line args for pid file */
                                /* saved user environment */
 char           RealUserName[256];      /* the actual user id on this host */
 char           *CommandLineArgs;       /* command line args for pid file */
+bool           Warn_Q_option = FALSE;  /* warn about Q option use */
 
 /*
 **  Pointers for setproctitle.
 
 /*
 **  Pointers for setproctitle.
@@ -111,6 +112,8 @@ main(argc, argv, envp)
        int j;
        bool queuemode = FALSE;         /* process queue requests */
        bool safecf = TRUE;
        int j;
        bool queuemode = FALSE;         /* process queue requests */
        bool safecf = TRUE;
+       bool warn_C_flag = FALSE;
+       char warn_f_flag = '\0';
        static bool reenter = FALSE;
        char *argv0 = argv[0];
        struct passwd *pw;
        static bool reenter = FALSE;
        char *argv0 = argv[0];
        struct passwd *pw;
@@ -427,9 +430,7 @@ main(argc, argv, envp)
 
                  case 'C':     /* select configuration file (already done) */
                        if (RealUid != 0)
 
                  case 'C':     /* select configuration file (already done) */
                        if (RealUid != 0)
-                               auth_warning(CurEnv,
-                                       "Processed by %s with -C %s",
-                                       RealUserName, optarg);
+                               warn_C_flag = TRUE;
                        ConfFile = optarg;
                        (void) setgid(RealGid);
                        (void) setuid(RealUid);
                        ConfFile = optarg;
                        (void) setgid(RealGid);
                        (void) setuid(RealUid);
@@ -449,9 +450,7 @@ main(argc, argv, envp)
                        }
                        from = newstr(optarg);
                        if (strcmp(RealUserName, from) != 0)
                        }
                        from = newstr(optarg);
                        if (strcmp(RealUserName, from) != 0)
-                               auth_warning(CurEnv,
-                                       "%s set sender to %s using -%c",
-                                       RealUserName, from, j);
+                               warn_f_flag = j;
                        break;
 
                  case 'F':     /* set full name */
                        break;
 
                  case 'F':     /* set full name */
@@ -595,6 +594,19 @@ main(argc, argv, envp)
                printf("\n");
        }
 
                printf("\n");
        }
 
+       /*
+       **  Process authorization warnings from command line.
+       */
+
+       if (warn_C_flag)
+               auth_warning(CurEnv, "Processed by %s with -C %s",
+                       RealUserName, ConfFile);
+       if (warn_f_flag != '\0')
+               auth_warning(CurEnv, "%s set sender to %s using -%c",
+                       RealUserName, from, warn_f_flag);
+       if (Warn_Q_option)
+               auth_warning(CurEnv, "Processed from queue %s", QueueDir);
+
        /* Enforce use of local time (null string overrides this) */
        if (TimeZoneSpec == NULL)
                unsetenv("TZ");
        /* Enforce use of local time (null string overrides this) */
        if (TimeZoneSpec == NULL)
                unsetenv("TZ");
index 91b1396..f725a03 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)map.c      8.16 (Berkeley) %G%";
+static char sccsid[] = "@(#)map.c      8.17 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -59,6 +59,8 @@ static char sccsid[] = "@(#)map.c     8.16 (Berkeley) %G%";
 */
 
 #define DBMMODE                0644
 */
 
 #define DBMMODE                0644
+
+extern bool    aliaswait __P((MAP *, char *, int));
 \f/*
 **  MAP_PARSEARGS -- parse config line arguments for database lookup
 **
 \f/*
 **  MAP_PARSEARGS -- parse config line arguments for database lookup
 **
@@ -397,14 +399,19 @@ ndbm_map_open(map, mode)
        dbm = dbm_open(map->map_file, mode, DBMMODE);
        if (dbm == NULL)
        {
        dbm = dbm_open(map->map_file, mode, DBMMODE);
        if (dbm == NULL)
        {
+#ifdef MAYBENEXTRELEASE
+               if (aliaswait(map, ".pag", FALSE))
+                       return TRUE;
+#endif
                if (!bitset(MF_OPTIONAL, map->map_mflags))
                        syserr("Cannot open DBM database %s", map->map_file);
                return FALSE;
        }
        map->map_db1 = (void *) dbm;
        if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
                if (!bitset(MF_OPTIONAL, map->map_mflags))
                        syserr("Cannot open DBM database %s", map->map_file);
                return FALSE;
        }
        map->map_db1 = (void *) dbm;
        if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
-               aliaswait(map, ".pag");
-       if (fstat(dbm_dirfno(dbm), &st) >= 0)
+               if (!aliaswait(map, ".pag", TRUE))
+                       return FALSE;
+       if (fstat(dbm_dirfno((DBM *) map->map_db1), &st) >= 0)
                map->map_mtime = st.st_mtime;
        return TRUE;
 }
                map->map_mtime = st.st_mtime;
        return TRUE;
 }
@@ -595,6 +602,10 @@ bt_map_open(map, mode)
        db = dbopen(buf, omode, DBMMODE, DB_BTREE, NULL);
        if (db == NULL)
        {
        db = dbopen(buf, omode, DBMMODE, DB_BTREE, NULL);
        if (db == NULL)
        {
+#ifdef MAYBENEXTRELEASE
+               if (aliaswait(map, ".db", FALSE))
+                       return TRUE;
+#endif
                if (!bitset(MF_OPTIONAL, map->map_mflags))
                        syserr("Cannot open BTREE database %s", map->map_file);
                return FALSE;
                if (!bitset(MF_OPTIONAL, map->map_mflags))
                        syserr("Cannot open BTREE database %s", map->map_file);
                return FALSE;
@@ -628,7 +639,8 @@ bt_map_open(map, mode)
 
        map->map_db2 = (void *) db;
        if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
 
        map->map_db2 = (void *) db;
        if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
-               aliaswait(map, ".db");
+               if (!aliaswait(map, ".db", TRUE))
+                       return FALSE;
        return TRUE;
 }
 
        return TRUE;
 }
 
@@ -674,6 +686,10 @@ hash_map_open(map, mode)
        db = dbopen(buf, omode, DBMMODE, DB_HASH, NULL);
        if (db == NULL)
        {
        db = dbopen(buf, omode, DBMMODE, DB_HASH, NULL);
        if (db == NULL)
        {
+#ifdef MAYBENEXTRELEASE
+               if (aliaswait(map, ".db", FALSE))
+                       return TRUE;
+#endif
                if (!bitset(MF_OPTIONAL, map->map_mflags))
                        syserr("Cannot open HASH database %s", map->map_file);
                return FALSE;
                if (!bitset(MF_OPTIONAL, map->map_mflags))
                        syserr("Cannot open HASH database %s", map->map_file);
                return FALSE;
@@ -707,7 +723,8 @@ hash_map_open(map, mode)
 
        map->map_db2 = (void *) db;
        if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
 
        map->map_db2 = (void *) db;
        if (mode == O_RDONLY && bitset(MF_ALIAS, map->map_mflags))
-               aliaswait(map, ".db");
+               if (!aliaswait(map, ".db", TRUE))
+                       return FALSE;
        return TRUE;
 }
 
        return TRUE;
 }
 
@@ -1159,11 +1176,13 @@ impl_map_open(map, mode)
        struct stat stb;
 
        if (tTd(38, 2))
        struct stat stb;
 
        if (tTd(38, 2))
-               printf("impl_map_open(%s)\n", map->map_file);
+               printf("impl_map_open(%s, %d)\n", map->map_file, mode);
 
        if (stat(map->map_file, &stb) < 0)
        {
                /* no alias file at all */
 
        if (stat(map->map_file, &stb) < 0)
        {
                /* no alias file at all */
+               if (tTd(38, 3))
+                       printf("no map file\n");
                return FALSE;
        }
 
                return FALSE;
        }
 
index 7c8d3cb..10b3e17 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)readcf.c   8.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c   8.13 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -44,7 +44,9 @@ static char sccsid[] = "@(#)readcf.c  8.12 (Berkeley) %G%";
 **                             Args specify mailer parameters.
 **             Oxvalue         Set option x to value.
 **             Pname=value     Set precedence name to value.
 **                             Args specify mailer parameters.
 **             Oxvalue         Set option x to value.
 **             Pname=value     Set precedence name to value.
-**             Vversioncode    Version level of configuration syntax.
+**             Vversioncode[/vendorcode]
+**                             Version level/vendor name of
+**                             configuration syntax.
 **             Kmapname mapclass arguments....
 **                             Define keyed lookup of a given class.
 **                             Arguments are class dependent.
 **             Kmapname mapclass arguments....
 **                             Define keyed lookup of a given class.
 **                             Arguments are class dependent.
@@ -72,6 +74,7 @@ readcf(cfname)
        char *q;
        struct rewrite *rwp = NULL;
        char *bp;
        char *q;
        struct rewrite *rwp = NULL;
        char *bp;
+       auto char *ep;
        int nfuzzy;
        char *file;
        bool optional;
        int nfuzzy;
        char *file;
        bool optional;
@@ -179,6 +182,7 @@ readcf(cfname)
                }
 
                /* interpret this line */
                }
 
                /* interpret this line */
+               errno = 0;
                switch (bp[0])
                {
                  case '\0':
                switch (bp[0])
                {
                  case '\0':
@@ -466,7 +470,7 @@ readcf(cfname)
                                        &bp[1]);
                                break;
                        }
                                        &bp[1]);
                                break;
                        }
-                       ConfigLevel = atoi(p);
+                       ConfigLevel = strtol(p, &ep, 10);
                        if (ConfigLevel >= 5)
                        {
                                /* level 5 configs have short name in $w */
                        if (ConfigLevel >= 5)
                        {
                                /* level 5 configs have short name in $w */
@@ -474,6 +478,17 @@ readcf(cfname)
                                if (p != NULL && (p = strchr(p, '.')) != NULL)
                                        *p = '\0';
                        }
                                if (p != NULL && (p = strchr(p, '.')) != NULL)
                                        *p = '\0';
                        }
+                       if (*ep++ == '/')
+                       {
+                               /* extract vendor code */
+                               for (p = ep; isascii(*p) && isalpha(*p); )
+                                       p++;
+                               *p = '\0';
+
+                               if (!setvendor(ep))
+                                       syserr("invalid V line vendor code: \"%s\"",
+                                               ep);
+                       }
                        break;
 
                  case 'K':
                        break;
 
                  case 'K':
@@ -992,6 +1007,7 @@ setoption(opt, val, sticky)
        extern time_t convtime();
        extern int QueueLA;
        extern int RefuseLA;
        extern time_t convtime();
        extern int QueueLA;
        extern int RefuseLA;
+       extern bool Warn_Q_option;
        extern bool trusteduser();
 
        if (tTd(37, 1))
        extern bool trusteduser();
 
        if (tTd(37, 1))
@@ -1287,7 +1303,7 @@ setoption(opt, val, sticky)
                else
                        QueueDir = newstr(val);
                if (RealUid != 0 && !safe)
                else
                        QueueDir = newstr(val);
                if (RealUid != 0 && !safe)
-                       auth_warning(e, "Processed from queue %s", QueueDir);
+                       Warn_Q_option = TRUE;
                break;
 
          case 'R':             /* don't prune routes */
                break;
 
          case 'R':             /* don't prune routes */
index 6f2bd3f..71d1f8f 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)savemail.c 8.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)savemail.c 8.14 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -571,7 +571,23 @@ errbody(fp, m, e)
        **  Output introductory information.
        */
 
        **  Output introductory information.
        */
 
-       sprintf(buf, "The original message was received at %s", arpadate(NULL));
+       for (q = e->e_parent->e_sendqueue; q != NULL; q = q->q_next)
+               if (bitset(QBADADDR, q->q_flags))
+                       break;
+       if (q == NULL)
+       {
+               putline("    **********************************************",
+                       fp, m);
+               putline("    **      THIS IS A WARNING MESSAGE ONLY      **",
+                       fp, m);
+               putline("    **  YOU DO NOT NEED TO RESEND YOUR MESSAGE  **",
+                       fp, m);
+               putline("    **********************************************",
+                       fp, m);
+               putline("", fp, m);
+       }
+       sprintf(buf, "The original message was received at %s",
+               arpadate(ctime(&e->e_parent->e_ctime)));
        putline(buf, fp, m);
        expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
        putline(buf, fp, m);
        putline(buf, fp, m);
        expand("from \201_", buf, &buf[sizeof buf - 1], e->e_parent);
        putline(buf, fp, m);
index a97cecb..468dac0 100644 (file)
@@ -791,6 +791,7 @@ EXTERN bool MatchGecos;     /* look for user names in gecos field */
 EXTERN bool    UseErrorsTo;    /* use Errors-To: header (back compat) */
 EXTERN bool    TryNullMXList;  /* if we are the best MX, try host directly */
 EXTERN bool    CheckLoopBack;  /* check for loopback on HELO packet */
 EXTERN bool    UseErrorsTo;    /* use Errors-To: header (back compat) */
 EXTERN bool    TryNullMXList;  /* if we are the best MX, try host directly */
 EXTERN bool    CheckLoopBack;  /* check for loopback on HELO packet */
+EXTERN bool    InChild;        /* true if running in an SMTP subprocess */
 EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 EXTERN char    *ConfFile;      /* location of configuration file [conf.c] */
 EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 EXTERN char    *ConfFile;      /* location of configuration file [conf.c] */
index d76aa4b..5e06da3 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)srvrsmtp.c 8.16 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.17 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)srvrsmtp.c 8.16 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)srvrsmtp.c 8.17 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -90,11 +90,8 @@ static struct cmd    CmdTab[] =
        NULL,           CMDERROR,
 };
 
        NULL,           CMDERROR,
 };
 
-bool   InChild = FALSE;                /* true if running in a subprocess */
 bool   OneXact = FALSE;                /* one xaction only this run */
 
 bool   OneXact = FALSE;                /* one xaction only this run */
 
-#define EX_QUIT                22              /* special code for QUIT command */
-
 static char    *skipword();
 
 smtp(e)
 static char    *skipword();
 
 smtp(e)
@@ -434,7 +431,9 @@ smtp(e)
                        e->e_to = p;
                        if (!bitset(QBADADDR, a->q_flags))
                        {
                        e->e_to = p;
                        if (!bitset(QBADADDR, a->q_flags))
                        {
-                               message("250 Recipient ok");
+                               message("250 Recipient ok%s",
+                                       bitset(QQUEUEUP, a->q_flags) ?
+                                               " (will queue)" : "");
                                nrcpts++;
                        }
                        else
                                nrcpts++;
                        }
                        else
@@ -452,7 +451,7 @@ smtp(e)
                                message("503 Need MAIL command");
                                break;
                        }
                                message("503 Need MAIL command");
                                break;
                        }
-                       else if (e->e_nrcpts <= 0)
+                       else if (nrcpts <= 0)
                        {
                                message("503 Need RCPT (recipient)");
                                break;
                        {
                                message("503 Need RCPT (recipient)");
                                break;
index 6a922c9..74a774a 100644 (file)
@@ -10,9 +10,9 @@
 
 #ifndef lint
 #ifdef SMTP
 
 #ifndef lint
 #ifdef SMTP
-static char sccsid[] = "@(#)usersmtp.c 8.10 (Berkeley) %G% (with SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.11 (Berkeley) %G% (with SMTP)";
 #else
 #else
-static char sccsid[] = "@(#)usersmtp.c 8.10 (Berkeley) %G% (without SMTP)";
+static char sccsid[] = "@(#)usersmtp.c 8.11 (Berkeley) %G% (without SMTP)";
 #endif
 #endif /* not lint */
 
 #endif
 #endif /* not lint */
 
@@ -506,6 +506,16 @@ smtpdata(m, mci, e)
 
        clrevent(ev);
 
 
        clrevent(ev);
 
+       if (ferror(mci->mci_out))
+       {
+               /* error during processing -- don't send the dot */
+               mci->mci_errno = EIO;
+               mci->mci_exitstat = EX_IOERR;
+               mci->mci_state = MCIS_ERROR;
+               smtpquit(m, mci, e);
+               return EX_IOERR;
+       }
+
        /* terminate the message */
        fprintf(mci->mci_out, ".%s", m->m_eol);
        if (TrafficLogFile != NULL)
        /* terminate the message */
        fprintf(mci->mci_out, ".%s", m->m_eol);
        if (TrafficLogFile != NULL)
index 7bca0c2..35cd3cd 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)version.c  8.6.1.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c  8.6.2.1 (Berkeley) %G%";
 #endif /* not lint */
 
 #endif /* not lint */
 
-char   Version[] = "8.6.1";
+char   Version[] = "8.6.2";