Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

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

Open
aimfeld opened this issue Apr 4, 2018 · 3 comments
Open

Comments

@aimfeld
Copy link

aimfeld commented Apr 4, 2018

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?

@aimfeld
Copy link
Author

aimfeld commented Apr 4, 2018

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?

@Buzka91
Copy link

Buzka91 commented Jun 12, 2018

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.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-validator; a new issue has been opened at laminas/laminas-validator#7.

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

No branches or pull requests

3 participants