changes from Tom Ferrin <ucsfcgl!tef>: don't drop messages on the floor
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 12 Aug 1984 08:56:24 +0000 (00:56 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 12 Aug 1984 08:56:24 +0000 (00:56 -0800)
if no local mailer available; give real "errno" message in syserr.

SCCS-vsn: usr.sbin/sendmail/src/err.c 4.4
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 4.9
SCCS-vsn: usr.sbin/sendmail/src/version.c 4.38

usr/src/usr.sbin/sendmail/src/deliver.c
usr/src/usr.sbin/sendmail/src/err.c
usr/src/usr.sbin/sendmail/src/version.c

index d74be77..0d66949 100644 (file)
@@ -3,7 +3,7 @@
 # include "sendmail.h"
 # include <sys/stat.h>
 
 # include "sendmail.h"
 # include <sys/stat.h>
 
-SCCSID(@(#)deliver.c   4.8             %G%);
+SCCSID(@(#)deliver.c   4.9             %G%);
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
 
 /*
 **  DELIVER -- Deliver a message to a list of addresses.
@@ -823,7 +823,10 @@ openmailer(m, pvp, ctladdr, clever, pmfile, prfile)
                printf("Cannot exec '%s' errno=%d\n", m->m_mailer, errno);
                (void) fflush(stdout);
 #endif FIOCLEX
                printf("Cannot exec '%s' errno=%d\n", m->m_mailer, errno);
                (void) fflush(stdout);
 #endif FIOCLEX
-               _exit(EX_UNAVAILABLE);
+               if (m == LocalMailer)
+                       _exit(EX_TEMPFAIL);
+               else
+                       _exit(EX_UNAVAILABLE);
        }
 
        /*
        }
 
        /*
index 7adc13e..8677628 100644 (file)
@@ -1,6 +1,6 @@
 # include "sendmail.h"
 
 # include "sendmail.h"
 
-SCCSID(@(#)err.c       4.3             %G%);
+SCCSID(@(#)err.c       4.4             %G%);
 
 /*
 **  SYSERR -- Print error message.
 
 /*
 **  SYSERR -- Print error message.
@@ -31,22 +31,23 @@ char        MsgBuf[BUFSIZ*2];       /* text of most recent message */
 syserr(fmt, a, b, c, d, e)
        char *fmt;
 {
 syserr(fmt, a, b, c, d, e)
        char *fmt;
 {
+       register char *p;
+       int olderrno = errno;
        extern char Arpa_PSyserr[];
        extern char Arpa_TSyserr[];
        extern char Arpa_PSyserr[];
        extern char Arpa_TSyserr[];
-       register char *p;
 
        /* format and output the error message */
 
        /* format and output the error message */
-       if (errno == 0)
+       if (olderrno == 0)
                p = Arpa_PSyserr;
        else
                p = Arpa_TSyserr;
                p = Arpa_PSyserr;
        else
                p = Arpa_TSyserr;
-       fmtmsg(MsgBuf, (char *) NULL, p, fmt, a, b, c, d, e);
+       fmtmsg(MsgBuf, (char *) NULL, p, olderrno, fmt, a, b, c, d, e);
        puterrmsg(MsgBuf);
 
        /* determine exit status if not already set */
        if (ExitStat == EX_OK)
        {
        puterrmsg(MsgBuf);
 
        /* determine exit status if not already set */
        if (ExitStat == EX_OK)
        {
-               if (errno == 0)
+               if (olderrno == 0)
                        ExitStat = EX_SOFTWARE;
                else
                        ExitStat = EX_OSERR;
                        ExitStat = EX_SOFTWARE;
                else
                        ExitStat = EX_OSERR;
@@ -84,11 +85,12 @@ usrerr(fmt, a, b, c, d, e)
 {
        extern char SuprErrs;
        extern char Arpa_Usrerr[];
 {
        extern char SuprErrs;
        extern char Arpa_Usrerr[];
+       extern int errno;
 
        if (SuprErrs)
                return;
 
 
        if (SuprErrs)
                return;
 
-       fmtmsg(MsgBuf, CurEnv->e_to, Arpa_Usrerr, fmt, a, b, c, d, e);
+       fmtmsg(MsgBuf, CurEnv->e_to, Arpa_Usrerr, errno, fmt, a, b, c, d, e);
        puterrmsg(MsgBuf);
 
        if (QuickAbort)
        puterrmsg(MsgBuf);
 
        if (QuickAbort)
@@ -116,7 +118,7 @@ message(num, msg, a, b, c, d, e)
        register char *msg;
 {
        errno = 0;
        register char *msg;
 {
        errno = 0;
-       fmtmsg(MsgBuf, CurEnv->e_to, num, msg, a, b, c, d, e);
+       fmtmsg(MsgBuf, CurEnv->e_to, num, 0, msg, a, b, c, d, e);
        putmsg(MsgBuf, FALSE);
 }
 \f/*
        putmsg(MsgBuf, FALSE);
 }
 \f/*
@@ -143,7 +145,7 @@ nmessage(num, msg, a, b, c, d, e)
        register char *msg;
 {
        errno = 0;
        register char *msg;
 {
        errno = 0;
-       fmtmsg(MsgBuf, (char *) NULL, num, msg, a, b, c, d, e);
+       fmtmsg(MsgBuf, (char *) NULL, num, 0, msg, a, b, c, d, e);
        putmsg(MsgBuf, FALSE);
 }
 \f/*
        putmsg(MsgBuf, FALSE);
 }
 \f/*
@@ -213,6 +215,7 @@ puterrmsg(msg)
 **             eb -- error buffer to get result.
 **             to -- the recipient tag for this message.
 **             num -- arpanet error number.
 **             eb -- error buffer to get result.
 **             to -- the recipient tag for this message.
 **             num -- arpanet error number.
+**             en -- the error number to display.
 **             fmt -- format of string.
 **             a, b, c, d, e -- arguments.
 **
 **             fmt -- format of string.
 **             a, b, c, d, e -- arguments.
 **
@@ -223,12 +226,13 @@ puterrmsg(msg)
 **             none.
 */
 
 **             none.
 */
 
-/*VARARGS4*/
+/*VARARGS5*/
 static
 static
-fmtmsg(eb, to, num, fmt, a, b, c, d, e)
+fmtmsg(eb, to, num, eno, fmt, a, b, c, d, e)
        register char *eb;
        char *to;
        char *num;
        register char *eb;
        char *to;
        char *num;
+       int en;
        char *fmt;
 {
        char del;
        char *fmt;
 {
        char del;
index df0d53f..2c6731a 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 4.37 of %G%";
+static char    SccsId[] = "@(#)SendMail version 4.38 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "4.37";
+char   Version[] = "4.38";