Mailu / Mailu

Insular email distribution - mail server as Docker images
https://mailu.io
Other
5.79k stars 828 forks source link

Unblock IP from rate limiter? #2856

Open sephentos opened 1 year ago

sephentos commented 1 year ago

[2023-06-13 02:13:41,739] WARNING in limiter: Authentication attempt from xxx.xxx.xxx.xxx has been rate-limited.

Is there a way to unblock the IP address in the rate limiter? I've searched the documentation and issues but couldn't find anything.

ghostwheel42 commented 1 year ago

Yes, it is possible and should probably be documented or added to the cli interface. You can do it using redis-cli:

# list the limited networks (this is not the IP, but only the network part according to AUTH_RATELIMIT_IP_V4_MASK
docker compose exec redis redis-cli -n 2 --scan --pattern 'LIMITER/auth-ip/*'
# delete an entry
IP=8.8.8.8; docker compose exec redis redis-cli -n 2 --scan --pattern "LIMITER/auth-ip/${IP}/*" | xargs -r docker compose exec -T redis redis-cli -n 2 DEL
DjVinnii commented 1 year ago

I also ran into this problem recently. The Redis CLI was useful, however it would be a nice addition to show and manage the rate limited IP's from the UI (as global admin) and Mailu API as well.

nextgens commented 1 year ago

Get your users to use tokens/application passwords. Those are exempt from rate limits

101t commented 3 months ago

Grab the container_id:

docker ps | grep redis

then execute the following command:

docker exec 14aa53ae52cd redis-cli -n 2 --scan --pattern "LIMITER/auth-ip/*" |  xargs -r docker exec -t 14aa53ae52cd redis-cli -n 2 DEL