Mailing List Archive

Assistance with Rate Limiting
Hello,

I am looking for some assistance for rate limiting outgoing mail to a
smarthost. I've wandered around the internet for quite awhile today
looking into ACLs, etc. but haven't gotten as far as I'd wanted on my
own. I'm hoping someone can lend a hand with a simple example / strategy
I can work from.

I'm running a monitoring system using naemon and at times the system can
process hundreds of SNMP traps in a very short period of time, each one
generating a separate e-mail notification. While I work to aggregate
these traps into fewer notifications I'm also trying to get exim to play
a bit nicer with my upstream mail routing infrastructure. My mail
routing admin provided these specifications:

10 messages per connection
100 recipients per message
10 concurrent connections per IP
3600 recipients per hour per host
3600 recipients per hour per envelope sender

My question is how (or where) should I tune exim to better abide by
these rules when sending messages to a smarthost? Unfortunately I don't
know exactly which one of these conditions I've been running up against
... certainly not the number of recipients per message (that's only 3!).

Thanks!

Eric Schoeller
Data Center Manager
Office of Information Technology
University of Colorado Boulder

--
## 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: Assistance with Rate Limiting [ In reply to ]
On 13/09/2021 05:20, Eric Schoeller via Exim-users wrote:
> 10 messages per connection

connection_max_messages transport option

> 100 recipients per message

max_rcpt transport option

> 10 concurrent connections per IP

max_parallel transport option

> 3600 recipients per hour per host
> 3600 recipients per hour per envelope sender

These are much harder. Get a better outbound provider or
cut down your requirements or run your own outbound.

No doubt you will say noe of those are viable.

Next, define those more tightly - for instance: in any
one clock hour in the Pune timezone? Average exponentially-decayed
ona 10-hour scale? Then have a hunt in the Exim Wiki;
there's a page on possible routes towards outbound rate-limiting.

--
Cheers,
Jeremy

--
## 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: Assistance with Rate Limiting [ In reply to ]
Thanks for your reply! Yes, unfortunately you were right - I can't
change outbound providers.

So 'connection_max_messages' , 'max_rcpt' and 'max_parallel' can all be
placed under the 'remote_smtp_smarthost' and 'remote_smtp' transport
sections, correct? I tried applying some low values to these and
unfortunately our outbound provider still complained with a '452 Too
many recipients received from the sender' message today during an
incident we had.

Eric.

On 9/16/21 5:50 AM, Jeremy Harris via Exim-users wrote:
> On 13/09/2021 05:20, Eric Schoeller via Exim-users wrote:
>> 10 messages per connection
>
> connection_max_messages transport option
>
>> 100 recipients per message
>
> max_rcpt transport option
>
>> 10 concurrent connections per IP
>
> max_parallel transport option
>
>> 3600 recipients per hour per host
>> 3600 recipients per hour per envelope sender
>
> These are much harder.  Get a better outbound provider or
> cut down your requirements or run your own outbound.
>
> No doubt you will say noe of those are viable.
>
> Next, define those more tightly - for instance: in any
> one clock hour in the Pune timezone?  Average exponentially-decayed
> ona 10-hour scale?  Then have a hunt in the Exim Wiki;
> there's a page on possible routes towards outbound rate-limiting.
>

--
## 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: Assistance with Rate Limiting [ In reply to ]
On 23/09/2021 04:26, Eric Schoeller via Exim-users wrote:
> So 'connection_max_messages' , 'max_rcpt' and 'max_parallel' can all be placed under the 'remote_smtp_smarthost' and 'remote_smtp' transport sections, correct?

They are transport options. See the definitions in the manual as
to where they can be used and how to put them in the config.

> I tried applying some low values to these and unfortunately our outbound provider still complained with a '452 Too many recipients received from the sender' message today during an incident we had.

Look at your logging for the affected message. What transport was used?

Consider running testcases with known numbers of recipients using
the debug features exim provides.
--
Cheers,
Jeremy

--
## 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/