summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-06-12 15:37:57 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-06-12 15:39:59 +0200
commit7648f9524fec38c2386e501dd815feb839140d5e (patch)
treef6813788fa3534f7d1b94cdde0352ffae35614d5 /rules
parenta4f1a73b13a7023fcc1019806f350c58a509d5d7 (diff)
downloadrspamd-7648f9524fec38c2386e501dd815feb839140d5e.tar.gz
rspamd-7648f9524fec38c2386e501dd815feb839140d5e.zip
[Fix] FORWARDING: fix comparisons
Diffstat (limited to 'rules')
-rw-r--r--rules/forwarding.lua6
1 files 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