diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2016-02-17 14:43:09 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2016-02-17 14:43:09 +0300 |
commit | 160461020da49fe58e8052873978ef2ec7a35122 (patch) | |
tree | b09bc4570c291fc826b83f999c266cd61b8b23af /src/plugins/lua/once_received.lua | |
parent | da30951c96e75560da9d1457c1cc023655bc3e42 (diff) | |
download | rspamd-160461020da49fe58e8052873978ef2ec7a35122.tar.gz rspamd-160461020da49fe58e8052873978ef2ec7a35122.zip |
Skip good hostname check for undefined hostnames
2016-02-17 13:00:50 #58424(normal) <a41bdc>; task; lua_metric_symbol_callback: call to (ONCE_RECEIVED) failed: /usr/local/share/rspamd/lua/once_received.lua:82: bad argument #1 to 'lower' (string expected, got nil); trace: [1]:{[C]:-1 - lower [C]}; [2]:{/usr/local/share/rspamd/lua/once_received.lua:82 - <unknown> [Lua]};
Diffstat (limited to 'src/plugins/lua/once_received.lua')
-rw-r--r-- | src/plugins/lua/once_received.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua index eac93b89e..7d5d5edbb 100644 --- a/src/plugins/lua/once_received.lua +++ b/src/plugins/lua/once_received.lua @@ -79,13 +79,15 @@ local function check_quantity_received (task) return end - local hn = string.lower(r['real_hostname']) - -- Check for good hostname - if hn and good_hosts then - for _,gh in ipairs(good_hosts) do - if string.find(hn, gh) then - ret = false - break + if r['real_hostname'] then + local hn = string.lower(r['real_hostname']) + -- Check for good hostname + if hn and good_hosts then + for _,gh in ipairs(good_hosts) do + if string.find(hn, gh) then + ret = false + break + end end end end |