You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
We recently moved from Swiftmailer to the Symfony mailer and we have issues with sending emails to domains that contain non-ASCII characters.
Example: something@öäü.com
Our local postfix receives this email address without any Punycode encoding end gives an error like
> RCPT TO:<something@öäü.com>\n
< 501 5.1.3 Bad recipient address syntax\r\n
I had a look and it seems the Symfony\Component\Mime\Encoder\IdnAddressEncoder is not used in this case to encode the addresses.
…aicher)
This PR was merged into the 4.4 branch.
Discussion
----------
[Mailer] fix encoding of addresses using SmtpTransport
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? |no
| Deprecations? | no
| Tickets | Fix#41651
| License | MIT
| Doc PR | -
This fixes#41651 by using the same IDN encoding logic that was also used on SwiftMailer.
also see https://github.com/swiftmailer/swiftmailer/blob/master/tests/unit/Swift/Transport/AbstractSmtpTest.php#L430
Commits
-------
608a3e5 [Mailer] fix encoding of addresses using SmtpTransport
Symfony version(s) affected: 5.3.1 and older
Description
We recently moved from Swiftmailer to the Symfony mailer and we have issues with sending emails to domains that contain non-ASCII characters.
Example:
something@öäü.com
Our local postfix receives this email address without any Punycode encoding end gives an error like
I had a look and it seems the
Symfony\Component\Mime\Encoder\IdnAddressEncoder
is not used in this case to encode the addresses.The
SmtpTransport
is just using the raw address: https://github.com/symfony/symfony/blob/5.3/src/Symfony/Component/Mailer/Transport/Smtp/SmtpTransport.php#L199However the SwiftMailer transport was encoding the address first: https://github.com/swiftmailer/swiftmailer/blob/master/lib/classes/Swift/Transport/AbstractSmtpTransport.php#L383
With Swiftmailer the command looks like:
So I'm wondering: Is there a reason we are not encoding addresses anymore?
The text was updated successfully, but these errors were encountered: