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
# 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));
-SCCSID(@(#)srvrsmtp.c 3.20 %G%);
+SCCSID(@(#)srvrsmtp.c 3.20.1.1 %G%);
/*
** SMTP -- run the SMTP protocol.
/*
** SMTP -- run the SMTP protocol.
# 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 */
"quit", CMDQUIT,
"mrsq", CMDMRSQ,
"helo", CMDHELO,
"quit", CMDQUIT,
"mrsq", CMDMRSQ,
"helo", CMDHELO,
# ifdef DEBUG
"_showq", CMDDBGSHOWQ,
"_debug", CMDDBGDEBUG,
# ifdef DEBUG
"_showq", CMDDBGSHOWQ,
"_debug", CMDDBGDEBUG,
+ 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=");
# 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));
-SCCSID(@(#)usersmtp.c 3.12 %G%);
+SCCSID(@(#)usersmtp.c 3.12.1.1 %G%);
/*
** SMTPINIT -- initialize SMTP.
/*
** SMTPINIT -- initialize SMTP.
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.