aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-17 18:31:19 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-09-17 18:31:19 +0100
commit1770760b73a2bcec6a9081f9578fd80de3cb1077 (patch)
treeb99cdb454ed05f8e0870ce84c0cd062de3afeb02
parentad5b6f45a6f9bf59e0a8ad47173c2d987fa74864 (diff)
downloadrspamd-1770760b73a2bcec6a9081f9578fd80de3cb1077.tar.gz
rspamd-1770760b73a2bcec6a9081f9578fd80de3cb1077.zip
[Minor] Resolve A record if all MXes are absent
-rw-r--r--src/plugins/lua/mx_check.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/lua/mx_check.lua b/src/plugins/lua/mx_check.lua
index 637dfaec7..002ff46ab 100644
--- a/src/plugins/lua/mx_check.lua
+++ b/src/plugins/lua/mx_check.lua
@@ -139,10 +139,20 @@ local function mx_check(task)
end
local function mx_callback(resolver, to_resolve, results, err, _, authenticated)
+ local mxes = {}
if err or not results then
+ local r = task:get_resolver()
+ -- XXX: maybe add ipv6?
+ -- fallback to implicit mx
+ mxes[mx_domain] = {checked = false, working = false, ips = {}}
+ r:resolve('a', {
+ name = mx_domain,
+ callback = gen_mx_a_callback(mx_domain, mxes),
+ task = task,
+ forced = true
+ })
task:insert_result(settings.symbol_no_mx, 1.0)
else
- local mxes = {}
table.sort(results, function(r1, r2)
return r1['priority'] < r2['priority']
end)