]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] FORWARDING: fix comparisons
authorAndrew Lewis <nerf@judo.za.org>
Mon, 12 Jun 2017 13:37:57 +0000 (15:37 +0200)
committerAndrew Lewis <nerf@judo.za.org>
Mon, 12 Jun 2017 13:39:59 +0000 (15:39 +0200)
rules/forwarding.lua

index c5ac81c5278c8837c7db626800d24d7ff0be255a..dfd197b503e5f83655edb9afa066ab476022fa25 100644 (file)
@@ -16,6 +16,8 @@ limitations under the License.
 
 -- Rules to detect forwarding
 
+local rspamd_util = require "rspamd_util"
+
 rspamd_config.FWD_GOOGLE = {
   callback = function (task)
     if not (task:has_from(1) and task:has_recipients(1)) then
@@ -135,9 +137,9 @@ rspamd_config.FORWARDED = {
           addr = normalize_addr(addr)
           matches = matches + 1
           -- Check that it doesn't match the envrcpt
-          if addr ~= envrcpts[1].addr:lower() then
+          if not rspamd_util.strequal_caseless(addr, envrcpts[1].addr) then
             -- Check for mailing-lists as they will have the same signature
-            if matches < 2 and lu and to and to[1].addr:lower() == addr then
+            if matches < 2 and lu and to and rspamd_util.strequal_caseless(to[1].addr, addr) then
               return false
             else
               return true, 1.0, addr