mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-14 10:53:30 +02:00
parent
14196e5054
commit
f2c0a147fa
@ -98,7 +98,7 @@ def handle_authentication(headers):
|
||||
password = urllib.parse.unquote(headers["Auth-Pass"])
|
||||
ip = urllib.parse.unquote(headers["Client-Ip"])
|
||||
except:
|
||||
app.logger.warn(f'Received undecodable user/password from nginx: {headers["Auth-User"]!r}/{headers["Auth-Pass"]!r}')
|
||||
app.logger.warn(f'Received undecodable user/password from nginx: {headers.get("Auth-User", "")!r}')
|
||||
else:
|
||||
try:
|
||||
user = models.User.query.get(user_email) if '@' in user_email else None
|
||||
|
@ -49,7 +49,7 @@ def nginx_authentication():
|
||||
if not is_port_25:
|
||||
utils.limiter.exempt_ip_from_ratelimits(client_ip)
|
||||
elif is_valid_user:
|
||||
password = urllib.parse.unquote(headers.get('Auth-Pass', None))
|
||||
password = urllib.parse.unquote(headers.get('Auth-Pass', ''))
|
||||
utils.limiter.rate_limit_user(username, client_ip, password=password)
|
||||
elif not is_from_webmail:
|
||||
utils.limiter.rate_limit_ip(client_ip, username)
|
||||
|
Loading…
Reference in New Issue
Block a user