haraka / haraka-plugin-limit

Enforce many types of limits on a Haraka mail server.
https://www.npmjs.com/package/haraka-plugin-limit
MIT License
10 stars 14 forks source link

Outbound rate limits #6

Open acharkizakaria opened 7 years ago

acharkizakaria commented 7 years ago

Hi guys, I'm having a problem during the implementation of outbound rate limits, it seems to work just for the first time for the outbound part.

Example :

If I'm using the following Config in limit.ini :

[outbound]
enabled=true
domain=1
delay=10

Then queuing 5 mails.

Expected : Deliver 1 mail every 10 seconds.

Current behaviour : Deliver the first mail then delayed the rest '4' mails for 10 seconds (as expected), but after the first 10 seconds the _'sendmail' hook will be called and delayed the '4' mails another time and keep delay the delivery every 10 seconds... without delivering.

NOTE : I think that happen because of the TOTAL that will be incremented every time so the count variable will be always greater than limit and will reach the delivered condition just the first time :

if (count <= limit) return next();

Thanks in advance.

msimerson commented 7 years ago

Note: see also haraka/Haraka#2006

MatthieuHPP commented 7 years ago

Hello, I would like to implement this plugin and the outbound rate limit in particular. Has this bug been fixed ? Many thanks Matthieu

acharkizakaria commented 7 years ago

Hello Matthieu,

Unfortunately not yet, It will be great if you could fix it. Thank you,

msimerson commented 7 months ago

This might be related to #56 which I just merged.