Re: [EXIM] ridiculously long header

Top Page
Delete this message
Reply to this message
Author: Paul Mansfield
Date:  
To: Philip Hazel
CC: Exim users mailing list
Subject: Re: [EXIM] ridiculously long header
On Fri, 7 May 1999, Philip Hazel wrote:
> "junk: aaaaaaaaaaaaaaaaa......." forever, tying up an SMTP channel and
> eventually filling all your memory (Exim keeps headers in memory). I
> chose 8192 (8191 + a zero terminator) as what I thought was a
> sufficiently high number that no reasonable header would ever reach it.
> It is trivial to compile Exim with a larger number if you want to.


I guess strictly speaking you should work out how long a header could be
theoretically. If you had two hosts talking to each other and both had the
maximum length of a hostname possible allowed by DNS, then you had all the
other logs, you'd probably end up with something in your code which looked like
this, to allow for a header vaguely in the format

    host <H1> a.b.c.d received message from <H2> w.x.y.z blah blah blah


/* RFC limits the domain to a1.s2....a127, each part being 63 chars in total */
#define MAX_DNS_LEVELS  127
#define MAX_DNS_PART    63
#define MAX_DOM_LENGTH  ((MAX_DNS_PART + 1) * MAX_DNS_LEVELS)
#define MAX_HEADER_LENGTH (MAX_DOM_LENGTH * 2 + 256)


where 256 is some arbitrary fiddle factor to allow for all the other bits of
header - timestamps etc

Paul
----
    P Mansfield, Senior SysAdmin PSINet UK Ltd, +44-1223-577611 fax:~577600 



--
*** Exim information can be found at http://www.exim.org/ ***