Re: [exim] Fwd: Rate-limit queue-processing per domain

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Lena
Date:  
À: exim-users
Sujet: Re: [exim] Fwd: Rate-limit queue-processing per domain
P.S. below a corrected version because a message can have several recipients.

> From: Charlie Elgholm


> Then one might suggest that the ratelimit-condition perhaps should be
> implemented for the routers as well.. Then we could do
>
> ratelimit = 100 / 1h / <options> / $domain


The ${acl string expansion item works in authenticators.
You can try to use it (or "acl" expansion condition) in routers.
Something like this:


begin acl
throttle:
  accept set acl_m_mxlist = ${lookup dnsdb{>: mxh=$acl_arg1}}
         condition = ${if forany{$acl_m_mxlist}\
           {match_domain{$item}{*.google.com}}}
         condition = ${if >{${eval10:$tod_epoch-0$acl_m_gmail}}{50}}
         set acl_m_gmail = $tod_epoch
         ratelimit = 100 / 1h / per_cmd / gmail
         message = :defer:


  accept condition = ${if forany{$acl_m_mxlist}\
           {match_domain{$item}{*.hotmail.com:*.outlook.com}}}
         condition = ${if >{${eval10:$tod_epoch-0$acl_m_ms}}{50}}
         set acl_m_ms = $tod_epoch
         ratelimit = 100 / 1h / per_cmd / ms
         message = :defer:


accept
...
begin routers
...
throttled_mx:
driver = redirect
allow_defer
no_verify
data = ${acl{throttle}{$domain}}


If this works then please post your modifications to this.