1
0
mirror of https://github.com/Mailu/Mailu.git synced 2025-01-30 04:30:49 +02:00

Don't rate-limit port 25, ever.

This commit is contained in:
Florent Daigniere 2023-04-04 12:47:11 +02:00
parent ab7b82d05b
commit 94ef62a884

View File

@ -21,7 +21,7 @@ def nginx_authentication():
utils.limiter.rate_limit_ip(client_ip) utils.limiter.rate_limit_ip(client_ip)
return response return response
is_from_webmail = headers['Auth-Port'] in ['10143', '10025'] is_from_webmail = headers['Auth-Port'] in ['10143', '10025']
if not is_from_webmail and utils.limiter.should_rate_limit_ip(client_ip): if not is_from_webmail and not is_port_25 and utils.limiter.should_rate_limit_ip(client_ip):
status, code = nginx.get_status(flask.request.headers['Auth-Protocol'], 'ratelimit') status, code = nginx.get_status(flask.request.headers['Auth-Protocol'], 'ratelimit')
response = flask.Response() response = flask.Response()
response.headers['Auth-Status'] = status response.headers['Auth-Status'] = status