SCCS-vsn: usr.sbin/sendmail/src/collect.c 3.41
SCCS-vsn: usr.sbin/sendmail/src/headers.c 3.20
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-SCCSID(@(#)collect.c 3.40 %G%);
+SCCSID(@(#)collect.c 3.41 %G%);
/*
** COLLECT -- read & parse message header & make temp file.
/*
** COLLECT -- read & parse message header & make temp file.
.... so we will ignore the problem for the time being */
}
.... so we will ignore the problem for the time being */
}
+ /* check for hop count overflow */
+ if (HopCount > MAXHOP)
+ syserr("Too many hops (%d max); probably forwarding loop", MAXHOP);
+
if ((TempFile = fopen(CurEnv->e_df, "r")) == NULL)
syserr("Cannot reopen %s", CurEnv->e_df);
if ((TempFile = fopen(CurEnv->e_df, "r")) == NULL)
syserr("Cannot reopen %s", CurEnv->e_df);
# include <errno.h>
# include "sendmail.h"
# include <errno.h>
# include "sendmail.h"
-SCCSID(@(#)headers.c 3.19 %G%);
+SCCSID(@(#)headers.c 3.20 %G%);
/*
** CHOMPHEADER -- process and save a header line.
/*
** CHOMPHEADER -- process and save a header line.
if (QueueRun && h != NULL && bitset(H_FORCE, h->h_flags))
return (h->h_flags);
if (QueueRun && h != NULL && bitset(H_FORCE, h->h_flags))
return (h->h_flags);
+ /* count Mail-From: lines to avoid loops (simulate hop counts) */
+ if (strcmp(fname, "mail-from") == 0)
+ HopCount++;
+
/* create/fill in a new node */
if (h == NULL || bitset(H_FORCE, h->h_flags))
{
/* create/fill in a new node */
if (h == NULL || bitset(H_FORCE, h->h_flags))
{