summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorAlexander Moisseev <moiseev@mezonplus.ru>2016-12-04 20:06:45 +0300
committerAlexander Moisseev <moiseev@mezonplus.ru>2016-12-04 20:06:45 +0300
commit19bb251673220aeda160a6466cf98f720f4463d5 (patch)
tree74d59c36b0ef3363d561c6ee42d06ad846868175 /rules
parent3f395bf7ac1a80e5fca20e5e7a487b212551954b (diff)
downloadrspamd-19bb251673220aeda160a6466cf98f720f4463d5.tar.gz
rspamd-19bb251673220aeda160a6466cf98f720f4463d5.zip
[Minor] Fix condition, avoid `nil` index
Diffstat (limited to 'rules')
-rw-r--r--rules/misc.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/rules/misc.lua b/rules/misc.lua
index dd2ead132..0610f126d 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -640,10 +640,12 @@ local check_replyto_id = rspamd_config:register_callback_symbol('CHECK_REPLYTO',
-- See if From and Reply-To addresses match
if (from[1].addr:lower() == rt[1].addr:lower()) then
task:insert_result('REPLYTO_ADDR_EQ_FROM', 1.0)
- elseif (from[1].domain:lower() == rt[1].addr:lower()) then
- task:insert_result('REPLYTO_DOM_EQ_FROM_DOM', 1.0)
- elseif (from[1].domain:lower() ~= rt[1].domain:lower()) then
- task:insert_result('REPLYTO_DOM_NEQ_FROM_DOM', 1.0)
+ elseif from[1].domain and rt[1].domain then
+ if (from[1].domain:lower() == rt[1].domain:lower()) then
+ task:insert_result('REPLYTO_DOM_EQ_FROM_DOM', 1.0)
+ else
+ task:insert_result('REPLYTO_DOM_NEQ_FROM_DOM', 1.0)
+ end
end
-- See if the Display Names match
if (from[1].name and rt[1].name and from[1].name:lower() == rt[1].name:lower()) then