Re: [Exim] How to restrict long header lines?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Dean Brooks
CC: exim-users
Subject: Re: [Exim] How to restrict long header lines?
On Sun, 25 Aug 2002, Dean Brooks wrote:

> Exim 4.10 apparantely lets you set the maximum size of ALL the headers
> combined, but I didn't see a way to set a limit on the size of an
> individual header line itself. I don't want to set HEADER_MAXSIZE to
> 4096 as that would be too low for the aggregate of all headers.


The original Exim limited header line length and number of header lines,
but this got changed to total store size because that seemed to be what
you really wanted to limit.

> Is there any way to put a limit on individual header-line length,
> either in the config file or in a system-filter file?


I'm afraid not.

Hmm. I suppose you could try this in a system filter:

if $message_headers matches \N(?m)^.{1024} then
... the message contains a header line that is > 1024 long

However, that is testing individual lines in a header, so you could
still have a long header composed of many continued lines. A clever
regex could probably cope with that. Maybe something like

\N(?m)^(?:.|\n\s){1024}

but I haven't tested either of those expressions.

In any case, this is quite an expensive way to do it.

I've wishlisted the original implied request.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.