Re: [exim] simple question about rate limiting

Startseite
Nachricht löschen
Nachricht beantworten
Autor: W B Hacker
Datum:  
To: exim users
Betreff: Re: [exim] simple question about rate limiting
Sergei Gerasenko wrote:
> Hello everybody,
>
> I've been using Exim for years now and I'm very happy with it. There's
> one problem that I don't know how to resolve though...
>
> I have a program that generates emails at night and calls exim directly
> (on the same host) to deliver those messages. The problem is that some
> receivers rate limit their incoming SMTP connections to 30 messages per
> minute and reject anything over that.
>
> How do I limit my outgoing rate per host?


KISS.

Do it in the external program. Or pipe it through an intermediate one.

Keep in mind that:

IF your external program does a full-court-press smtp session with Exim
(as for example, the Ecartis MLM does) then you can use Exim's
'incoming' ratelimiting, 'coz you will be emulating an external
submitter for relay (and must make settings to permit such...).

ELSE you are in a non_smtp environment (calling the Exim binary, writing
directly into the queue - whatever).

.. not to mention the myriad programs that don't use the resident MTA to
send out at all, but do their own smtp sending...

IOW - are you even certain that your 'program' is traversing Exim at all?

> I've been reading about "ratelimit" but
> I'm not sure if it applies in this situation. Also, I probably want the
> outgoing messages that are over the threshold to be queued until the
> they can be sent.
>
> For example, if I define the outgoing rate to be 30 messages per minute
> for a host, then provided 30 messages have already been sent in this
> minute, messages 31 and up are queued until this minute is over. Then the
> next 30 are sent and so on. In other words, I don't want my messages to
> be rejected if I've reached 30 messages per minute.
>


It may be that all you need is a 'sleep <n>' between messages in your
external program...

HTH,

Bill