]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Fix] dmarc gramar - allow spaces before ";" 4547/head
authorStephan Toggweiler <609601+rheoli@users.noreply.github.com>
Fri, 21 Jul 2023 07:15:07 +0000 (09:15 +0200)
committerGitHub <noreply@github.com>
Fri, 21 Jul 2023 07:15:07 +0000 (09:15 +0200)
The ABNF in https://www.rfc-editor.org/rfc/rfc7489#section-6.4 define that its allowed to have spaces before ";"

lualib/plugins/dmarc.lua

index b080324b032d7aa575ca5f0d44870c38c0cbea33..24efb50783a75989107ce3cc500fd30bde7437fc 100644 (file)
@@ -241,7 +241,7 @@ 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) + (lpeg.space^1)
+  local sep = space * (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)
@@ -357,4 +357,4 @@ end
 
 exports.dmarc_check_record = dmarc_check_record
 
-return exports
\ No newline at end of file
+return exports