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

Use CaseInsensitive for domain part to follow RFC #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

albertov
Copy link

@albertov albertov commented Oct 3, 2019

According to RFC 1035, section 3.1:

Name servers and resolvers must compare [domains] in a case-insensitive manner

So I believe the Eq and Ord instances of EmailAddress should take it into account. This PR implements it in a API preserving way which didn't need tweaking any tests by using Data.CaseInsensitive.CI to store the domain part- A domainPartOriginal is provided to extract it in the original case in which it was parsed. Perhaps, fort better backwards compatibility, it should be the other way around? (ie: provide a domainPartFoldedCase to extract it folded and leave domainPart returning the original case)

@Porges
Copy link
Owner

Porges commented Oct 10, 2019

I think it makes sense for the domain part but it’s going to be a breaking change to do this so would need to be in a major version update. The local part should not be case-insensitive as the interpretation is meant to be entirely up to the destination server (which could allow case-sensitive emails, although that would be unusual!)

@albertov
Copy link
Author

Indeed! The local part change slipped in, it’s something we finally decided to do internally and wasn’t intended to be proposed upstream. I’ll clean that up and bump version tomorrow

@ddssff
Copy link

ddssff commented Jan 21, 2024

ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants