-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[enhancement]: Rate limiting sends #966
Comments
Regarding this, Just today, one of the client had some of their passwords leaked, on a different server. Thankfully, since I had hourly limits on a per-mailbox /per-domain / per-customer basis, they were only able to send ~100 emails before the system stopped the outbreak and we intervened. This is an important feature to have. I know there is a "Rate Limit" feature in the interface. But it's unrelated. |
+1. This, along with the ability to pause on a per-account/domain basis in the event of abuse, is a critical feature that is absolutely essential. Password/credential leakage and the abuse of these by spammers are very common scenarios in the wild. |
This is already possible, check the documentation for outbound rate limits. For example, to throttle by sender address: [[queue.throttle]]
key = ["sender"]
rate = "25/1h"
enable = true Or by sender domain: [[queue.throttle]]
key = ["sender_domain"]
rate = "25/1h"
enable = true Or a combination of sender and recipient domain: [[queue.throttle]]
key = ["sender", "rcpt_domain"]
rate = "25/1h"
enable = true |
Yeah... You can't do this via Sieve. It can be OK if you are running 5-10 domains and 20-30 users. This should be an API endpoint and part of webadmin for UI users. |
Do you mean enforcing rate limits from Sieve?
The queue throttle setting is a global setting and does not need to be configured per user. For example, the |
@mdecimus, thank you for your quick reply. Since I posted, I've already found inbound/outbound throttling and started using them. It's a great feature, and you can make some granular rules per domain, sender, ip etc. However, I still have a few questions, and I'd appreciate it greatly if you could clarify them.
The best case scenario for us would be monitoring everything in Grafana/GrafanaCloud (usage/mails sent per domain, address etc) and when abuse is noticed - automatically pause account via API/Webhook/something else. Is this possible/is there a future roadmap for this/can I post an enhancement request? Thank you for your patience! |
@nomadturk I think you can rate limit on a more granular level using The queue.throttle[].key as following: remote_ip: The remote IP address. So you can limit per sender(mailbox)/domain/combination/et cetera. Of course, I personally think it would be better from a UX perspective to somehow integrate this in the management under domain/acocunts settings. And also create some form of "templates" for new accounts/domains with predefined rate limits etc. |
@nomadturk I agree. I think from a UX point of view, the best would be to:
This + visibilitiy. There should be a way to monitor disk quota + sending limits etc (and how much is utilized/left). Monitoring + automatic intervention (via grafana+api or something else) is absolutely necessary if using stalwart with more than a few accounts/domains that you can personally manage. |
Webadmin should have these too. Right. A domain admin or a tenant should be able to change the limits, with the upper limit being the limit we set it up for their account. The global limits should be over-ridable. There shouldn't be a one limit to rule them all. And yes, when this is something other than a personal server... Quota, limits, alerts, webhooks these are all essential to operate an email server. |
Which feature or improvement would you like to request?
I would like to impose rate limiting when a new email is being sent, on a per-domain, per-mailbox level.
(Forwards or DSNs should not count)
We should be able to either reject or re-queue when they hit rate limits.
This would help prevent email bursts and virus related outbreaks as well as protecting the domain/IPs.
Is your feature request related to a problem?
I'm having a problem with...
Code of Conduct
The text was updated successfully, but these errors were encountered: