Re: [exim] [SOLVED] exim ratelimit on subject for incoming m…

Pàgina inicial
Delete this message
Reply to this message
Autor: Nick Rickard
Data:  
A: exim-users
Assumpte: Re: [exim] [SOLVED] exim ratelimit on subject for incoming mail
On 11/02/16 18:00, Jeremy Harris wrote:
> On 11/02/16 17:49, Nick Rickard wrote:
>>>> set acl_m_origsubject1 = $rh_subject: warn log_message = START
>>>> $acl_m_origsubject1 END
>>>>
>>>> (which runs on all messages as a test) simply gives "START END" in
>>>> the log file. How can I get h_subject to appear in the logs (as
>>>> some text I can incorporate into a meaningful sentence, please?
>>>
>>> Where is that placed in your ACLs? Is it in the DATA ACL, or have you
>>> inadvertently put it further up the transaction stack?
>>>
>> within acl_check_rcpt: ACL
>>
>> (and an earlier declaration of acl_smtp_rcpt = acl_check_rcpt )
>
> The Subject header is part of the message content and has not
> arrived yet at the time the rcpt ACL runs.
>

Bingo. So it goes in acl_check_data: (acl_smtp_data = acl_check_data).

I think I was thrown of the scent because the set acl_m_origsubject1 =
$rh_subject didn't work in the acl_check_data ACL but did in the
acl_check_rcpt. Or because I'm inept.

Thank you Jeremy and Graeme.


For completeness, relevant bits of my revised exim4.conf:

acl_check_rcpt:
   deny
     ratelimit = 5 / 15m / per_rcpt / strict / $sender_address
     log_message = Denied (sender address), sending rate of: 
$sender_rate by $sender_address


acl_check_data:
   warn   [will be deny once proven]
     ratelimit = 5 / 15m / per_rcpt / strict / $h_subject
     log_message = Denied (subject), sending rate of: $sender_rate by 
$h_subject: