]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix condition, avoid `nil` index 1219/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Sun, 4 Dec 2016 17:06:45 +0000 (20:06 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Sun, 4 Dec 2016 17:06:45 +0000 (20:06 +0300)
rules/misc.lua

index dd2ead132331440b76c527164af4f0828815f640..0610f126dd4b40e8d64e312ee0d0836c2cdcedf6 100644 (file)
@@ -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