From: cebka@lenovo-laptop Date: Mon, 25 Jan 2010 12:35:38 +0000 (+0300) Subject: * Do not produce lua warning when message has no headers or has unresolved hostname X-Git-Tag: 0.3.0~97 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=97c285b7343d70d1a4695e5894d50aa5acbdeea1;p=rspamd.git * Do not produce lua warning when message has no headers or has unresolved hostname --- diff --git a/src/plugins/lua/once_received.lua b/src/plugins/lua/once_received.lua index bf8e31462..d858314dd 100644 --- a/src/plugins/lua/once_received.lua +++ b/src/plugins/lua/once_received.lua @@ -14,9 +14,13 @@ function check_quantity_received (task) -- Strict checks if symbol_strict then local r = recvh[1] + if not r then + return + end -- Unresolved host if not r['real_hostname'] or string.lower(r['real_hostname']) == 'unknown' or string.match(r['real_hostname'], '^%d+%.%d+%.%d+%.%d+$') then task:insert_result(metric, symbol_strict, 1) + return end local i = true