Re: [exim] limiting subject line length?

Góra strony
Delete this message
Reply to this message
Autor: Phil Pennock
Data:  
Dla: Steve Wray
CC: exim-users
Temat: Re: [exim] limiting subject line length?
On 2009-04-02 at 15:08 +1300, Steve Wray wrote:
> Some of our users have decided that its a great idea to put their *entire*
> email message into the subject line even when it is several paragraphs long.
>
> (Some of these users do this and have email sigs which are also several
> paragraphs long so the email consists of a gigantic subject 'line' and the
> body of the email is just a huge 'disclaimer' sig, but I digress).
>
> Is there a nice way to limit subject line length to discourage this practice?


You should have an ACL being used for various content checks which will
be hooked into acl_smtp_data in the main configuration section. In
there, and also in the ACL used for acl_not_smtp if local non-SMTP
submission is also a problem, you can reject based on your needs.

The rules in an ACL are evaluated in order;

   deny    condition = ${if >{${strlen:$h_subject:}}{1000}}
        message = Coherency rulez okay!


That's the decoded string's length, after MIME mangling has been
converted down to text in headers_charset.

> For reference, this is exim4 under Debian.


For how to hook this into Debian, with the split configuration used
there, you'll need Debian-specific guidance -- Exim ships with one flat
configuration file, no M4 hacks.

-Phil