diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-18 10:49:53 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-18 10:49:53 +0100 |
commit | 4d52a5896a9b795faffdd4142363a37582c8e346 (patch) | |
tree | e3276c0ecaaeb6efaebe1ef663e784cf84fad81a | |
parent | 8f9e6acda8c899ddef44bb5559a08b79287a5155 (diff) | |
download | rspamd-4d52a5896a9b795faffdd4142363a37582c8e346.tar.gz rspamd-4d52a5896a9b795faffdd4142363a37582c8e346.zip |
[Fix] Dmarc: Always lowercase domain
Issue: #3940
-rw-r--r-- | src/plugins/lua/dmarc.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index ffc37ae3d..d5073377b 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -131,7 +131,7 @@ local function dmarc_validate_policy(task, policy, hdrfromdom, dmarc_esld) for _,opt in ipairs(opts) do local check_res = string.sub(opt, -1) - local domain = string.sub(opt, 1, -3) + local domain = string.sub(opt, 1, -3):lower() if check_res == '+' then table.insert(dkim_results.pass, domain) @@ -357,6 +357,8 @@ local function dmarc_callback(task) -- Do some initial sanity checks, detect tld domain if different if hfromdom and hfromdom ~= '' and not (from or E)[2] then + -- Lowercase domain as per #3940 + hfromdom = hfromdom:lower() dmarc_domain = rspamd_util.get_tld(hfromdom) elseif (from or E)[2] then task:insert_result(settings.symbols['na'], 1.0, 'Duplicate From header') |