[PR #168] [DONOTMERGE] Add the ability to keep mail delivery under a threshold (rate limit) and resend when the relay falls below the threshold again. #172

Open
opened 2026-02-26 18:33:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/decke/smtprelay/pull/168
Author: @barais
Created: 11/25/2024
Status: 🔄 Open

Base: masterHead: master


📝 Commits (1)

  • fb4e3ef introduce a way to remain below a threshold for the mail throughput

📊 Changes

10 files changed (+202 additions, -28 deletions)

View changed files

Dockerfile (+25 -0)
📝 README.md (+2 -1)
📝 go.mod (+7 -3)
📝 go.sum (+20 -0)
📝 main.go (+10 -12)
ratelimiter.go (+67 -0)
📝 remotes.go (+31 -7)
send4mail.sh (+6 -0)
📝 smtp.go (+25 -0)
📝 smtprelay.ini (+9 -5)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/decke/smtprelay/pull/168 **Author:** [@barais](https://github.com/barais) **Created:** 11/25/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`fb4e3ef`](https://github.com/decke/smtprelay/commit/fb4e3ef131f2cfe56ca415212231533be1d7f36d) introduce a way to remain below a threshold for the mail throughput ### 📊 Changes **10 files changed** (+202 additions, -28 deletions) <details> <summary>View changed files</summary> ➕ `Dockerfile` (+25 -0) 📝 `README.md` (+2 -1) 📝 `go.mod` (+7 -3) 📝 `go.sum` (+20 -0) 📝 `main.go` (+10 -12) ➕ `ratelimiter.go` (+67 -0) 📝 `remotes.go` (+31 -7) ➕ `send4mail.sh` (+6 -0) 📝 `smtp.go` (+25 -0) 📝 `smtprelay.ini` (+9 -5) </details> ### 📄 Description 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](https://github.com/maypok86/otter) and [go-limiter](https://github.com/sethvargo/go-limiter) [3] Close to https://wiki.deimos.fr/Postfix:_limit_outgoing_mail_throttling --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/smtprelay#172
No description provided.