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 limiting does not seem to work #4

Closed inmula closed 7 years ago

inmula commented 7 years ago

Since we're getting issues delivering too much mail to the Outlook / Hotmail / Live / MSN services, we're looking into rate limiting the amount of mail that goes to these providers. This plugin seems to provide that functionality, but it doesn't seem to work correctly.

I've been debugging for a while, and found out that the variable hmail.domain in the outbound_increment hook is NULL. After inspecting the hmail object and looking in the documentation, the domain variable can be accessed by using the hmail.todo.domain variable.

The documentation also mentions the always_split configuration option, but this option does not seem to have impact on the contents of the hmail.domain variable.

Is this an issue in our environment, or is it a compatability issue with the Haraka version we're using (the latest - 2.8.13)? I've fixed it for now by writing a custom plugin which hooks into the outbound hooks before the limit plugin and copies the hmail.todo.domain variable to hmail.domain.

baudehlo commented 7 years ago

Sounds like a bug, but not to be fixed the way you did it.

On Thu, Mar 23, 2017 at 7:22 AM, mmenzo notifications@github.com wrote:

Since we're getting issues delivering too much mail to the Outlook / Hotmail / Live / MSN services, we're looking into rate limiting the amount of mail that goes to these providers. This plugin seems to provide that functionality, but it doesn't seem to work correctly.

I've been debugging for a while, and found out that the variable hmail.domain in the outbound_increment hook is NULL. After inspecting the hmail object and looking in the documentation, the domain variable can be accessed by using the hmail.todo.domain variable.

The documentation also mentions the always_split configuration option, but this option does not seem to have impact on the contents of the hmail.domain variable.

Is this an issue in our environment, or is it a compatability issue with the Haraka version we're using (the latest - 2.8.13)? I've fixed it for now by writing a custom plugin which hooks into the outbound hooks before the limit plugin and copies the hmail.todo.domain variable to hmail.domain.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/haraka/haraka-plugin-limit/issues/4, or mute the thread https://github.com/notifications/unsubscribe-auth/AAobYy30U4N-BURwFsXYg5B6p-JQJU-dks5rolX0gaJpZM4MmmzG .

msimerson commented 7 years ago

From your description, it sounds like this plugin needs to be changed to look at hmail.todo.domain instead of hmail.domain? I haven't reviewed the code but if there are code paths where one or the other are set, then something like this would cover all bases: hmail.domain || hmail.todo.domain