fix serious botch in SMTP reply code delta; change a bunch of
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 30 Aug 1982 08:33:08 +0000 (00:33 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 30 Aug 1982 08:33:08 +0000 (00:33 -0800)
"Internal error" codes to a new "Remote protocol error" -- so that
I don't get blamed for things that other systems do.

SCCS-vsn: usr.sbin/sendmail/src/version.c 3.180
SCCS-vsn: usr.sbin/sendmail/src/sysexits.c 3.4
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 3.19
SCCS-vsn: include/sysexits.h 3.1

usr/src/include/sysexits.h
usr/src/usr.sbin/sendmail/src/sysexits.c
usr/src/usr.sbin/sendmail/src/usersmtp.c
usr/src/usr.sbin/sendmail/src/version.c

index 6b22caf..6ef7505 100644 (file)
 **             is not really an error.  In sendmail, this means
 **             that a mailer (e.g.) could not create a connection,
 **             and the request should be reattempted later.
 **             is not really an error.  In sendmail, this means
 **             that a mailer (e.g.) could not create a connection,
 **             and the request should be reattempted later.
+**     EX_PROTOCOL -- the remote system returned something that
+**             was "not possible" during a protocol exchange.
 **
 **
-**     Maintained by IngVAX:eric (eric@berkeley, ucbvax!eric) --
+**     Maintained by Eric Allman (eric@berkeley, ucbvax!eric) --
 **             please mail changes to me.
 **
 **             please mail changes to me.
 **
-**                     @(#)sysexits.h  1.3     %G%
+**                     @(#)sysexits.h  3.1             %G%
 */
 
 # define EX_OK         0       /* successful termination */
 */
 
 # define EX_OK         0       /* successful termination */
@@ -70,3 +72,4 @@
 # define EX_CANTCREAT  73      /* can't create (user) output file */
 # define EX_IOERR      74      /* input/output error */
 # define EX_TEMPFAIL   75      /* temp failure; user is invited to retry */
 # define EX_CANTCREAT  73      /* can't create (user) output file */
 # define EX_IOERR      74      /* input/output error */
 # define EX_TEMPFAIL   75      /* temp failure; user is invited to retry */
+# define EX_PROTOCOL   76      /* remote error in protocol */
index 54334a9..ddbd54a 100644 (file)
@@ -1,7 +1,7 @@
 # include <sysexits.h>
 # include "useful.h"
 
 # include <sysexits.h>
 # include "useful.h"
 
-SCCSID(@(#)sysexits.c  3.3             %G%);
+SCCSID(@(#)sysexits.c  3.4             %G%);
 
 /*
 **  SYSEXITS.C -- error messages corresponding to sysexits.h
 
 /*
 **  SYSEXITS.C -- error messages corresponding to sysexits.h
@@ -9,18 +9,19 @@ SCCSID(@(#)sysexits.c 3.3             %G%);
 
 char   *SysExMsg[] =
 {
 
 char   *SysExMsg[] =
 {
-       /* 64 */        "Bad usage",
-       /* 65 */        "Data format error",
-       /* 66 */        "Cannot open input",
-       /* 67 */        "User unknown",
-       /* 68 */        "Host unknown",
-       /* 69 */        "Service unavailable",
-       /* 70 */        "Internal error",
-       /* 71 */        "Operating system error",
-       /* 72 */        "System file missing",
-       /* 73 */        "Can't create output",
-       /* 74 */        "I/O error",
-       /* 75 */        "Temporary failure",
+       /* 64 USAGE */          "Bad usage",
+       /* 65 DATAERR */        "Data format error",
+       /* 66 NOINPUT */        "Cannot open input",
+       /* 67 NOUSER */         "User unknown",
+       /* 68 NOHOST */         "Host unknown",
+       /* 69 UNAVAILABLE */    "Service unavailable",
+       /* 70 SOFTWARE */       "Internal error",
+       /* 71 OSERR */          "Operating system error",
+       /* 72 OSFILE */         "System file missing",
+       /* 73 CANTCREAT */      "Can't create output",
+       /* 74 IOERR */          "I/O error",
+       /* 75 TEMPFAIL */       "Temporary failure",
+       /* 76 PROTOCOL */       "Remote protocol error",
 };
 
 int    N_SysEx = sizeof SysExMsg / sizeof SysExMsg[0];
 };
 
 int    N_SysEx = sizeof SysExMsg / sizeof SysExMsg[0];
index cfebe47..230484b 100644 (file)
@@ -3,10 +3,10 @@
 # include "sendmail.h"
 
 # ifndef SMTP
 # include "sendmail.h"
 
 # ifndef SMTP
-SCCSID(@(#)usersmtp.c  3.18            %G%     (no SMTP));
+SCCSID(@(#)usersmtp.c  3.19            %G%     (no SMTP));
 # else SMTP
 
 # else SMTP
 
-SCCSID(@(#)usersmtp.c  3.18            %G%);
+SCCSID(@(#)usersmtp.c  3.19            %G%);
 
 /*
 **  SMTPINIT -- initialize SMTP.
 
 /*
 **  SMTPINIT -- initialize SMTP.
@@ -104,7 +104,7 @@ smtpinit(m, pvp, ctladdr)
                return (EX_OK);
        else if (r == 552)
                return (EX_UNAVAILABLE);
                return (EX_OK);
        else if (r == 552)
                return (EX_UNAVAILABLE);
-       return (EX_SOFTWARE);
+       return (EX_PROTOCOL);
 }
 \f/*
 **  SMTPRCPT -- designate recipient.
 }
 \f/*
 **  SMTPRCPT -- designate recipient.
@@ -133,11 +133,13 @@ smtprcpt(to)
        r = reply();
        if (REPLYTYPE(r) == 4)
                return (EX_TEMPFAIL);
        r = reply();
        if (REPLYTYPE(r) == 4)
                return (EX_TEMPFAIL);
-       else if (REPLYCLASS(r) == 5)
-               return (EX_NOUSER);
        else if (REPLYTYPE(r) == 2)
                return (EX_OK);
        else if (REPLYTYPE(r) == 2)
                return (EX_OK);
-       return (EX_SOFTWARE);
+       else if (r == 550 || r == 551 || r == 553)
+               return (EX_NOUSER);
+       else if (r == 552 || r == 554)
+               return (EX_UNAVAILABLE);
+       return (EX_PROTOCOL);
 }
 \f/*
 **  SMTPFINISH -- finish up sending all the SMTP protocol.
 }
 \f/*
 **  SMTPFINISH -- finish up sending all the SMTP protocol.
@@ -174,7 +176,7 @@ smtpfinish(m, e)
        else if (r == 554)
                return (EX_UNAVAILABLE);
        else if (r != 354)
        else if (r == 554)
                return (EX_UNAVAILABLE);
        else if (r != 354)
-               return (EX_SOFTWARE);
+               return (EX_PROTOCOL);
        (*e->e_puthdr)(SmtpOut, m, CurEnv);
        fprintf(SmtpOut, "\n");
        (*e->e_putbody)(SmtpOut, m, TRUE);
        (*e->e_puthdr)(SmtpOut, m, CurEnv);
        fprintf(SmtpOut, "\n");
        (*e->e_putbody)(SmtpOut, m, TRUE);
@@ -186,7 +188,7 @@ smtpfinish(m, e)
                return (EX_OK);
        else if (r == 552 || r == 554)
                return (EX_UNAVAILABLE);
                return (EX_OK);
        else if (r == 552 || r == 554)
                return (EX_UNAVAILABLE);
-       return (EX_SOFTWARE);
+       return (EX_PROTOCOL);
 }
 \f/*
 **  SMTPQUIT -- close the SMTP connection.
 }
 \f/*
 **  SMTPQUIT -- close the SMTP connection.
index e0d7a25..6cd94bb 100644 (file)
@@ -1,5 +1,5 @@
 # ifndef lint
 # ifndef lint
-static char    SccsId[] = "@(#)SendMail version 3.179 of %G%";
+static char    SccsId[] = "@(#)SendMail version 3.180 of %G%";
 # endif lint
 
 # endif lint
 
-char   Version[] = "3.179 [%G%]";
+char   Version[] = "3.180 [%G%]";