1package mox
2
3import (
4 "time"
5
6 "github.com/mjl-/mox/ratelimit"
7)
8
9var LimiterFailedAuth *ratelimit.Limiter
10
11// LimitesrsInit initializes the failed auth rate limiter.
12func LimitersInit() {
13 LimiterFailedAuth = &ratelimit.Limiter{
14 WindowLimits: []ratelimit.WindowLimit{
15 {
16 // Max 10 failures/minute for ipmasked1, 30 or ipmasked2, 90 for ipmasked3.
17 Window: time.Minute,
18 Limits: [...]int64{10, 30, 90},
19 },
20 {
21 Window: 24 * time.Hour,
22 Limits: [...]int64{50, 150, 450},
23 },
24 },
25 }
26}
27