Project

General

Profile

Actions

Feature #29208

closed

Support email addresses with IDN (internationalized domain names) in user accounts

Added by Go MAEDA almost 6 years ago. Updated 2 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
I18n
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed

Description

This is a patch to add IDN (internationalized domain names) support to email addresses of user accounts.

Currently, Redmine does not accept IDN email addresses like "joe@ドメイン名例.jp" and its ASCII expression "" when creating/updating a user account. After applying this patch, both expressions will be accepted.

According to IDN World Report, there are approx 8.7 millions IDNs in the world as of December 2016, and those are used in many countries. To support IDN email addresses should be beneficial for many people.

This patch converts Unicode domain names to traditional ASCII domain names just before saving an email address. However, it does not convert ASCII domain names to Unicode domain names when displaying email address. Users will see ASCII expression "" on my_account page even if they have entered Unicode email address "joe@ドメイン名例.jp".

This approach can minimize the change to existing code and works fine with IDN-unaware MTAs and plugins while allowing people to use IDN email addresses.

"Email" field accepts Unicode domain names:

ASCII converted email address is shown after saving:

References:


Files


Related issues

Related to Redmine - Defect #28878: Email does not support Russian-language domains.Closed

Actions
Related to Redmine - Defect #15985: Email address with non-ASCII character causes delivery errorClosed

Actions
Related to Redmine - Defect #32793: Email address with Punycode top-level domain is not acceptedClosedJean-Philippe Lang

Actions
Actions #1

Updated by Go MAEDA almost 6 years ago

  • Related to Defect #28878: Email does not support Russian-language domains. added
Actions #2

Updated by Go MAEDA almost 6 years ago

  • Related to Defect #15985: Email address with non-ASCII character causes delivery error added
Actions #3

Updated by Go MAEDA almost 6 years ago

Fixed unnecessary Punycode conversion when an invalid email address is entered.

Actions #4

Updated by Go MAEDA almost 6 years ago

Removed unnecessary "require 'simpleidn'".

Actions #5

Updated by Go MAEDA almost 6 years ago

Updated the patch.

  • Simplified the code by replacing String#rpartition with String#partition.
  • Added tests to make sure that local-part is not encoded with Punycode.
Actions #6

Updated by Go MAEDA almost 6 years ago

  • Target version set to 4.1.0

As we can see in #28878, there are already people who are in trouble because of lack of internationalized domain name support. I think that more and more people will start using email addresses with IDN. Let's deliver this feature in the next major release.

Actions #7

Updated by Go MAEDA over 5 years ago

I divided support-idn-email-addresses-v4.diff into two patches. The first one changes only the regular expression to allow Punycode in email addresses. The second one supports email addresses which include Unicode characters in the domain names.

I think that Redmine should support Punycode at least. If 0001-Allow-Punycode-in-email-addresses.patch is merged, a user who has uses an email address "joe@ドメイン名例.jp" can make his account on Redmine by spelling his email address as "".

Actions #8

Updated by Go MAEDA over 5 years ago

  • File deleted (0001-Allow-Punycode-in-email-addresses.patch)
Actions #9

Updated by Go MAEDA over 5 years ago

Improved the regular expression for email addresses.

Actions #10

Updated by Go MAEDA about 5 years ago

  • Target version changed from 4.1.0 to Candidate for next major release

It seems that no one is interested in this feature. Maybe this feature does not worth adding a gem for now.

Actions #11

Updated by Go MAEDA about 4 years ago

  • Related to Defect #32793: Email address with Punycode top-level domain is not accepted added
Actions #12

Updated by Go MAEDA 3 months ago

Go MAEDA wrote in #note-10:

It seems that no one is interested in this feature. Maybe this feature does not worth adding a gem for now.

We can add this feature without adding an extra gem because Addressable gem already used in Redmine supports Puny code conversion.

$ bin/rails c
Loading development environment (Rails 7.1.2)
irb(main):001> Addressable::IDNA.to_ascii('ドメイン名例.jp')
=> "xn--eckwd4c7cu47r2wf.jp" 
Actions #13

Updated by Go MAEDA 3 months ago

  • File 29208.patch 29208.patch added
  • Subject changed from IDN support for email addresses of user accounts to Support email addresses with internationalized domain names in user accounts

I have updated the patch to support email addresses with an internationalized domain name (IDN). This new patch uses an already loaded Addressable gem instead of adding a new gem to decode internationalized domain names.

Actions #14

Updated by Go MAEDA 3 months ago

  • Subject changed from Support email addresses with internationalized domain names in user accounts to Support email addresses with IDN (internationalized domain names) in user accounts
  • Category changed from Accounts / authentication to I18n
  • Target version changed from Candidate for next major release to 6.0.0

Setting the target version to 6.0.0.

Actions #15

Updated by Go MAEDA 2 months ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the patch in r22667.

Actions

Also available in: Atom PDF