From 69f50374bbba64882caa11c38362dc6101e343c6 Mon Sep 17 00:00:00 2001 From: moisseev Date: Tue, 17 Sep 2019 10:35:41 +0300 Subject: [PATCH] [Conf] Introduce maps.d directories --- centos/rspamd.spec | 10 +++++----- conf/{ => maps.d}/dmarc_whitelist.inc | 0 conf/{ => maps.d}/maillist.inc | 0 conf/{ => maps.d}/mid.inc | 0 conf/{ => maps.d}/mime_types.inc | 0 conf/{ => maps.d}/redirectors.inc | 0 conf/{ => maps.d}/spf_dkim_whitelist.inc | 0 conf/{ => maps.d}/surbl-whitelist.inc | 0 conf/modules.d/mid.conf | 3 ++- conf/modules.d/mime_types.conf | 3 ++- conf/modules.d/phishing.conf | 3 ++- conf/modules.d/rbl.conf | 3 ++- conf/modules.d/whitelist.conf | 12 ++++++++---- src/plugins/lua/greylist.lua | 10 +++++----- 14 files changed, 26 insertions(+), 18 deletions(-) rename conf/{ => maps.d}/dmarc_whitelist.inc (100%) rename conf/{ => maps.d}/maillist.inc (100%) rename conf/{ => maps.d}/mid.inc (100%) rename conf/{ => maps.d}/mime_types.inc (100%) rename conf/{ => maps.d}/redirectors.inc (100%) rename conf/{ => maps.d}/spf_dkim_whitelist.inc (100%) rename conf/{ => maps.d}/surbl-whitelist.inc (100%) diff --git a/centos/rspamd.spec b/centos/rspamd.spec index 1af0c5fb4..c5f0ee4e1 100644 --- a/centos/rspamd.spec +++ b/centos/rspamd.spec @@ -195,13 +195,13 @@ fi %config(noreplace) %{rspamd_confdir}/%{name}.conf %config(noreplace) %{rspamd_confdir}/composites.conf %config(noreplace) %{rspamd_confdir}/metrics.conf -%config(noreplace) %{rspamd_confdir}/mime_types.inc +%config(noreplace) %{rspamd_confdir}/maps.d/mime_types.inc %config(noreplace) %{rspamd_confdir}/modules.conf %config(noreplace) %{rspamd_confdir}/statistic.conf %config(noreplace) %{rspamd_confdir}/common.conf %config(noreplace) %{rspamd_confdir}/logging.inc %config(noreplace) %{rspamd_confdir}/options.inc -%config(noreplace) %{rspamd_confdir}/redirectors.inc +%config(noreplace) %{rspamd_confdir}/maps.d/redirectors.inc %config(noreplace) %{rspamd_confdir}/worker-controller.inc %config(noreplace) %{rspamd_confdir}/worker-fuzzy.inc %config(noreplace) %{rspamd_confdir}/worker-normal.inc @@ -217,9 +217,9 @@ fi %dir %{rspamd_pluginsdir} %dir %{rspamd_wwwdir} %dir %{_libdir}/rspamd -%config(noreplace) %{rspamd_confdir}/surbl-whitelist.inc -%config(noreplace) %{rspamd_confdir}/spf_dkim_whitelist.inc -%config(noreplace) %{rspamd_confdir}/dmarc_whitelist.inc +%config(noreplace) %{rspamd_confdir}/maps.d/surbl-whitelist.inc +%config(noreplace) %{rspamd_confdir}/maps.d/spf_dkim_whitelist.inc +%config(noreplace) %{rspamd_confdir}/maps.d/dmarc_whitelist.inc %{rspamd_pluginsdir}/lib/*.lua %{rspamd_pluginsdir}/lua/*.lua %{rspamd_rulesdir}/regexp/*.lua diff --git a/conf/dmarc_whitelist.inc b/conf/maps.d/dmarc_whitelist.inc similarity index 100% rename from conf/dmarc_whitelist.inc rename to conf/maps.d/dmarc_whitelist.inc diff --git a/conf/maillist.inc b/conf/maps.d/maillist.inc similarity index 100% rename from conf/maillist.inc rename to conf/maps.d/maillist.inc diff --git a/conf/mid.inc b/conf/maps.d/mid.inc similarity index 100% rename from conf/mid.inc rename to conf/maps.d/mid.inc diff --git a/conf/mime_types.inc b/conf/maps.d/mime_types.inc similarity index 100% rename from conf/mime_types.inc rename to conf/maps.d/mime_types.inc diff --git a/conf/redirectors.inc b/conf/maps.d/redirectors.inc similarity index 100% rename from conf/redirectors.inc rename to conf/maps.d/redirectors.inc diff --git a/conf/spf_dkim_whitelist.inc b/conf/maps.d/spf_dkim_whitelist.inc similarity index 100% rename from conf/spf_dkim_whitelist.inc rename to conf/maps.d/spf_dkim_whitelist.inc diff --git a/conf/surbl-whitelist.inc b/conf/maps.d/surbl-whitelist.inc similarity index 100% rename from conf/surbl-whitelist.inc rename to conf/maps.d/surbl-whitelist.inc diff --git a/conf/modules.d/mid.conf b/conf/modules.d/mid.conf index 8c153b6b9..5fd679463 100644 --- a/conf/modules.d/mid.conf +++ b/conf/modules.d/mid.conf @@ -17,8 +17,9 @@ mid = { source = { url = [ "https://maps.rspamd.com/rspamd/mid.inc.zst", + "$LOCAL_CONFDIR/local.d/maps.d/mid.inc", "$LOCAL_CONFDIR/local.d/mid.inc", - "fallback+file://${CONFDIR}/mid.inc" + "fallback+file://${CONFDIR}/maps.d/mid.inc" ]; } diff --git a/conf/modules.d/mime_types.conf b/conf/modules.d/mime_types.conf index a92f426a3..ef9ab934b 100644 --- a/conf/modules.d/mime_types.conf +++ b/conf/modules.d/mime_types.conf @@ -16,8 +16,9 @@ mime_types { file = [ "https://maps.rspamd.com/rspamd/mime_types.inc.zst", + "$LOCAL_CONFDIR/local.d/maps.d/mime_types.inc.local", "${DBDIR}/mime_types.inc.local", - "fallback+file://${CONFDIR}/mime_types.inc" + "fallback+file://${CONFDIR}/maps.d/mime_types.inc" ] # Match specific extensions to specific content types diff --git a/conf/modules.d/phishing.conf b/conf/modules.d/phishing.conf index c86e2af41..bdace9123 100644 --- a/conf/modules.d/phishing.conf +++ b/conf/modules.d/phishing.conf @@ -25,8 +25,9 @@ phishing { # Make exclusions for known redirectors redirector_domains = [ "https://maps.rspamd.com/rspamd/redirectors.inc.zst:REDIRECTOR_FALSE", + "$LOCAL_CONFDIR/local.d/maps.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE", "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE", - "fallback+file://${CONFDIR}/redirectors.inc:REDIRECTOR_FALSE" + "fallback+file://${CONFDIR}/maps.d/redirectors.inc:REDIRECTOR_FALSE" ]; .include(try=true,priority=5) "${DBDIR}/dynamic/phishing.conf" diff --git a/conf/modules.d/rbl.conf b/conf/modules.d/rbl.conf index e92ed945d..1cdd73b2d 100644 --- a/conf/modules.d/rbl.conf +++ b/conf/modules.d/rbl.conf @@ -21,8 +21,9 @@ rbl { url_whitelist = [ "https://maps.rspamd.com/rspamd/surbl-whitelist.inc.zst", + "$LOCAL_CONFDIR/local.d/maps.d/surbl-whitelist.inc.local", "${DBDIR}/surbl-whitelist.inc.local", - "fallback+file://${CONFDIR}/surbl-whitelist.inc" + "fallback+file://${CONFDIR}/maps.d/surbl-whitelist.inc" ]; rbls { diff --git a/conf/modules.d/whitelist.conf b/conf/modules.d/whitelist.conf index aa0da3161..b3bbd4329 100644 --- a/conf/modules.d/whitelist.conf +++ b/conf/modules.d/whitelist.conf @@ -18,8 +18,9 @@ whitelist { "WHITELIST_SPF" = { valid_spf = true; domains = [ + "$LOCAL_CONFDIR/local.d/maps.d/spf_whitelist.inc.local", "${DBDIR}/spf_whitelist.inc.local", - "fallback+file://${CONFDIR}/spf_whitelist.inc" + "fallback+file://${CONFDIR}/maps.d/spf_whitelist.inc" ]; score = -1.0 inverse_symbol = "BLACKLIST_SPF"; @@ -28,8 +29,9 @@ whitelist { "WHITELIST_DKIM" = { valid_dkim = true; domains = [ + "$LOCAL_CONFDIR/local.d/maps.d/dkim_whitelist.inc.local", "${DBDIR}/dkim_whitelist.inc.local", - "fallback+file://${CONFDIR}/dkim_whitelist.inc" + "fallback+file://${CONFDIR}/maps.d/dkim_whitelist.inc" ]; score = -1.0; inverse_symbol = "BLACKLIST_DKIM"; @@ -39,8 +41,9 @@ whitelist { valid_dkim = true; domains = [ "https://maps.rspamd.com/rspamd/spf_dkim_whitelist.inc.zst", + "$LOCAL_CONFDIR/local.d/maps.d/spf_dkim_whitelist.inc.local", "${DBDIR}/spf_dkim_whitelist.inc.local", - "fallback+file://${CONFDIR}/spf_dkim_whitelist.inc" + "fallback+file://${CONFDIR}/maps.d/spf_dkim_whitelist.inc" ]; score = -3.0; inverse_symbol = "BLACKLIST_SPF_DKIM"; @@ -49,8 +52,9 @@ whitelist { valid_dmarc = true; domains = [ "https://maps.rspamd.com/rspamd/dmarc_whitelist_new.inc.zst", + "$LOCAL_CONFDIR/local.d/maps.d/dmarc_whitelist.inc.local", "${DBDIR}/dmarc_whitelist.inc.local", - "fallback+file://${CONFDIR}/dmarc_whitelist.inc" + "fallback+file://${CONFDIR}/maps.d/dmarc_whitelist.inc" ]; score = -7.0; inverse_symbol = "BLACKLIST_DMARC"; diff --git a/src/plugins/lua/greylist.lua b/src/plugins/lua/greylist.lua index 5f4b5b07f..a0a09ce46 100644 --- a/src/plugins/lua/greylist.lua +++ b/src/plugins/lua/greylist.lua @@ -21,11 +21,11 @@ greylist { # Search "example.com" and "mail.example.com" for "mx.out.mail.example.com": whitelist_domains_url = [ "$LOCAL_CONFDIR/local.d/greylist-whitelist-domains.inc", - "${CONFDIR}/maillist.inc", - "${CONFDIR}/redirectors.inc", - "${CONFDIR}/dmarc_whitelist.inc", - "${CONFDIR}/spf_dkim_whitelist.inc", - "${CONFDIR}/surbl-whitelist.inc", + "${CONFDIR}/maps.d/maillist.inc", + "${CONFDIR}/maps.d/redirectors.inc", + "${CONFDIR}/maps.d/dmarc_whitelist.inc", + "${CONFDIR}/maps.d/spf_dkim_whitelist.inc", + "${CONFDIR}/maps.d/surbl-whitelist.inc", "https://maps.rspamd.com/freemail/free.txt.zst" ]; } -- 2.39.5