From e8d715b09863453836906c19f8b82b43f08591dd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 30 Jul 2021 15:26:16 +0100 Subject: [PATCH] [Minor] Dmarc: Relax grammar to allow elements with no semicolons --- src/plugins/lua/dmarc.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index 2460fbe91..a46c6d7ab 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -102,12 +102,12 @@ local function gen_dmarc_grammar() lpeg.locale(lpeg) local space = lpeg.space^0 local name = lpeg.C(lpeg.alpha^1) * space - local sep = lpeg.S("\\;") * space + local sep = (lpeg.S("\\;") * space) + (lpeg.space^1) local value = lpeg.C(lpeg.P(lpeg.graph - 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") - local record = version * space * sep * list + local record = version * sep * list return record end -- 2.39.5