From: Vsevolod Stakhov Date: Fri, 30 Jul 2021 14:26:16 +0000 (+0100) Subject: [Minor] Dmarc: Relax grammar to allow elements with no semicolons X-Git-Tag: 3.0~66 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e8d715b09863453836906c19f8b82b43f08591dd;p=rspamd.git [Minor] Dmarc: Relax grammar to allow elements with no semicolons --- 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