Skip to content

Support formatting UTF-8 email addresses #118716

Open

Description

@cedk

Feature or enhancement

Proposal:

RFC 6530 allows UTF-8 strings in email addresses.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

  1. added a commit that references this issue on May 7, 2024
  2. bitdancer commented on May 7, 2024

    @bitdancer
    Member

    This is not a minor feature, because RFCs are never simple. I haven't read the RFC in detail. The new email API (is supposed to) fully support RFC 6532 (see policy.SMTPUTF8), and can interoperate with smtplib to correctly send and receive internationalized email messages (at least in theory). Any new abilities/requirements in RFC 6530 that are not met by the existing code should be addressed in the new API. The legacy API only supports the older RFCs and so should not be modified.

  3. cedk commented on May 7, 2024

    @cedk
    ContributorAuthor

    The formataddr is useful even with the new email API to format correctly the name and the address when you have only the name and the full address.

  4. cedk commented on May 8, 2024

    @cedk
    ContributorAuthor

    Indeed email.headerregistry.Address could be used but it does not support neither non-ASCII local part if used with addr_spec argument.
    So I think it should also be extended.

  5. bitdancer commented on May 9, 2024

    @bitdancer
    Member

    Right, that's where the extension should be done. I'd have to read the RFC to decide if a new policy flag is needed, but my guess from a very cursory skim is that it wouldn't be. I'm guessing allowing it if policy.utf8 is True would be enough. But like I said, I haven't actually read the RFC (yet).

  6. added a commit that references this issue on May 10, 2024
  7. bitdancer commented on Apr 18, 2026

    @bitdancer
    Member

    We are attempting to address this issue in a different way in #81074. For the reasons discussed there the approach taken for the PR attached to this issue no longer seems optimal, so I'm closing this as a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions