[exim] Limit the total number of headers in incoming SMTP me…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Chris Siebenmann
Datum:  
To: exim-users
CC: cks
Neue Treads: [exim] Counting the number of headers in an incoming email (was Re: Limit the total number of headers in incoming SMTP messages?)
Betreff: [exim] Limit the total number of headers in incoming SMTP messages?
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.

Given that the 'regex' ACL condition is specifically restricted to
handling a single line, about the only way to do this that I can see
is to (ab)use Exim's content scanning interface to run a program that
counts header lines and emits a suitable 'I found bad stuff' message
when it finds too many headers that the DATA ACL will then use to reject
the message. This seems a little bit brute force (among other things,
it means running an external program on every incoming messages).

Can anyone think of a better way to do this?

Thanks in advance.

    - cks