do some stuff to add a "HOPS" command -- it seems like it would
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 5 Jul 1982 01:28:37 +0000 (17:28 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Mon, 5 Jul 1982 01:28:37 +0000 (17:28 -0800)
be easier and smarter to count Mail-From: lines.

SCCS-vsn: usr.sbin/sendmail/src/srvrsmtp.c 3.20.1.1
SCCS-vsn: usr.sbin/sendmail/src/usersmtp.c 3.12.1.1

usr/src/usr.sbin/sendmail/src/srvrsmtp.c
usr/src/usr.sbin/sendmail/src/usersmtp.c

index 8e9c1dd..b82abbe 100644 (file)
@@ -1,10 +1,10 @@
 # include "sendmail.h"
 
 # ifndef SMTP
 # include "sendmail.h"
 
 # ifndef SMTP
-SCCSID(@(#)srvrsmtp.c  3.20            %G%     (no SMTP));
+SCCSID(@(#)srvrsmtp.c  3.20.1.1                %G%     (no SMTP));
 # else SMTP
 
 # else SMTP
 
-SCCSID(@(#)srvrsmtp.c  3.20            %G%);
+SCCSID(@(#)srvrsmtp.c  3.20.1.1                %G%);
 
 /*
 **  SMTP -- run the SMTP protocol.
 
 /*
 **  SMTP -- run the SMTP protocol.
@@ -31,6 +31,7 @@ struct cmd
 # define CMDMAIL       1       /* mail -- designate sender */
 # define CMDRCPT       2       /* rcpt -- designate recipient */
 # define CMDDATA       3       /* data -- send message text */
 # define CMDMAIL       1       /* mail -- designate sender */
 # define CMDRCPT       2       /* rcpt -- designate recipient */
 # define CMDDATA       3       /* data -- send message text */
+# define CMDHOPS       4       /* hops -- specify hop count */
 # define CMDRSET       5       /* rset -- reset state */
 # define CMDVRFY       6       /* vrfy -- verify address */
 # define CMDHELP       7       /* help -- give usage info */
 # define CMDRSET       5       /* rset -- reset state */
 # define CMDVRFY       6       /* vrfy -- verify address */
 # define CMDHELP       7       /* help -- give usage info */
@@ -57,6 +58,7 @@ static struct cmd     CmdTab[] =
        "quit",         CMDQUIT,
        "mrsq",         CMDMRSQ,
        "helo",         CMDHELO,
        "quit",         CMDQUIT,
        "mrsq",         CMDMRSQ,
        "helo",         CMDHELO,
+       "hops",         CMDHOPS,
 # ifdef DEBUG
        "_showq",       CMDDBGSHOWQ,
        "_debug",       CMDDBGDEBUG,
 # ifdef DEBUG
        "_showq",       CMDDBGSHOWQ,
        "_debug",       CMDDBGDEBUG,
@@ -249,6 +251,14 @@ smtp()
                        }
                        break;
 
                        }
                        break;
 
+                 case CMDHOPS:         /* specify hop count */
+                       HopCount = atoi(p);
+                       if (++HopCount > MAXHOP)
+                               message("501", "Hop count exceeded");
+                       else
+                               message("200", "Hop count ok");
+                       break;
+
 # ifdef DEBUG
                  case CMDDBGSHOWQ:     /* show queues */
                        printf("Send Queue=");
 # ifdef DEBUG
                  case CMDDBGSHOWQ:     /* show queues */
                        printf("Send Queue=");
index c000c9a..2ebd874 100644 (file)
@@ -3,10 +3,10 @@
 # include "sendmail.h"
 
 # ifndef SMTP
 # include "sendmail.h"
 
 # ifndef SMTP
-SCCSID(@(#)usersmtp.c  3.12            %G%     (no SMTP));
+SCCSID(@(#)usersmtp.c  3.12.1.1                %G%     (no SMTP));
 # else SMTP
 
 # else SMTP
 
-SCCSID(@(#)usersmtp.c  3.12            %G%);
+SCCSID(@(#)usersmtp.c  3.12.1.1                %G%);
 
 /*
 **  SMTPINIT -- initialize SMTP.
 
 /*
 **  SMTPINIT -- initialize SMTP.
@@ -80,6 +80,14 @@ smtpinit(m, pvp, ctladdr)
        if (REPLYTYPE(r) != 2)
                return (EX_TEMPFAIL);
 
        if (REPLYTYPE(r) != 2)
                return (EX_TEMPFAIL);
 
+       /*
+       **  Send the HOPS command.
+       **      This is non-standard and may give an "unknown command".
+       **              This is not an error.
+       **      It can give a "bad hop count" error if the hop
+       **              count is exceeded.
+       */
+
        /*
        **  Send the MAIL command.
        **      Designates the sender.
        /*
        **  Send the MAIL command.
        **      Designates the sender.