fixed rate limit mysql lookup
This commit is contained in:
parent
84fb125046
commit
5285b70977
|
@ -377,24 +377,24 @@ acl_rcpt_to:
|
|||
# compromised account, not to restrict legitimate users. Set your defaults & limits accordignly.
|
||||
warn
|
||||
authenticated = *
|
||||
set acl_m_ratelimit_hourly = ${lookup mysql{SELECT vm_mboxes.ratelimit FROM vm_domains, vm_mboxes WHERE vm_domains.domain='${domain}' AND vm_mboxes.mbox='${local_part}' AND vm_domains.id = vm_mboxes.domain_id AND vm_mboxes.ratelimit IS NOT NULL}{$value}{"100000"}}
|
||||
set acl_m_ratelimit_daily = ${eval: $acl_m_ratelimit_hourly * 10}
|
||||
set acl_m_ratelimit_hourly = ${lookup mysql{SELECT IFNULL(vm_mboxes.ratelimit, 100000) FROM vm_domains, vm_mboxes WHERE vm_domains.domain="$sender_address_domain" AND vm_mboxes.mbox="$sender_address_local_part" AND vm_domains.id = vm_mboxes.domain_id}}
|
||||
set acl_m_ratelimit_daily = ${eval: (10 * $acl_m_ratelimit_hourly) }
|
||||
ratelimit = 0 / 1h / per_mail / strict / $authenticated_id
|
||||
log_message = Sender rate $sender_rate/$sender_rate_period for $authenticated_id
|
||||
log_message = Sender rate is $sender_rate/$sender_rate_period for $authenticated_id
|
||||
|
||||
# enforce hourly rate limit
|
||||
deny
|
||||
authenticated = *
|
||||
ratelimit = $acl_m_ratelimit_hourly / 1h / per_mail / strict / $authenticated_id
|
||||
message = Rate Limit of $sender_rate/$sender_rate_period exceeded. Try again later.
|
||||
log_message = $authenticated_id exceeded rate limit of $sender_rate/$sender_rate_period
|
||||
message = Rate Limit of $acl_m_ratelimit_hourly per hour exceeded. Try again later.
|
||||
log_message = $authenticated_id exceeded rate limit of $acl_m_ratelimit_hourly per hour
|
||||
|
||||
# enforce daily rate limit
|
||||
deny
|
||||
authenticated = *
|
||||
ratelimit = $acl_m_ratelimit_daily / 1d / per_mail / strict / $authenticated_id
|
||||
message = Rate Limit of $sender_rate/$sender_rate_period exceeded. Try again later.
|
||||
log_message = $authenticated_id exceeded rate limit of $sender_rate/$sender_rate_period
|
||||
message = Rate Limit of $acl_m_ratelimit_daily per day exceeded. Try again later.
|
||||
log_message = $authenticated_id exceeded rate limit of $acl_m_ratelimit_daily per day
|
||||
|
||||
# authenticated user did not exceed rate limits, accept message now
|
||||
accept
|
||||
|
|
Loading…
Reference in New Issue
Block a user