Skip to content

Issue when updating customer email in Admin Panel with ö and .swiss domain

I’m encountering an issue when trying to change a customer’s email address in the Admin Panel (Account Information) in Magento Version 2.4.5-p10 and 2.4.6-p7.

Steps to Reproduce:

  1. Go to the Admin Panel.
  2. Navigate to Customers > All Customers and select a customer.
  3. In the Account Information section, try to update the email address to something like max@möstermann.swiss.
  4. Save the changes.

Error Message:

After attempting to save the email, the following error message is displayed at the top of the page:

  • “Email” is not a valid hostname.
  • ‘xn--mstermann-07a.swiss’ looks like a DNS hostname but we cannot match it against the hostname schema for TLD ‘swiss’.
  • ‘xn--mstermann-07a.swiss’ looks like a local network name, which is not an acceptable format.

Observations:

  • When I enter an email like max@möstermann.com, it works fine.
  • When I enter max@möstermann.swiss with the ö, the email is converted to its Punycode equivalent (xn--mstermann-07a.swiss), and the error is triggered.
  • I tried .swiss by itself without the special character ö (e.g., [email protected]) and it works fine.

It seems like the combination of the ö character and .swiss is causing the issue. The email address gets converted to Punycode, but it seems Magento or the underlying validation logic doesn’t handle this combination correctly.

Has anyone experienced this issue before or know how to fix it?

Any help would be greatly appreciated!