[DONOTMERGE] Add the ability to keep mail delivery under a threshold (rate limit) and resend when the relay falls below the threshold again. #168
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you have a huge amount of mail to deliver, you can't release the queue at once and let the server maximize the outgoing mail throughput ! The result will be: you'll get blacklisted from a lot of MX servers.
That's why you should take care of it and do traffic shaping
Many smtp providers (even those from universities) impose threshold values in terms of the number of messages sent per (message/mins or per message/hour) and the number of recipients...
As a result, it is sometimes required to stay below these thresholds. Particularly when emails are sent by applications. This PR provides a small extension to this great smtprelay project to add this feature. I don't think this PR should be merged because it goes against the original spirit of keeping the code very small without too many dependencies. The idea of the PR is undoubtedly to keep a history of this addition, which is so useful to others, but it can be closed without comment.
[1] #155
[2] Dependencies to otter and go-limiter
[3] Close to https://wiki.deimos.fr/Postfix:_limit_outgoing_mail_throttling