Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPF / DMARC case sensitivity #1400

Open
bwbroersma opened this issue Apr 23, 2024 · 3 comments
Open

SPF / DMARC case sensitivity #1400

bwbroersma opened this issue Apr 23, 2024 · 3 comments
Labels
bug Unexpected or unwanted behaviour of current implementations
Milestone

Comments

@bwbroersma
Copy link
Collaborator

These are case sensitive regular expressions:

DMARC_NON_SENDING_POLICY = re.compile(r"^v=DMARC1;\ *p=reject;?")
DMARC_NON_SENDING_POLICY_ORG = re.compile(r"v=DMARC1;(?:.*sp=reject|\ *p=reject(?!.*sp=))")
SPF_NON_SENDING_POLICY = re.compile(r"^v=spf1\ +(?:exp=[^ ]+\ +)?-all;?(?:\ +exp=[^ ]+)?$")

While the only case sensitive part is DMARC1, the rest is case insensitive according to the ABNF grammar and the related RFC 5234 - Augmented BNF for Syntax Specifications: ABNF - page 5.

Related:

@bwbroersma bwbroersma added the bug Unexpected or unwanted behaviour of current implementations label Apr 23, 2024
@bwbroersma bwbroersma added this to the backlog milestone Apr 23, 2024
@gthess
Copy link
Collaborator

gthess commented Apr 23, 2024

They are but they are used on already parsed records IIRC, so case sensitivity does not matter at that point.

@gthess
Copy link
Collaborator

gthess commented Apr 23, 2024

I mean if they turn into case insensitive regular expressions it should work.

@bwbroersma
Copy link
Collaborator Author

Could indeed be converted to case insensitive regular expressions to fix this part of the regex parsing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected or unwanted behaviour of current implementations
Development

No branches or pull requests

2 participants