summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-27 10:34:35 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-04-27 10:34:35 +0100
commit973c10d4bc96335942dd2a6897d160eee402dca1 (patch)
tree3185055aa30b819dcad274ad895a7784ff527559
parent7156236d9dad29c47f1fc74f2ad35cefc9c0dfab (diff)
downloadrspamd-973c10d4bc96335942dd2a6897d160eee402dca1.tar.gz
rspamd-973c10d4bc96335942dd2a6897d160eee402dca1.zip
[Feature] Allow to exclude specific domains from mx check
-rw-r--r--src/plugins/lua/mx_check.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua
index b1d07209b..6bca83be9 100644
--- a/src/plugins/lua/mx_check.lua
+++ b/src/plugins/lua/mx_check.lua
@@ -32,9 +32,10 @@ local settings = {
expire = 86400, -- 1 day by default
expire_novalid = 7200, -- 2 hours by default for no valid mxes
greylist_invalid = false, -- Greylist first message with invalid MX (require greylist plugin)
- key_prefix = 'rmx'
+ key_prefix = 'rmx',
}
local redis_params
+local exclude_domains
local E = {}
@@ -60,6 +61,14 @@ local function mx_check(task)
return
end
+ if exclude_domains then
+ if exclude_domains:get_key(mx_domain) then
+ rspamd_logger.infox(task, 'skip mx check for %s, excluded', mx_domain)
+
+ return
+ end
+ end
+
local valid = false
local function check_results(mxes)
@@ -307,4 +316,12 @@ if opts then
one_shot = true,
one_param = true,
})
-end
+
+ if settings.exclude_domains then
+ exclude_domains = rspamd_config:add_map{
+ type = 'set',
+ description = 'Exclude specific domains from MX checks',
+ url = settings.exclude_domains,
+ }
+ end
+end \ No newline at end of file