Browse Source

[Fix] Dmarc: Always lowercase domain

Issue: #3940
tags/3.1
Vsevolod Stakhov 2 years ago
parent
commit
4d52a5896a
1 changed files with 3 additions and 1 deletions
  1. 3
    1
      src/plugins/lua/dmarc.lua

+ 3
- 1
src/plugins/lua/dmarc.lua View File

@@ -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')

Loading…
Cancel
Save