Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Mailer] [Smtp] Add DSN option to make SocketStream bind to IPv4#59482
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedJan 11, 2025
Hey! I see that this is your first PR. That is great! Welcome! Symfony has acontribution guide which I suggest you to read. In short:
Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change. When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor! I am going to sit back now and wait for the reviews. Cheers! Carsonbot |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
@@ -6,6 +6,7 @@ CHANGELOG | |||
* Add DSN param `retry_period` to override default email transport retry period | |||
* Add `Dsn::getBooleanOption()` | |||
* Add DSN param `source_ip` to allow binding to a specific IPv4 or IPv6 address. If you want to bind IPv4 without specifying an address, use `0.0.0.0`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
The second sentence does not belong to the changelog but to the documentation IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thank you. I have created a PR for the documentation:symfony/symfony-docs#20581
src/Symfony/Component/Mailer/Transport/Smtp/EsmtpTransportFactory.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Thank you@quilius. |
7b0cdc8
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
We are sending emails through a Microsoft connector, which verifies the sending server's IP address and sender email address. We started getting these error messages recently:
Apparently, our server started to connect using IPv6 and the connector only accepts IPv4 addresses. With this PR, we can force the SocketStream to connect to the smtp server via IPv4, by supplying an option in the DSN. Example usage:
This is my first PR to Symfony, so I tried doing my best to follow the guide.
From the errors I received, I think with DKIM signing IPv6 should be allowed as well. However, I do not have access the DNS records and needed a quick fix. This PR is based on a patch I did in my own project. Probably I will implement an available Microsoft Graph Transport in the future. But perhaps it's worth to keep this option available as well.