Skip to content

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