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

2017-10-21 Thread Lena--- via Exim-users
P.P.S. Add to the router:

 domains = ! +local_domains


-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


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

2017-10-21 Thread Lena--- via Exim-users
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 /  / $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.

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


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

2017-10-21 Thread Lena--- via Exim-users
> 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 /  / $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:
  warn condition = ${if !def:acl_m_throttler}
   condition = ${if !def:acl_m_mxlist}
   set acl_m_mxlist = ${lookup dnsdb{>: mxh=$acl_arg1}}

  warn condition = ${if !def:acl_m_throttler}
   set acl_m_throttler = ${if forany{$acl_m_mxlist}\
   {match_domain{$item}{*.google.com}}{google}}

  warn condition = ${if !def:acl_m_throttler}
   set acl_m_throttler = ${if forany{$acl_m_mxlist}\
   {match_domain{$item}{*.hotmail.com:*.outlook.com}}{ms}}

  accept condition = ${if !def:acl_m_throttler}

  accept ratelimit = 100 / 1h / per_cmd / strict / throttler-$acl_m_throttler
 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.

-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/