From 7648f9524fec38c2386e501dd815feb839140d5e Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Mon, 12 Jun 2017 15:37:57 +0200 Subject: [PATCH] [Fix] FORWARDING: fix comparisons --- rules/forwarding.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rules/forwarding.lua b/rules/forwarding.lua index c5ac81c52..dfd197b50 100644 --- a/rules/forwarding.lua +++ b/rules/forwarding.lua @@ -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 -- 2.39.5