-
Notifications
You must be signed in to change notification settings - Fork 1
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
validateLocalPart allows "@" #5
Comments
Yep, that seems wrong ;) If you have the time I'd happily accept a patch to fix this. |
I had a look at it and realized that after decoding a mail address the resulting local part never has surrounding quotes: decode "\"@\".example.org" ^?! _Right . localPart
-- LocalPart "@" They are only added back—if necessary—by the functions in the module Addy.Internal.Render which comes in when Why is this relevant? Because when the parser-phase during I suggest changing this in the following way:
I think this change would also lead to a better API: I as a user thought I could use the
What do you think of my suggestion? I would be willing to do the implementation work. |
I looked into this a bit further and realized that the parser removes not only surrounding quotes but also escaping backslashes In other words does the local part I really do hope I am not a nuisance with all my comments and raised issues. |
@JaSpa I really appreciate you looking into this and coming up with some very good suggestions. My intent was to make it impossible to construct illegal email addresses. It's definitely a problem that the parser strips off the quotes if they are necessary. In the case of having I agree with your suggestions about quote normalization and the changes that need to be made. Please let me know if you need any help while writing up a patch. I look forward to seeing your changes! Oh, and as far as |
I came across another thing regarding local parts I don't think is correct: only quoted local parts should be allowed to contain
@
.The problem seems to be in
validateLocalPart
whereallowedChar
allows characters which may only occur in quoted local parts to occur unquoted.The text was updated successfully, but these errors were encountered: