You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-23 22:04:47 +02:00
Refactor the rate limiting code
Rate limiting was already redesigned to use Python limits. This introduced some unexpected behavior, including the fact that only one criteria is supported per limiter. Docs and setup utility are updated with this in mind. Also, the code was made more generic, so limiters can be delivered for something else than authentication. Authentication-specific code was moved directly to the authentication routine.
This commit is contained in:
@@ -30,8 +30,8 @@ POSTMASTER={{ postmaster }}
|
||||
TLS_FLAVOR={{ tls_flavor }}
|
||||
|
||||
# Authentication rate limit (per source IP address)
|
||||
{% if auth_ratelimit_pm > '0' and auth_ratelimit_ph > '0' %}
|
||||
AUTH_RATELIMIT={{ auth_ratelimit_pm }}/minute;{{ auth_ratelimit_ph }}/hour
|
||||
{% if auth_ratelimit_pm > '0' %}
|
||||
AUTH_RATELIMIT={{ auth_ratelimit_pm }}/minute
|
||||
{% endif %}
|
||||
|
||||
# Opt-out of statistics, replace with "True" to opt out
|
||||
|
||||
@@ -47,11 +47,10 @@ Or in plain english: if receivers start to classify your mail as spam, this post
|
||||
|
||||
<div class="form-group">
|
||||
<label>Authentication rate limit (per source IP address)</label>
|
||||
<!-- Validates number input only -->
|
||||
<!-- Validates number input only -->
|
||||
<p><input class="form-control" style="width: 7%; display: inline;" type="number" name="auth_ratelimit_pm"
|
||||
value="10" required >/minute;
|
||||
<input class="form-control" style="width: 7%; display: inline;;" type="number" name="auth_ratelimit_ph"
|
||||
value="1000" required >/hour</p>
|
||||
value="10" required > / minute
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-check-inline">
|
||||
|
||||
Reference in New Issue
Block a user