Skip to content

Commit

Permalink
Fix #876 - Permit RFC9091 np= in DMARC policy (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha authored May 2, 2023
1 parent 1be40d0 commit 2e00d1e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions checks/tasks/dmarc_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
# The following directives can be found under <parsed_result>['directives']
# if any:
# - request, (p=);
# - nrequest, (np=);
# - srequest, (sp=);
# - auri, (rua=);
# - furi, (ruf=);
Expand Down Expand Up @@ -103,6 +104,11 @@ def _check_dmarc_uri(tokens):
+ equal
+ (CaselessLiteral("none") | CaselessLiteral("quarantine") | CaselessLiteral("reject"))
)("srequest")
nrequest = Combine(
CaselessLiteral("np")
+ equal
+ (CaselessLiteral("none") | CaselessLiteral("quarantine") | CaselessLiteral("reject"))
)("nrequest")
request = Combine(
CaselessLiteral("p") + equal + (CaselessLiteral("none") | CaselessLiteral("quarantine") | CaselessLiteral("reject"))
)("request")
Expand All @@ -111,6 +117,7 @@ def _check_dmarc_uri(tokens):
Optional(request)
+ (
Optional(sep + srequest)
& Optional(sep + nrequest)
& Optional(sep + auri)
& Optional(sep + furi)
& Optional(sep + adkim)
Expand Down

0 comments on commit 2e00d1e

Please sign in to comment.