--- sendmail-8.13.3/sendmail/collect.c~ 2004-12-01 00:29:15.000000000 +0100 +++ sendmail-8.13.3/sendmail/collect.c 2005-03-08 09:43:40.848804648 +0100 @@ -15,6 +15,8 @@ SM_RCSID("@(#)$Id$") +#define MAXHDRZ 512 + static void collecttimeout __P((int)); static void eatfrom __P((char *volatile, ENVELOPE *)); static void collect_doheader __P((ENVELOPE *)); @@ -288,6 +290,7 @@ register ENVELOPE *e; bool rsetsize; { + int hdrz = 0; register SM_FILE_T *volatile df; volatile bool ignrdot; volatile int dbto; @@ -613,6 +616,16 @@ mstate = MS_BODY; goto nextstate; } + + if (hdrz++>MAXHDRZ) + { + sm_syslog(LOG_NOTICE, e->e_id, + "excessive headers from %s during message collect", + CurHostName ? CurHostName : ""); + errno = 0; + usrerr("451 Stop this. You are lame."); + goto readerr; + } /* check for possible continuation line */ do