diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-07 15:18:50 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-03-07 15:18:50 +0000 |
commit | c16853235d94948f15965127b687945b466755ec (patch) | |
tree | 11c8dc39676cd256b3c36af260988dd401dff417 | |
parent | 76740965ccff2563afb08e37ce0185003bc2063b (diff) | |
download | rspamd-c16853235d94948f15965127b687945b466755ec.tar.gz rspamd-c16853235d94948f15965127b687945b466755ec.zip |
[Fix] Use caseless comparison in dmarc module
-rw-r--r-- | src/plugins/lua/dmarc.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 06509e1c8..fd0e9912a 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -199,12 +199,12 @@ local function dmarc_callback(task) if task:has_symbol(symbols['spf_allow_symbol']) then efrom = task:get_from(1) if efrom and efrom[1] and efrom[1]['domain'] then - if efrom[1]['domain'] == from[1]['domain'] then + if rspamd_util.strequal_caseless(efrom[1]['domain'], from[1]['domain']) then spf_ok = true elseif not strict_spf then - if string.sub(efrom[1]['domain'], - -string.len('.' .. lookup_domain)) - == '.' .. lookup_domain then + if rspamd_util.strequal_caseless( + string.sub(efrom[1]['domain'], -string.len('.' .. lookup_domain)), + '.' .. lookup_domain) then spf_ok = true end end @@ -213,12 +213,12 @@ local function dmarc_callback(task) local das = task:get_symbol(symbols['dkim_allow_symbol']) if das and das[1] and das[1]['options'] then for i,dkim_domain in ipairs(das[1]['options']) do - if from[1]['domain'] == dkim_domain then + if rspamd_util.strequal_caseless(from[1]['domain'], dkim_domain) then dkim_ok = true elseif not strict_dkim then - if string.sub(dkim_domain, - -string.len('.' .. lookup_domain)) - == '.' .. lookup_domain then + if rspamd_util.strequal_caseless( + string.sub(dkim_domain, -string.len('.' .. lookup_domain)), + '.' .. lookup_domain) then dkim_ok = true end end |