--On 15 January 2009 14:26:54 +0000 Graham Butler <g.butler@???>
wrote:
> Could anybody guide me on the following bit of code for Exim (ver 4.68).
> It is designed as a 'test only' at this stage, until I can get the
> numbers right
>
> Does the ratelimit command updates its stats every time it is called,
IIRC, the answer is "yes", and that's the reason that noupdate was
introduced.
> if so do I need to use the no update options on any subsequent use.
But, I don't think you've used the same key twice, so no you don't need to
use noupdate. The database keys include the time parameters, and all the
options, I think:
10 / 1s / $primary_hostname
20 / 10m / strict
1000/ 1h / strict
100 / 1h / per_rcpt / strict
That's four different rate limits.
To make this more self documenting, you could make explicit the default
options that you're using, like this:
10 / 1s / leaky / per_mail / $primary_hostname
20 / 10m / strict / per_mail / $sender_host_address
1000/ 1h / strict /per_mail / $sender_host_address
100 / 1h / per_rcpt / strict / $sender_host_address
It might seem redundant while you're putting this together, but I had to
look these defaults up even though I implemented rate limiting just last
month.
> Any other comments will be gratefully accepted.
>
># ------------------------- Rate limit section ---------------------------
>
># System-wide rate limit 10 per 1 sec (36,000 per hour)
> warn ratelimit = 10 / 1s / $primary_hostname
> log_message = System rate limit exc$sender_rate /
$sender_rate_period
>
># Rate limit remote servers 20 emails per 10 mins (60 per hour)
> warn ratelimit = 20 / 10m / strict
> hosts = !+relay_from_hosts
> senders =
!lsearch;/usr/local/exim/tables/ratelimit_whitelist.txt
> log_message = Remote sender rate limit $sender_rate /
$sender_rate_period
>
># Rate limiting per local server 1000 per 1 hour (1000 per hour)
> warn ratelimit = 1000/ 1h / strict
> hosts = +relay_from_hosts
> senders =
!lsearch;/usr/local/exim/tables/ratelimit_whitelist.txt
> log_message = Local sender rate limit $sender_rate /
$sender_rate_period
>
># Per user rate limiting 100 per hour (100 per hour)
> warn ratelimit = 100 / 1h / per_rcpt / strict
> senders =
!lsearch;/usr/local/exim/tables/ratelimit_whitelist.txt
> log_message = Per user sender rate limit $sender_rate /
$sender_rate_period
>
> Many thanks,
>
> Graham Butler
> Email:g.butler@???
>
>
>
>
>
>
>
> This transmission is confidential and may be legally privileged. If you
> receive it in error, please notify us immediately by e-mail and remove it
> from your system. If the content of this e-mail does not relate to the
> business of the University of Huddersfield, then we do not endorse it and
> will accept no liability.
--
Ian Eiloart
IT Services, University of Sussex
x3148