diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-27 14:03:59 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-27 14:03:59 +0000 |
commit | 2a1598dbb6342ab583decde78553125c7f50a154 (patch) | |
tree | b0e291498325a70b98b425284ca22485cbc3a411 /src | |
parent | 53402f91c612eae647ca0f51348c63bed7877bfa (diff) | |
download | rspamd-2a1598dbb6342ab583decde78553125c7f50a154.tar.gz rspamd-2a1598dbb6342ab583decde78553125c7f50a154.zip |
[Fix] Fix some cases for RDNS_NONE
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/once_received.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua index 671ebd98d..7d084a991 100644 --- a/src/plugins/lua/once_received.lua +++ b/src/plugins/lua/once_received.lua @@ -26,12 +26,16 @@ local whitelist = nil local rspamd_logger = require "rspamd_logger" local function check_quantity_received (task) + local recvh = task:get_received_headers() + local function recv_dns_cb(resolver, to_resolve, results, err) task:inc_dns_req() if not results then - task:insert_result(symbol, 1) - task:insert_result(symbol_strict, 1) + if recvh and #recvh <= 1 then + task:insert_result(symbol, 1) + task:insert_result(symbol_strict, 1) + end task:insert_result(symbol_rdns, 1) else rspamd_logger.infox(task, 'SMTP resolver failed to resolve: %1 is %2', @@ -70,10 +74,10 @@ local function check_quantity_received (task) end local task_ip = task:get_ip() + local hn = task:get_hostname() -- Here we don't care about received - if not task:get_hostname() and task_ip then - + if (not hn or hn == 'unknown') and task_ip then task:get_resolver():resolve_ptr({task = task, name = task_ip:to_string(), callback = recv_dns_cb |