From: Vsevolod Stakhov Date: Wed, 18 Jul 2018 13:26:25 +0000 (+0100) Subject: [Conf] Add fallback maps X-Git-Tag: 1.7.9~94 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4a5f7b6caecf1cc1f1911018610953e68733e139;p=rspamd.git [Conf] Add fallback maps --- diff --git a/conf/modules.d/mid.conf b/conf/modules.d/mid.conf index c6e305d7b..589ce746a 100644 --- a/conf/modules.d/mid.conf +++ b/conf/modules.d/mid.conf @@ -17,7 +17,8 @@ mid = { source = { url = [ "https://maps.rspamd.com/rspamd/mid.inc.zst", - "$LOCAL_CONFDIR/local.d/mid.inc" + "$LOCAL_CONFDIR/local.d/mid.inc", + "fallback+file://${CONFDIR}/mid.inc" ]; } diff --git a/conf/modules.d/mime_types.conf b/conf/modules.d/mime_types.conf index b27560d6f..7bbc0aa08 100644 --- a/conf/modules.d/mime_types.conf +++ b/conf/modules.d/mime_types.conf @@ -16,7 +16,8 @@ mime_types { file = [ "https://maps.rspamd.com/rspamd/mime_types.inc.zst", - "${DBDIR}/mime_types.inc.local" + "${DBDIR}/mime_types.inc.local", + "fallback+file://${CONFDIR}/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 2ad2ce8f4..dd77832a8 100644 --- a/conf/modules.d/phishing.conf +++ b/conf/modules.d/phishing.conf @@ -26,7 +26,8 @@ phishing { # Make exclusions for known redirectors redirector_domains = [ "https://maps.rspamd.com/rspamd/redirectors.inc.zst:REDIRECTOR_FALSE", - "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE" + "$LOCAL_CONFDIR/local.d/redirectors.inc:LOCAL_REDIRECTOR_FALSE", + "fallback+file://${CONFDIR}/redirectors.inc:REDIRECTOR_FALSE" ]; .include(try=true,priority=5) "${DBDIR}/dynamic/phishing.conf" diff --git a/conf/modules.d/surbl.conf b/conf/modules.d/surbl.conf index e0e60baa9..02acae95e 100644 --- a/conf/modules.d/surbl.conf +++ b/conf/modules.d/surbl.conf @@ -16,11 +16,13 @@ surbl { whitelist = [ "https://maps.rspamd.com/rspamd/surbl-whitelist.inc.zst", - "${DBDIR}/surbl-whitelist.inc.local" + "${DBDIR}/surbl-whitelist.inc.local", + "fallback+file://${CONFDIR}/surbl-whitelist.inc" ]; exceptions = [ "https://maps.rspamd.com/rspamd/2tld.inc.zst", - "${DBDIR}/2tld.inc.local" + "${DBDIR}/2tld.inc.local", + "fallback+file://${CONFDIR}/2tld.inc" ]; rules { diff --git a/conf/modules.d/whitelist.conf b/conf/modules.d/whitelist.conf index b3f93d5f5..0665232ab 100644 --- a/conf/modules.d/whitelist.conf +++ b/conf/modules.d/whitelist.conf @@ -20,6 +20,7 @@ whitelist { domains = [ "https://maps.rspamd.com/rspamd/spf_whitelist.inc.zst", "${DBDIR}/spf_whitelist.inc.local", + "fallback+file://${CONFDIR}/spf_whitelist.inc" ]; score = -1.0 description = "Mail comes from the whitelisted domain and has a valid SPF policy"; @@ -30,6 +31,7 @@ whitelist { domains = [ "https://maps.rspamd.com/rspamd/dkim_whitelist.inc.zst", "${DBDIR}/dkim_whitelist.inc.local", + "fallback+file://${CONFDIR}/dkim_whitelist.inc" ]; description = "Mail comes from the whitelisted domain and has a valid DKIM signature"; score = -1.0 @@ -40,6 +42,7 @@ whitelist { domains = [ "https://maps.rspamd.com/rspamd/spf_dkim_whitelist.inc.zst", "${DBDIR}/spf_dkim_whitelist.inc.local", + "fallback+file://${CONFDIR}/spf_dkim_whitelist.inc" ]; score = -3.0; description = "Mail comes from the whitelisted domain and has valid SPF and DKIM policies"; @@ -49,6 +52,7 @@ whitelist { domains = [ "https://maps.rspamd.com/rspamd/dmarc_whitelist.inc.zst", "${DBDIR}/dmarc_whitelist.inc.local", + "fallback+file://${CONFDIR}/dmarc_whitelist.inc" ]; score = -7.0; description = "Mail comes from the whitelisted domain and has valid DMARC and DKIM policies"; diff --git a/test/functional/configs/mime_types.conf b/test/functional/configs/mime_types.conf index 7ba2c0448..a16434b6a 100644 --- a/test/functional/configs/mime_types.conf +++ b/test/functional/configs/mime_types.conf @@ -1,5 +1,8 @@ mime_types { - file = "https://maps.rspamd.com/rspamd/mime_types.inc.zst"; + file = [ + "https://maps.rspamd.com/rspamd/mime_types.inc.zst", + "fallback+file://${TESTDIR}/../../../conf/mime_types.inc" + ]; extension_map { html = "text/html"; txt [