Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

Odd behaviour in simultaneous ratelimits

Odd behaviour in simultaneous ratelimits

2016-09-14 by maren.zubizarreta@...

Hello Again:


After the success with my authenticated user ratelimit, I was trying to stablish two diferent reatelimit, one per hour and another one per day, applying them to the same matches;


But it doesn't work well, beacuse when I leave the two rules, inmediately the per-hour rule is kicked, even if I leave enough time for the counter to get reset.


Any idea about what is happening, or how else can I do?


It doesn't matter twhich order the rules are set, but once I set the two of themthe hourly ratelimit pops up, and Ican't send even 1 message.



list "IP_MAREN" addr { 158.227.4.29}

#For testing purpouses y change the values here:

ratelimit "limit_1H" rcpt 2 / 1m key "%M{auth_authen}"

ratelimit "limit_1D" rcpt 3 / 1h key "%M{auth_authen}"

sm_macro "null" "{auth_authen}" unset

sm_macro "users_macro" "{auth_authen}" /sckmailin22\|lgszuhom/


racl blacklist not sm_macro "null" not sm_macro"users_macro" list "IP_MAREN" ratelimit "limit_1H" msg "Daily Quota exceeded"


racl blacklist not sm_macro "null" not sm_macro"users_macro" list "IP_MAREN" ratelimit "limit_1D" msg "Hourly quota exceeded"



Re: Odd behaviour in simultaneous ratelimits

2016-09-14 by maren.zubizarreta@...


After testing it a bit more, I see that the beahviour is like if the hits to the daily ratelimit counted as well for the hourly ratelimit, once the daily_ratelimit time is passed, then the hourly ratelimit is resset too.

This happens the other way around too.

Re: Odd behaviour in simultaneous ratelimits

2016-09-19 by maren.zubizarreta@...

Again:

We have found impossible to implement these two blacklists (hourly and daily) based on the same ratelimits when the match is the same, the only solution working is to distingush both matches, for example with this:


ratelimit "limite_1H" rcpt 20 / 1h key "%M{auth_authen}"
ratelimit "limite_1D" rcpt 20 / 1h key "%i%M{auth_authen}"



racl blacklist not sm_macro "sin_autenticar" not sm_macro "usuarios_excluidos" not list "our_network" ratelimit "limite_1H" msg "Hourly quota exceeded"

racl blacklist not sm_macro "sin_autenticar" not sm_macro "usuarios_excluidos" not list "our_network" ratelimit "limite_1D" msg "Daily quota exceeded"

It's not exactly what we want, but at least works


Re: [milter-greylist] Re: Odd behaviour in simultaneous ratelimits

2016-09-20 by manu@...

maren.zubizarreta@... [milter-greylist]
<milter-greylist@yahoogroups.com> wrote:

>  ratelimit "limite_1H" rcpt 20 / 1h key "%M{auth_authen}"
>  ratelimit "limite_1D" rcpt 20 / 1h key "%i%M{auth_authen}"

Shouldn't the second line use rcpt 480 / 1d ?

Then the order of the racl is important: you hourly limit will trigger
before your daily limit, hence if you want the daily limit to trigger,
it should come before the hourly limit.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] Re: Odd behaviour in simultaneous ratelimits

2016-09-20 by maren.zubizarreta@...

Yes, you are right, it has beeen a transcription mistake:

ratelimit "limite_1H" rcpt 20 / 1h key "%M{auth_authen}"
ratelimit "limite_1D" rcpt 480 / 1d key "%i%M{auth_authen}"

But our problem is that if the condition is the same in both limits, for example:

ratelimit "limite_1H" rcpt 20 / 1h key "%M{auth_authen}"
ratelimit "limite_1D" rcpt 480 / 1d key "%M{auth_authen}"

This doesn't work as expected,and hists to both limits causes blacklists acl using the limits mixing each other.

Is there really a limitation like this? or we are missing something?

Thanks

Maren

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.