From: Vsevolod Stakhov Date: Thu, 16 May 2024 15:05:10 +0000 (+0100) Subject: [Fix] Allow spaces in DMARC records X-Git-Tag: 3.9.0~41^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cb038700560b6a16980229b26feed72a0ceeba5b;p=thirdparty%2Frspamd.git [Fix] Allow spaces in DMARC records Issue: #4906 --- diff --git a/lualib/plugins/dmarc.lua b/lualib/plugins/dmarc.lua index 7791f4eb37..38977ff58a 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")