From 1967abd5fb8ab5e1a3c7a07475f38421529cc88d Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 19 Aug 2016 21:26:23 +0200 Subject: [PATCH] [Fix] DMARC: deal with missing and spurious spaces --- src/plugins/lua/dmarc.lua | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index bafaa0eb7..3e72a4d30 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -36,8 +36,7 @@ local symbols = { local redis_params = nil local dmarc_redis_key_prefix = "dmarc_" local dmarc_domain = nil -local elts_re = rspamd_regexp.create_cached("\\\\{0,1};\\s+") -local trim_re = rspamd_regexp.create_cached("(.+)\\\\{0,1};$") +local elts_re = rspamd_regexp.create_cached("\\s*\\\\{0,1};\\s*") local dmarc_reporting = false local dmarc_actions = {} @@ -114,10 +113,6 @@ local function dmarc_callback(task) local elts = elts_re:split(r) if elts then - local trimmed = trim_re:search(elts[#elts], true, true) - if trimmed then - elts[#elts] = trimmed[1][2] - end for _,e in ipairs(elts) do dkim_pol = string.match(e, '^adkim=(.)$') if dkim_pol then -- 2.39.5