Skip to content

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Oct 14, 2025

Description

Before v4.0.0, we were using SwiftMailer, which didn’t allow non-ascii chars in the local part of the email (related issue); now, we’re using yiisoft/yii2-symfonymailer which uses symfony/mime to deal with email addresses: https://github.com/symfony/mime/blob/7.2/Encoder/IdnAddressEncoder.php and it does allow non-ascii chars in the local part of the email address.

This PR:

  • Allows non-ASCII characters to be in the local part of the email address. They’re already allowed in the domain part.
  • Adds new useIdnaNontransitionalToUnicode general config setting, which is false by default. When set to true, it treats a handful of characters (including ß) in a way compatible with IDNA2003. More info can be found here.

Further background:
Currently, non-ASCII characters are allowed in the domain part of the email address. This means that you register a user with an email address of test@teßt.com; however, when that email is run via the idn_to_utf8() method, it’s changed to [email protected]. Since this has been the case for a while, we need to keep this behaviour. That said, it should also be possible to keep the German eszett intact, if that’s what you want, especially since we’re now allowing for such characters in the local part of the email address. The new useIdnaNontransitionalToUnicode allows for that behaviour.

It also looks like the browser’s email validation doesn’t accept non-ASCII characters, despite the RFC allowing them; so, to accept them, you’ll have to have novalidate on your front-end forms.

Related issues

#16969

@i-just i-just requested a review from brandonkelly October 14, 2025 16:32
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

Successfully merging this pull request may close these issues.

1 participant