On Mon, Apr 09, 2007 at 12:09:12PM +0400, Cronfy wrote:
> A question about ratelimiting senders. As I can see, ratelimit can
> limit sending rate by counting number of commands or connections.
> But is it posible to limit by number of unique recipients, as Gmail does?
>
> http://www.google.com/support/a/bin/answer.py?answer=59797&topic=9202
>
> If exim can't do this, probably there is some third party solution?
You can ratelimit total number of recipients, but not *unique*
recipients, using the built-in ratelimiting commands.
We use something along the lines of this in our config:
Sample macro definition at top:
EXIMDIR = /usr/local/exim
RL_AUTHID = ${if !eq{$authenticated_id}{} {$authenticated_id}\
{$sender_host_address}}
In the acl_smtp_rcpt section:
deny
log_message = RATELIMIT: RL_AUTHID / $sender_rate / $sender_rate_period
message = TOO MANY RECIPIENTS - PLEASE RETRY LATER
ratelimit = ${lookup{RL_AUTHID} lsearch{EXIMDIR/ratelimits}\
{$value}{500 / 24h}} / per_rcpt / leaky / RL_AUTHID
Example contents of the EXIMDIR/ratelimits file would contain overrides
that you don't want to have the "500 / 24h" default apply:
# Overriding a specific host ratelimit defaults
1.2.3.4: 4000 / 24h
# Overriding a specific SMTP AUTH $authenticated_id value
username@???: 4000 / 6h
--
Dean Brooks
dean@???