Skip to content

Provide the right flags to IDN methods for email addresses conversion #44092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
j-bernard opened this issue Nov 16, 2021 · 0 comments
Closed

Comments

@j-bernard
Copy link
Contributor

j-bernard commented Nov 16, 2021

Symfony version(s) affected

5.3

Description

Symfony Mailer converts the email addresses domain to A-label in order to be compliant with servers that does not support the SMTPUTF8 flag but this conversion is not fully IDNA2008 compliant.

See #44091 that is the equivalent report for HttpClient.

This line should be fixed.

How to reproduce

$stream = new SocketStream();
$stream
    ->setHost($host)
    ->setPort($port)
    ->disableTls();
$transport = new SmtpTransport($stream);
$mailer = new Mailer($transport);
$email = (new Email())
    ->from($from)
    ->to($to)
    ->subject($subject)
    ->text($body);
$mailer->send($email);

If $to domain is fußball.test it should be converted to xn--fuball-cta.test instead of fussball.test.

Possible Solution

The following flags should be provided to be the most compliant possible with IDNA 2008:
IDNA_DEFAULT | IDNA_USE_STD3_RULES | IDNA_CHECK_BIDI | IDNA_CHECK_CONTEXTJ | IDNA_NONTRANSITIONAL_TO_ASCII

Additional Context

No response

@j-bernard j-bernard added the Bug label Nov 16, 2021
j-bernard added a commit to j-bernard/symfony that referenced this issue Nov 18, 2021
fabpot added a commit that referenced this issue Nov 19, 2021
…liance (j-bernard)

This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #44091 #44092
| License       | MIT

Fix #44091
Fix #44092

Commits
-------

22d642e [HttpClient][Mime] Add correct IDN flags for IDNA2008 compliance
@fabpot fabpot closed this as completed Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants