handle Null MX records

parent c1d99d17
......@@ -37,7 +37,8 @@ if not ans then
ngx.log(ngx.WARN, "no ans: '" .. args.email .. "'")
error("server DNS timeout problem, please contact support")
end
if #ans == 0 then
-- https://tools.ietf.org/html/rfc7505
if #ans == 0 or (#ans == 1 and ans[1].preference == 0 and ans[1].exchange == "") then
ngx.log(ngx.WARN, "no mx: '" .. args.email .. "'")
error("domain does not accept mail")
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment