Re: [exim] Limit the total number of headers in incoming SMT…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jeremy Harris
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Limit the total number of headers in incoming SMTP messages?
On 23/03/15 21:29, Heiko Schlittermann wrote:
> Chris Siebenmann <cks@???> (Mo 23 Mär 2015 19:53:33 CET):
>> We use a commercial anti-spam system behind our Exim-based inbound MX
>> gateway that turns out to be unhappy if a message has 'too many' headers
>> (where this is an undocumented value of more than 512 headers). I'd like
>> to detect and reject these messages in the DATA phase, rather than having
>> them accepted, passed to the anti-spam system, and die quietly.



>     Here is an example of the use of this variable in a DATA ACL:

>
>     deny message   = Too many lines in message header
>          condition = \
>           ${if <{250}{${eval:$message_linecount - $body_linecount}}}

>
>     In the MAIL and RCPT ACLs, the value is zero because at that stage the
>     message has not yet been received.


Another way, depending on your definition of "header line"
(lines can be folded...)
and if you have a recent Exim version, might be
something involving $message_headers and ${listcount: }
- treating the headers as a newline-sep list.

--
Cheers,
Jeremy