-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
[bug]: 0.11.1, Too many requests on https listener behind reverse proxy #1078
Comments
Looks like Stalwart is not receiving (or you have not enabled) the proxy protocol headers. For this reason the IP address of your reverse proxy is being rate limited. |
I have enabled proxy-protocol for smtp, smtps & imaps ports. The backends for these are configured with send-proxy-v2. The https port is not using proxy-protocol (neither on the listener or the haproxy backend) but the forwarded header. The too many requests we're having is coming from the haproxy health checks which are supposed to come from the load balancer's IP, it's not an error. What you mean is that I have to configure proxy protocol anyway on every listener since v0.11.1 or my load balancer will get rate limited ? |
You need to either enable the proxy protocol on the http ports or configure Stalwart to use the Forwarded-For http headers. |
As I said, I use the forwarded header and the fact that my proxy's internal IP is appearing in the logs for these lines is normal : this is the haproxy health checks. They're coming from the load balancer itself so it's supposed to show the internal IP. Can I disable the rate limiter on the https listener ? |
Thanks, it wasn't clear for me that jmap rate limiting was also applied to the https listener.
|
|
Thanks again for your time and good job with the product, I'm happy to have subscribed |
The reason rate limiting is done per service type is to prevent bad actors from distributing an attack across ports. Hopefully now that rate limits are not enforced on trusted IPs it won't cause you troubles anymore.
Thanks! |
What happened?
Hi,
I had an issue with my stalwart cluster while upgrading to 0.11.1, I have 3 servers with haproxy in front, the haproxy has multiple backends each pointing to stalwart listeners, every backend in haproxy checks the health of the stalwart node with this kind of config
Since version 0.11.1 my load balancer gets rate limited, I see these logs on the 3 nodes
I have allowed the ip addresses of my lan with this config :

But it looks like the rate limiter from version 0.11 does not check this, which looks like a bug to me. If that's not the case can you point me to the right config ?
Thanks !
How can we reproduce the problem?
Setup stalwart 0.11.1 https, smtp, smtps and imaps listeners, setup haproxy with these backends :
Observe that haproxy health checks are not working, which disables the backends. You can also observe multiple log lines on stalwart nodes like these :
Version
v0.11.x
What database are you using?
PostgreSQL
What blob storage are you using?
PostgreSQL
Where is your directory located?
Internal
What operating system are you using?
Docker
Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: