-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Delivery fails but actual SMTP response is not reported #40414
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
Comments
Hey, thanks for your report! |
Sure it is. Look for my workaround at #32148 |
@LuKePicci Would you like to give this a try? |
Sorry, I didn't get what you mean with "this" |
I mean trying to work on a fix for this issue. |
Still happens with SF 5.3.10 :/ I using sendgrid transport (dont know if it's helping). And happens only then using monolog error to send to email :) other ways (never noticed) doesn't happen. |
@scorpioniz Would you like to try working on a fix for this? |
Hey, thanks for your report! |
Ofc it is |
Well, this issue won't magically resolve itself. Someone would actually have to work on it. |
Just tried the reproducer, but that does not work for me, I get: |
In my case I think the ipv6 was the local one ::1 I suggest you try repro from a free instance of azure app service like mine. |
I don't have an Azure account. I'm willing to help fix this one but I cannot do anything without a reproducer. |
ok, I reverted my workaround:
without an Azure App Service instance, your best option to repro is to manually giving by local_domain the bad [::1] value which makes Google SMTP screaming:
|
@LuKePicci Thank you, I was able to reproduce and I've submitted a PR to fix this at #47142. Can you confirm if fixes this issue for you as well? |
I'll test asap on my existing environment. Is it fine if I simply hotpatch the related files and refresh the send email page? Would I need to rebuild cache or similar things? |
Hot-patching should be enough. |
This PR was merged into the 4.4 branch. Discussion ---------- [Mailer] Fix error message in case of an STMP error | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | Fix #40414 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead --> | License | MIT | Doc PR | n/a Better exception messages are generally done in the "main" branch, but this one is quite nasty as it masks the actual error message from the SMTP server, so I think it deserves to be merged in 4.4. Commits ------- aee6d08 [Mailer] Fix error message in case of an STMP error
Symfony version(s) affected: 5.2
Description
Proper duplicate of #32148 Look at there for background. Actual issue is that the SMTP server gives a non-empty error/unexpected response but symfony does not catch it properly and outputs this misleading error:
while the real one is different and certainly not an empty response. In my peculiar case the error was:
Please note the reason for the above SMTP message to occur is out of scope here and I already managed to workaround it.
You should consider this issue as solved as soon as you get that 421 message catched and reported in php logs.
How to reproduce
A sufficient condition to reproduce is to use symfony mailer with this DSN:
smtp://smtp-relay.gmail.com:587
The SMTP server will respond with 421 error message because of another symfony bug which makes symfony 5.2 using a bad default local_domain (
[127.0.0.1]
in my case ) in EHLO command.You don't need to subscribe or configure any gsuite smtp relay for the bug to reproduce.
Additional context
How to debug:
The text was updated successfully, but these errors were encountered: