From c171866faf6647905d241081efec6fcf16f050db Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 12 Jan 2024 18:46:07 +0000 Subject: [PATCH] Actually disable phising, rbl and hfilter --- cmdeploy/src/cmdeploy/__init__.py | 39 ++++++---------------- cmdeploy/src/cmdeploy/rspamd/disabled.conf | 1 + cmdeploy/src/cmdeploy/rspamd/hfilter.conf | 5 --- cmdeploy/src/cmdeploy/rspamd/phishing.conf | 1 - cmdeploy/src/cmdeploy/rspamd/rbl.conf | 4 --- 5 files changed, 11 insertions(+), 39 deletions(-) create mode 100644 cmdeploy/src/cmdeploy/rspamd/disabled.conf delete mode 100644 cmdeploy/src/cmdeploy/rspamd/hfilter.conf delete mode 100644 cmdeploy/src/cmdeploy/rspamd/phishing.conf delete mode 100644 cmdeploy/src/cmdeploy/rspamd/rbl.conf diff --git a/cmdeploy/src/cmdeploy/__init__.py b/cmdeploy/src/cmdeploy/__init__.py index 9d5fe94..f3cae30 100644 --- a/cmdeploy/src/cmdeploy/__init__.py +++ b/cmdeploy/src/cmdeploy/__init__.py @@ -409,25 +409,16 @@ def _configure_rspamd(dkim_selector: str, mail_domain: str) -> bool: packages="rspamd", ) - phishing_conf = files.put( - name="disable phishing rspamd plugin", - src=importlib.resources.files(__package__).joinpath("rspamd/phishing.conf"), - dest="/etc/rspamd/local.d/phishing.conf", - user="root", - group="root", - mode="644", - ) - need_restart |= phishing_conf.changed - - rbl = files.put( - name="disable rbl rspamd plugin", - src=importlib.resources.files(__package__).joinpath("rspamd/rbl.conf"), - dest="/etc/rspamd/override.d/rbl.conf", - user="root", - group="root", - mode="644", - ) - need_restart |= rbl.changed + for module in ["phishing", "rbl", "hfilter"]: + disabled_module_conf = files.put( + name="disable phishing rspamd plugin", + src=importlib.resources.files(__package__).joinpath("rspamd/disabled.conf"), + dest=f"/etc/rspamd/local.d/{module}.conf", + user="root", + group="root", + mode="644", + ) + need_restart |= disabled_module_conf.changed options_inc = files.put( name="disable fuzzy checks", @@ -439,16 +430,6 @@ def _configure_rspamd(dkim_selector: str, mail_domain: str) -> bool: ) need_restart |= options_inc.changed - hfilter = files.put( - name="disable hfilter rspamd plugin", - src=importlib.resources.files(__package__).joinpath("rspamd/hfilter.conf"), - dest="/etc/rspamd/local.d/hfilter.conf", - user="root", - group="root", - mode="644", - ) - need_restart |= hfilter.changed - groups_conf = files.put( name="set metrics for DKIM, SPF, and DMARC fails", src=importlib.resources.files(__package__).joinpath( diff --git a/cmdeploy/src/cmdeploy/rspamd/disabled.conf b/cmdeploy/src/cmdeploy/rspamd/disabled.conf new file mode 100644 index 0000000..a6ee831 --- /dev/null +++ b/cmdeploy/src/cmdeploy/rspamd/disabled.conf @@ -0,0 +1 @@ +enabled = false; diff --git a/cmdeploy/src/cmdeploy/rspamd/hfilter.conf b/cmdeploy/src/cmdeploy/rspamd/hfilter.conf deleted file mode 100644 index 87efb91..0000000 --- a/cmdeploy/src/cmdeploy/rspamd/hfilter.conf +++ /dev/null @@ -1,5 +0,0 @@ -helo_enabled = false; -hostname_enabled = false; -url_enabled = false; -from_enabled = false; -rcpt_enabled = false; diff --git a/cmdeploy/src/cmdeploy/rspamd/phishing.conf b/cmdeploy/src/cmdeploy/rspamd/phishing.conf deleted file mode 100644 index 69be164..0000000 --- a/cmdeploy/src/cmdeploy/rspamd/phishing.conf +++ /dev/null @@ -1 +0,0 @@ -phishtank_enabled = false; diff --git a/cmdeploy/src/cmdeploy/rspamd/rbl.conf b/cmdeploy/src/cmdeploy/rspamd/rbl.conf deleted file mode 100644 index f0f1b78..0000000 --- a/cmdeploy/src/cmdeploy/rspamd/rbl.conf +++ /dev/null @@ -1,4 +0,0 @@ -url_whitelist = []; - -rbls { -}