mirror of
https://github.com/chatmail/relay.git
synced 2026-05-12 09:04:36 +00:00
rspamd: reject emails with invalid SPF, DKIM, DMARC
This commit is contained in:
@@ -451,6 +451,18 @@ def _configure_rspamd(dkim_selector: str, mail_domain: str) -> bool:
|
||||
)
|
||||
need_restart |= hfilter.changed
|
||||
|
||||
groups_conf = files.put(
|
||||
name="set metrics for DKIM, SPF, and DMARC fails",
|
||||
src=importlib.resources.files(__package__).joinpath(
|
||||
"rspamd/policies_group.conf"
|
||||
),
|
||||
dest="/etc/rspamd/local.d/policies_group.conf",
|
||||
user="root",
|
||||
group="root",
|
||||
mode="644",
|
||||
)
|
||||
need_restart |= groups_conf.changed
|
||||
|
||||
redis_conf = files.put(
|
||||
name="enable redis for caching",
|
||||
src=importlib.resources.files(__package__).joinpath("rspamd/rspamd_redis.conf"),
|
||||
|
||||
14
cmdeploy/src/cmdeploy/rspamd/policies_group.conf
Normal file
14
cmdeploy/src/cmdeploy/rspamd/policies_group.conf
Normal file
@@ -0,0 +1,14 @@
|
||||
symbols {
|
||||
"R_DKIM_REJECT" {
|
||||
weight = 15;
|
||||
}
|
||||
"R_SPF_FAIL" {
|
||||
weight = 15;
|
||||
}
|
||||
"R_DKIM_NA" {
|
||||
weight = 15;
|
||||
}
|
||||
"DMARC_POLICY_REJECT" {
|
||||
weight = 15;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user