Skip to content

Commit

Permalink
[Fix] dmarc gramar - allow spaces before ";"
Browse files Browse the repository at this point in the history
The ABNF in https://www.rfc-editor.org/rfc/rfc7489#section-6.4 define that its allowed to have spaces before ";"
  • Loading branch information
rheoli committed Jul 21, 2023
1 parent 9be4e9c commit 008b90e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lualib/plugins/dmarc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -357,4 +357,4 @@ end

exports.dmarc_check_record = dmarc_check_record

return exports
return exports

0 comments on commit 008b90e

Please sign in to comment.