Re: [exim] Exim as a relay - ratelimiting by rejections

Top Page
Delete this message
Reply to this message
Author: Anthony G. Nickolayev
Date:  
To: exim-users
CC: postmaster
Subject: Re: [exim] Exim as a relay - ratelimiting by rejections
On Fri, 26 Feb 2010 15:31:32 +0000
Andrew Hearn <andrew.hearn@???> wrote:

> However, is there a way to ratelimit or deny hosts based on how many
> messages they've sent that have been rejected/deferred by the recipients MX?
>
> Eg, if we've tried to relay messages for a host, and 100 in the past
> hour have been denied or deferred by the recipients MX, then we can
> block the sender from sending more. (as well as log it and contact the
> customer)

You could try to tail the exim/mainlog and analyze it for corresponding records. I didnt find simple way to achive this.

I'd do this in perl:
* prepare a hash with msg id as a key and so called fail-counter as value
* collect all receive records ("<=" with P=esmtp) to hash with msg id as a key and content of "H=" as value.
* check every fail ("**") or defer ("==") record for msg id and increase corresponding fail-counter; if the counter runs out of limit - do some action for host
* if the date has changed, reset all counters

Please write to this list if you find a proper solution for your task.

----
--
Anthony G. Nickolayev
email services
system administrator
JSC "AC Mobiltelecom"
+7-(3012)-29-70-21
postmaster@???