rspamd: add rate limiting
This commit is contained in:
parent
67062677b0
commit
28fc91f5f3
@ -416,6 +416,16 @@ def _configure_rspamd(dkim_selector: str, mail_domain: str) -> bool:
|
||||
)
|
||||
need_restart |= hfilter.changed
|
||||
|
||||
ratelimit_conf = files.put(
|
||||
name="enable rate limiting",
|
||||
src=importlib.resources.files(__package__).joinpath("rspamd/ratelimit.conf"),
|
||||
dest="/etc/rspamd/local.d/ratelimit.conf",
|
||||
user="root",
|
||||
group="root",
|
||||
mode="644",
|
||||
)
|
||||
need_restart |= ratelimit_conf.changed
|
||||
|
||||
dkim_directory = "/var/lib/rspamd/dkim/"
|
||||
dkim_key_path = f"{dkim_directory}{mail_domain}.{dkim_selector}.key"
|
||||
|
||||
|
9
cmdeploy/src/cmdeploy/rspamd/ratelimit.conf
Normal file
9
cmdeploy/src/cmdeploy/rspamd/ratelimit.conf
Normal file
@ -0,0 +1,9 @@
|
||||
rates {
|
||||
user = {
|
||||
bucket = {
|
||||
burst = 110;
|
||||
rate = "90 / 1min";
|
||||
}
|
||||
}
|
||||
}
|
||||
whitelisted_user = "/etc/rspamd/local.d/whitelisted_users_ratelimit.map"
|
Loading…
Reference in New Issue
Block a user