diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2016-12-04 20:06:45 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2016-12-04 20:06:45 +0300 |
commit | 19bb251673220aeda160a6466cf98f720f4463d5 (patch) | |
tree | 74d59c36b0ef3363d561c6ee42d06ad846868175 /rules | |
parent | 3f395bf7ac1a80e5fca20e5e7a487b212551954b (diff) | |
download | rspamd-19bb251673220aeda160a6466cf98f720f4463d5.tar.gz rspamd-19bb251673220aeda160a6466cf98f720f4463d5.zip |
[Minor] Fix condition, avoid `nil` index
Diffstat (limited to 'rules')
-rw-r--r-- | rules/misc.lua | 10 |
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 |