Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Merged
fabpot merged 1 commit intosymfony:7.3fromquilius:feature/bindToIpv4
Jan 18, 2025

Conversation

quilius
Copy link
Contributor

QA
Branch?7.3
Bug fix?no
New feature?yes
Deprecations?no
Issuessee below
LicenseMIT

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:

Symfony\Component\Messenger\Exception\HandlerFailedException(code: 450):Handling "\Symfony\\Component\\Mailer\\Messenger\\SendEmailMessage" failed:Expected response code "250" but got code "450", with message"450 4.7.26 Service does not accept messages sent over IPv6"

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:

MAILER_DSN=smtp://<mydomain>.mail.protection.outlook.com:25?force_ipv4=true

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.

@carsonbot
Copy link

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:

  • Always add tests
  • Keep backward compatibility (seehttps://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (seehttps://symfony.com/releases)
  • Features and deprecations must be submitted against the 7.3 branch.

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!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@@ -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`.
Copy link
Member

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.

fabpot reacted with thumbs up emoji
Copy link
ContributorAuthor

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

@fabpot
Copy link
Member

Thank you@quilius.

@fabpotfabpot merged commit7b0cdc8 intosymfony:7.3Jan 18, 2025
10 checks passed
@fabpotfabpot mentioned this pull requestMay 2, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas left review comments

@stofstofstof left review comments

@fabpotfabpotfabpot approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
7.3
Development

Successfully merging this pull request may close these issues.

5 participants
@quilius@carsonbot@fabpot@nicolas-grekas@stof

[8]ページ先頭

©2009-2025 Movatter.jp