From f2021a1f5138742f70599fc0df54b3b0a1b088c1 Mon Sep 17 00:00:00 2001 From: korgoth1 Date: Thu, 9 Jan 2020 22:00:14 +0300 Subject: [PATCH] [Test] SPF external relay map --- conf/maps.d/external_ip_spf.inc | 1 + src/plugins/lua/spf.lua | 5 +++++ test/functional/configs/dmarc.conf | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 conf/maps.d/external_ip_spf.inc diff --git a/conf/maps.d/external_ip_spf.inc b/conf/maps.d/external_ip_spf.inc new file mode 100644 index 0000000000..3fc5c1775c --- /dev/null +++ b/conf/maps.d/external_ip_spf.inc @@ -0,0 +1 @@ +192.168.1.1 \ No newline at end of file diff --git a/src/plugins/lua/spf.lua b/src/plugins/lua/spf.lua index 10daa0d2b3..67350c285b 100644 --- a/src/plugins/lua/spf.lua +++ b/src/plugins/lua/spf.lua @@ -231,6 +231,11 @@ if local_config.external_relay then end end +if external_ip_spf.map then + local lua_maps = require "lua_maps" + external_ip_spf.map = lua_maps.map_add_from_ucl(external_ip_spf.map, "radix", "External IP SPF map") +end + for _,sym in pairs(local_config.symbols) do rspamd_config:register_symbol{ name = sym, diff --git a/test/functional/configs/dmarc.conf b/test/functional/configs/dmarc.conf index 08a542c70c..dac106cc22 100644 --- a/test/functional/configs/dmarc.conf +++ b/test/functional/configs/dmarc.conf @@ -1,4 +1,2 @@ dmarc { } -spf { - external_relay = 192.168.1.1; -} \ No newline at end of file +spf { } \ No newline at end of file -- 2.47.3