[Mailer] Improve error message when SMTP server lacks SMTPUTF8 support#64186
Open
ousamabenyounes wants to merge 1 commit into
Open
[Mailer] Improve error message when SMTP server lacks SMTPUTF8 support#64186ousamabenyounes wants to merge 1 commit into
ousamabenyounes wants to merge 1 commit into
Conversation
Member
|
I'd say for 8.2 as an improvement |
Contributor
Author
|
Thanks for the review @nicolas-grekas — agreed, it's an improvement, not a bug fix. 8.2 isn't cut yet (8.1 BETA1 released 2026-05-06, no open PR targets 8.2 today). Should I:
Either way I'll update the Q/A table to reflect "Bug fix? no / New feature? yes" and add a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When
EsmtpTransportconnects to an SMTP server that does not advertise theSMTPUTF8capability (RFC 6531), sending a message whose envelope has any address with a non-ASCII local-part raises anInvalidArgumentExceptionwith this message:The wording is misleading: the addresses are RFC 6531 valid, and Symfony does support non-ASCII local-parts (see the docs). The real cause is server-side — the connected SMTP server has not advertised the
SMTPUTF8extension in its EHLO response, so the transport cannot useMAIL FROM:<…> SMTPUTF8.This PR rewords the exception so the user can immediately see what the actual limitation is and search for "SMTPUTF8":
Reproduces with
Tests/Transport/Smtp/EsmtpTransportTest::testMissingSmtpUtf8(existing test). The test is updated to assert the new message.Behaviour is unchanged: same exception class (
Symfony\Component\Mailer\Exception\InvalidArgumentException), same throw site (SmtpTransport::doMailFromCommand).