From cb038700560b6a16980229b26feed72a0ceeba5b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 16 May 2024 16:05:10 +0100 Subject: [PATCH] [Fix] Allow spaces in DMARC records Issue: #4906 --- lualib/plugins/dmarc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lualib/plugins/dmarc.lua b/lualib/plugins/dmarc.lua index 7791f4eb3..38977ff58 100644 --- a/lualib/plugins/dmarc.lua +++ b/lualib/plugins/dmarc.lua @@ -240,8 +240,8 @@ local function gen_dmarc_grammar() lpeg.locale(lpeg) local space = lpeg.space ^ 0 local name = lpeg.C(lpeg.alpha ^ 1) * space - local sep = space * (lpeg.S("\\;") * space) + (lpeg.space ^ 1) - local value = lpeg.C(lpeg.P(lpeg.graph - sep) ^ 1) + local sep = space * (lpeg.S("\\;") * space) + (lpeg.P(lpeg.graph - lpeg.P(',')) * lpeg.space ^ 1) + local value = lpeg.C(lpeg.P(lpeg.P(lpeg.graph + lpeg.space) - sep) ^ 1) local pair = lpeg.Cg(name * "=" * space * value) * sep ^ -1 local list = lpeg.Cf(lpeg.Ct("") * pair ^ 0, rawset) local version = lpeg.P("v") * space * lpeg.P("=") * space * lpeg.P("DMARC1") -- 2.39.5