Re: [exim] Delay times of less than a second for ratelimitin…

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Mike Brudenell
Ημερομηνία:  
Προς: Exim Users
Αντικείμενο: Re: [exim] Delay times of less than a second for ratelimiting?
On 20 December 2016 at 15:48, Jeremy Harris <jgh@???> wrote:

> > From the example in the Specification it looks like when the threshold is
> > reached I use *delay* to introduce a delay. However *delay* takes a
> > standard Exim time interval: an integer number of seconds, minutes,
> hours,
> > days or weeks.
> >
> > Is there a way of using a *fraction* of a second for the delay — eg, 0.5
> > seconds
>
> No.
>
> Beyond a deliberate call to some external facility.
> Builtin perl, possibly.
>


Ah, OK… That's sad. I was hoping to allow an initial burst of messages
through (tested with a *ratelimit* condition in the acl_smtp_mail) and then
use *delay* to slow down throughput to around 250 messages per minute.
Ignoring reception tie of the message itself, that would require a delay of
around 60 seconds / 150 = 0.24 seconds.

However if the minimum delay that can be waited is only 1 second that
effectively caps the ongoing throughput at a rather low 60 messages per
minute — 60 seconds / 1 second delay = 60 messages per minute.



> > — or would I have to look at using the old-style
> > *smtp_ratelimit_{hosts,mail,rcpt}* options instead to achieve this, with
> > the disadvantage that they only apply within a single connection?
>
> ... and also offer no finer granularity.
>


Are you sure? That's not what the Specification seems to say; in the *Main
configuration* section it specifically says (emphasis mine) for
smtp_ratelimit_hosts:

An initial time delay. *Unlike other times in Exim, numbers with decimal
fractional parts are allowed here.*

A factor by which to increase the delay each time.

For example, these settings have been used successfully at the site which
first suggested this feature, for controlling mail from their customers:

smtp_ratelimit_mail = 2,0.5s,1.05,4m

smtp_ratelimit_rcpt = 4,0.25s,1.015,4m

The first setting specifies delays that are applied to MAIL commands after
two have been received over a single connection. *The initial delay is 0.5
seconds, increasing by a factor of 1.05 each time.*


That strongly implies it provides delays of fractional seconds; there's
nothing to say these fractional times are rounded (up? down?) to an integer.

That's why I was hoping there might be some way I'd not found of doing
fractional delays when using the new and improved ratelimit option instead
of the old-style smtp_ratelimit_* options.

Cheers,
Mike B-)

--
Systems Administrator & Change Manager
IT Services, University of York, Heslington, York YO10 5DD, UK
Tel: +44-(0)1904-323811

Web: www.york.ac.uk/it-services
Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm