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

Accented characters in emails are failing validation #21

Closed
weierophinney opened this issue Dec 31, 2019 · 6 comments
Closed

Accented characters in emails are failing validation #21

weierophinney opened this issue Dec 31, 2019 · 6 comments
Assignees

Comments

@weierophinney
Copy link
Member

This example email used to validate fine until ZF2 2.9.0: frédé[email protected]

As far as I can see, it's supposed to be valid according to RFC 6532 http://stackoverflow.com/a/760151/1381550
In theory it should not fail validation, and what was brought in ZF2 2.9.0 is a breaking change.

Was this on purpose?


Originally posted by @amcsi at zendframework/zend-validator#155

@weierophinney
Copy link
Member Author

Validator does support internationalized local part, previously it was passing due to IDNA false positive bug.


Originally posted by @Xerkus at zendframework/zend-validator#155 (comment)

@weierophinney
Copy link
Member Author

@Xerkus but if the validator yields false for them, it means it clearly doesn't support them.


Originally posted by @amcsi at zendframework/zend-validator#155 (comment)

@weierophinney
Copy link
Member Author

sorry, that was a typo. "does not"*

internationalization brings in support for utf characters where were
none, which complicates things a lot

I will try to add proper support for them, will need to do research on the
topic

--
Aleksei Khudiakov
Developer at Roave LLC
https://roave.com

On Apr 6, 2017 18:39, "Attila Szeremi" [email protected] wrote:

@Xerkus https://github.com/Xerkus but if the validator yields false for
them, it means it clearly doesn't support them.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
zendframework/zend-validator#155 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAsTUkZlB4vwRuV2C1igcAY2Ht7WCNh6ks5rtKS6gaJpZM4MkBba
.


Originally posted by @Xerkus at zendframework/zend-validator#155 (comment)

@vinnyusestrict
Copy link

I'm running into the same issue. A client of mine is in Israel and her messages are failing with the bad internationalized domain error:

Fatal error: Uncaught Laminas\Mail\Exception\InvalidArgumentException: 'mhmc.co.xn--il>-5qe' is not a valid hostname for the email address in /path/to/includes/vendor/laminas/laminas-mail/src/Address.php

Are there plans for fixing this?

@vinnyusestrict
Copy link

I added some debugging and found that the issue is the preg_match on line 495 of laminas-validator/src/EmailAddress.php.

The value matched against has a Hebrew character after the closing >:

ג לא <[email protected]

Replacing the regex with /^(?:.*<)?(.+)@([^@]+?)(?:>|$)/ fixes the problem. However, the original regular expression leads me to believe that it was expecting just what is inside the < and >, so perhaps a better fix would be in the header parser that pulls the address in the first place.

I hope this helps.

@gsteel
Copy link
Member

gsteel commented Jul 16, 2024

Tests already cover this issue. It's stale and no longer relevant

@gsteel gsteel closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants