aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAL <AlexeySa@users.noreply.github.com>2017-11-27 15:41:31 +0300
committerGitHub <noreply@github.com>2017-11-27 15:41:31 +0300
commitc32e8cd011ca0d4d92efab3671258507af04c036 (patch)
treeea2c066365a87dc5feb230c14c37299c7e01ab59
parent34150e9a86aa04d18248701b9327a6176bcfed0a (diff)
downloadrspamd-c32e8cd011ca0d4d92efab3671258507af04c036.tar.gz
rspamd-c32e8cd011ca0d4d92efab3671258507af04c036.zip
[Minor] Add whitelist symbol to mx_check plugin
-rw-r--r--src/plugins/lua/mx_check.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua
index 1094c6c2d..75b587763 100644
--- a/src/plugins/lua/mx_check.lua
+++ b/src/plugins/lua/mx_check.lua
@@ -29,6 +29,7 @@ local settings = {
symbol_bad_mx = 'MX_INVALID',
symbol_no_mx = 'MX_MISSING',
symbol_good_mx = 'MX_GOOD',
+ symbol_white_mx = 'MX_WHITE',
expire = 86400, -- 1 day by default
expire_novalid = 7200, -- 2 hours by default for no valid mxes
greylist_invalid = true, -- Greylist first message with invalid MX (require greylist plugin)
@@ -64,7 +65,7 @@ local function mx_check(task)
if exclude_domains then
if exclude_domains:get_key(mx_domain) then
rspamd_logger.infox(task, 'skip mx check for %s, excluded', mx_domain)
-
+ task:insert_result(settings.symbol_white_mx, 1.0, mx_domain)
return
end
end
@@ -288,6 +289,11 @@ if opts then
type = 'virtual',
parent = id
})
+ rspamd_config:register_symbol({
+ name = settings.symbol_white_mx,
+ type = 'virtual',
+ parent = id
+ })
rspamd_config:set_metric_symbol({
name = settings.symbol_bad_mx,
@@ -306,6 +312,14 @@ if opts then
one_param = true,
})
rspamd_config:set_metric_symbol({
+ name = settings.symbol_white_mx,
+ score = -0.00,
+ description = 'Domain has whitelist MX',
+ group = 'MX',
+ one_shot = true,
+ one_param = true,
+ })
+ rspamd_config:set_metric_symbol({
name = settings.symbol_no_mx,
score = 3.5,
description = 'Domain has no resolvable MX',
@@ -321,4 +335,4 @@ if opts then
url = settings.exclude_domains,
}
end
-end \ No newline at end of file
+end