aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/lua/mx_check.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/lua/mx_check.lua')
-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