New TLD's are not supported by Magento
Add the domain names from the IANA list.
[redacted]@payload.tech
.Read the errors
Changes successfully saved
'payload.tech' is not a valid hostname for email address '[redacted]@payload.tech'
version 2.1 - this crap just still not fixed ... wtf?????
I Think this is because of a wrongfully or not completely used part of Zend framework. Because Zend can handle all tld's fine. But for some reason Magento is not...
Here are tests that check for these error messages, beyond this I'm not familiar with the codebase, or even PHP to contribute much 😞
Great! Thank you.
in the meantime, is there any workaround?
we also have this issue when registering an email address under .online domain
When will there be a solution?
I need a email in justsign.shop
for a workaround I just put changeme.com for the domain, then used phpmyadmin to find and change those rows in the db table 'core_config_data'. it sends fine, but you won't be able to make further changes using the web interface to the e-mail related stuff since the validation is still active there.
It appears that this issue is linked to #8070 since the Zend validator version which Magento 2 uses does not include nor .shop nor .tech nor .dog.
Currently on the develop branch Magento uses 2.4.10 version of zend-validator, but the new TLDs were added in 2.5.0, 2.7.3, and several other versions. The newest Zend validator version is 2.8.1.
Maybe the Magento team could disable the validator for the admin pages until they get around to updating the zend framework? People trying to register in the front end with a new domain are used to this by now, they fail on lots of web apps. They can work around it just by using another e-mail.
.swiss
is also missing.
Requires updating ZF1 and ZF2 - part of #8070
This should be automatically updated from the list at
http://data.iana.org/TLD/tlds-alpha-by-domain.txt
TLDs are frequently added.
@piotrekkaminski, it's better to go this way: https://github.com/magento/magento2/pull/8420/files#r99476657
Not by hardcoding strpos($request->getParam('email'), '@')
everywhere but by changing https://github.com/magento/magento2/blob/develop/lib/internal/Magento/Framework/Validator/EmailAddress.php behavior.
Is it possible to get a workaround for this?
I took it.
Pull request created, ran through Travis, needs further refactoring.
Sent from my iPhone
On Mar 16, 2017, at 17:32, Ievgen Shakhsuvarov notifications@github.com wrote:
Assigned #4547 to @ivanrogar.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Need to use the last version of Zend_Validator (2.9 at the moment): https://github.com/zendframework/zend-validator/blob/master/src/Hostname.php
I'd like to update my proposed solution to enabling all passed in emails by default, with a verification link. New tld's come out every day, and hardcoding an outdated list will make this issue pop up in the future.
Still not fixed in magento 2.1.6.
When making a account
magento refuse the customers email that exist
We have this issue to. That's why we made a small library to overcome this problem in Magento 2 and other applications which depends on Zend Framework 1.
https://packagist.org/packages/activeants/zendframework1-overwrite
@reijervano What is this patch library suppose to do? I tried but it doesn't fix the validator
@hongzhou85 it should overwrite the library/Zend/Validate/Hostname.php class with the latest version from Zend.
@reijervano could you share the path? I'm using a bitnami image of the magento2. So maybe it could be different. Do we need to recompile after the change?
If you install the extension with composer it should work. If you just want to download the class you can do it from our bitbucket.
Problem also occurs upon "forgotten password" feature.
It is really embarassing to run a Magento Shop, that can't handle logins from emails with a valid TLD. The solutions here all seem to involve core hacks or changes of the composer structure given by Magento. These changes bring to many risks. I can't see the benefit of using ZEND to validate here. PHP has a perfect feature built in to validate emails (filter_var($email, FILTER_VALIDATE_EMAIL)). There is absolutely no need for the additional checks that don't even work in the end. I suggest that the Magento Team removes all instances of ZEND_VALIDATE related to E-Mail Addresses
filter_var
is obviously a bigger evil as it even does not follow any RFC completely :) The best alternative I see currently is described here.
This can be fixed by updating the new TLD in the Hostname.php
use SSH to find the location of Hostname.php use the command in the root directory of install find . -name Hostname.php
You will get the location of the files having hostname.php
Open hostname.php and add the desired domain in the TLD list it will fix the issue.
Kindly do the backup of website files and database before doing any sort of changes.
I had updated Hostname.php and it is working. I know it is a temporary solution, however, until we have a fix for this from Magento, this is a good try.
Glad was able to help @pmjcreations
This has been fixed in the 2.2 RC apparently: http://devdocs.magento.com/guides/v2.2/release-notes/release-notes-2-2-RC2-CE.html#miscellaneous-1 scroll to misc section at the bottom
Magento now supports new top level domains for email addresses. GitHub-4547 (RC1.6)
Anyone verify?
@Khaleel from https://github.com/magento/magento2/commits/2.2.0-preview/lib/internal/Magento/Framework/Validator/EmailAddress.php it should have been fixed in MAGETWO-64901: Bypassing outdated TLD validation
.
This issue is now fixed in 2.2.0
. Please refer to the commits prefixed with MAGETWO-64901
Thank you
@magento-engcom-team why did you use a bridge validator in magento framework to use zend2 and didn't you change Zend_Validate::is method with isValid method directly? In my case i did it and it works fine everything.
@elachino does current core fix work for you? I suppose Zend_Validate::is
is ZF1 obsoleted code and changing it is not a good idea. It could be changed as a quick-n-dirty fix for 2.1.x
though.
This magento fix works in magento 2.2 only and if you want port in magento 2.1 you have to write this bridge functions in magento 2.1 also. For now i chenged Zend_Validate::is
with this code $validator = new \Zend\Validator\EmailAddress();
$validator->isValid($email)
only where magento check email address.
I think this is a quick-n-dirty solution, would be to rewrite magento to not use zf1 but zf2 or at least rewrite zend_validate module.
I see. It is not possible to upgrade ZF2 components in 2.1.x
patch release, if you prepare a PR for 2.1.x
as you described I believe it has high chances to be merged.
Hi @amingilani. Thank you for your report.
The issue has been fixed in magento/magento2#11576 by @elachino in 2.1-develop branch
Related commit(s):
The fix will be available with the upcoming 2.1.16 release.
How much trouble would it be to add support for a custom TLD. We have multiple environments for CRM that is supported by a 3rd party. Whenever dev and test are updated with prod database, all of our email addresses in the CRM are set to a fake TLD to avoid accidentally emailing our actual customers while we go through testing. I plan on writing a module to support it, but it would be awesome if there was just a core_config_data field or something that could have a non-valid TLD that is still allowed through.
Most helpful comment
version 2.1 - this crap just still not fixed ... wtf?????