]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix FROM_NEQ_ENVFROM 3357/head
authorAnton Yuzhaninov <citrin+git@citrin.ru>
Fri, 1 May 2020 12:43:42 +0000 (13:43 +0100)
committerAnton Yuzhaninov <citrin+git@citrin.ru>
Fri, 1 May 2020 13:03:17 +0000 (14:03 +0100)
Regression was introduced in 23675060063301aaa3c93044e0029fda553d4e8f

rules/headers_checks.lua

index 6c548982270454e6bed6b8e21b6b5c35de48b840..ec8208d8c526a5db2b74a417187a8afe04958065 100644 (file)
@@ -656,13 +656,14 @@ local check_from_id = rspamd_config:register_symbol{
           task:insert_result('FROM_NAME_EXCESS_SPACE', 1.0)
         end
       end
-      if (envfrom and envfrom[1] and
-        util.strequal_caseless(envfrom[1].addr, from[1].addr))
-      then
-        task:insert_result('FROM_EQ_ENVFROM', 1.0)
+
+      if envfrom then
+        if util.strequal_caseless(envfrom[1].addr, from[1].addr) then
+          task:insert_result('FROM_EQ_ENVFROM', 1.0)
+        elseif envfrom[1].addr ~= '' then
+          task:insert_result('FROM_NEQ_ENVFROM', 1.0, from[1].addr, envfrom[1].addr)
+        end
       end
-    elseif (envfrom and envfrom[1] and envfrom[1].addr) then
-      task:insert_result('FROM_NEQ_ENVFROM', 1.0, ((from or E)[1] or E).addr or '', envfrom[1].addr)
     end
 
     local to = task:get_recipients(2)