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

How to reject e-mail addresses with UTF-8 characters in the local part? #7

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

Comments

@weierophinney
Copy link
Member

zend-validator 2.9.0 used to reject e-mail addresses with utf-8 characters in the local part (e.g. å or ö). As of zend-validator 2.10.0, such e-mail addresses seem to be considered valid. We are using postmark to send e-mails, which throws an exception at such e-mail addresses. Is there a way to configure Zend\Validator\EmailAddress to reject these e-mail addresses?


Originally posted by @aimfeld at zendframework/zend-validator#224

@weierophinney
Copy link
Member Author

As a workaround, I have extended the EmailAddress validator like this:

class EmailAddress extends \Zend\Validator\EmailAddress
{
    protected function validateInternationalizedLocalPart($localPart)
    {
        return false;
    }
}

This seems to work. Is there any better way to handle this?


Originally posted by @aimfeld at zendframework/zend-validator#224 (comment)

@weierophinney
Copy link
Member Author

Have same problem: Amazon SES allow only 7-bit ASCII characters in local part of e-mail Amazon SES API Docs.

I'm not sure if your workaround is best solution, i would prefer flag to be able switch between those utf-8 characters.


Originally posted by @Buzka91 at zendframework/zend-validator#224 (comment)

@gsteel
Copy link
Member

gsteel commented Jul 16, 2024

Closing as stale

@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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants