diff options
author | Andrew Lewis <nerf@judo.za.org> | 2016-08-19 21:26:23 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2016-08-19 21:26:23 +0200 |
commit | 1967abd5fb8ab5e1a3c7a07475f38421529cc88d (patch) | |
tree | 86a022dc2ae0a179efb5c28e9dd2aca7c9f13525 /src | |
parent | 14ab88afca52e61e85be5a667a90b5ca4c6905e1 (diff) | |
download | rspamd-1967abd5fb8ab5e1a3c7a07475f38421529cc88d.tar.gz rspamd-1967abd5fb8ab5e1a3c7a07475f38421529cc88d.zip |
[Fix] DMARC: deal with missing and spurious spaces
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/dmarc.lua | 7 |
1 files changed, 1 insertions, 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 |