From 7d7fdf930b991fe3c2a4a76e960b8019afc3dbb4 Mon Sep 17 00:00:00 2001 From: Eric Allman Date: Sun, 4 Jul 1982 17:28:37 -0800 Subject: [PATCH] do some stuff to add a "HOPS" command -- it seems like it would 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 | 14 ++++++++++++-- usr/src/usr.sbin/sendmail/src/usersmtp.c | 12 ++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c index 8e9c1ddc53..b82abbe876 100644 --- a/usr/src/usr.sbin/sendmail/src/srvrsmtp.c +++ b/usr/src/usr.sbin/sendmail/src/srvrsmtp.c @@ -1,10 +1,10 @@ # 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 -SCCSID(@(#)srvrsmtp.c 3.20 %G%); +SCCSID(@(#)srvrsmtp.c 3.20.1.1 %G%); /* ** 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 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 */ @@ -57,6 +58,7 @@ static struct cmd CmdTab[] = "quit", CMDQUIT, "mrsq", CMDMRSQ, "helo", CMDHELO, + "hops", CMDHOPS, # ifdef DEBUG "_showq", CMDDBGSHOWQ, "_debug", CMDDBGDEBUG, @@ -249,6 +251,14 @@ smtp() } 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="); diff --git a/usr/src/usr.sbin/sendmail/src/usersmtp.c b/usr/src/usr.sbin/sendmail/src/usersmtp.c index c000c9abde..2ebd874d12 100644 --- a/usr/src/usr.sbin/sendmail/src/usersmtp.c +++ b/usr/src/usr.sbin/sendmail/src/usersmtp.c @@ -3,10 +3,10 @@ # 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 -SCCSID(@(#)usersmtp.c 3.12 %G%); +SCCSID(@(#)usersmtp.c 3.12.1.1 %G%); /* ** SMTPINIT -- initialize SMTP. @@ -80,6 +80,14 @@ smtpinit(m, pvp, ctladdr) 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. -- 2.20.1