-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Mailer] Add a transport that uses php.ini settings for configuration #36131
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
Conversation
fe6a887
to
741ed9e
Compare
I don't think this should be part of the DSN. That's an internal configuration setting, not related to the transport DSN itself. |
741ed9e
to
7d3ba72
Compare
Usage of a container parameter instead of a dsn option. |
src/Symfony/Bundle/FrameworkBundle/Resources/config/mailer_transports.xml
Outdated
Show resolved
Hide resolved
bfffb9e
to
f81c0a6
Compare
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.
This needs to be rebased as well as config is now done in PHP :)
src/Symfony/Component/Mailer/Transport/NativeTransportFactory.php
Outdated
Show resolved
Hide resolved
|
||
protected function getSupportedSchemes(): array | ||
{ | ||
$supportedShemes = ['native', 'native+sendmail']; |
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.
So we really need the 2 possibiliies? Can't we only support native
and do the switch ourselves in the code depending on the platform?
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.
Not really needed indeed; I added the two options to be consistent with SendmailTransportFactory
. But I can only keep native
if you prefer.
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.
I would remove the native-sendmail
scheme, which is not needed IMHO.
8b504d9
to
65cc5d7
Compare
Can't this be solved from the outside, aka by providing a sendmail script wrapper instead? |
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.
Can you add a note in the CHANGELOG file?
src/Symfony/Component/Mailer/Transport/NativeTransportFactory.php
Outdated
Show resolved
Hide resolved
49b39fa
to
04de561
Compare
Updated and CHANGELOG modified |
@l-vo Great work as always, can you see if you can add some docs about this feature? |
Thank you @l-vo. |
Thank you 🙂 Yes I created my TODO list with the docs for the PR recently merged 😁 |
This PR was merged into the 3.4-dev branch. Discussion ---------- Use sendmail_path as default value Quite some time ago, Swiftmailer dropped support for the PHP `mail` function for security reasons and thus forcing you to use either `sendmail` or `smtp`. However, when using `sendmail`, The Swiftmailer Bundle only uses a hard coded command by default, which might not work on all hosting environments out of the box. The PHP `mail` function on the other hand uses the configured `sendmail_path` of the PHP configuration, which most likely will work in the respective hosting environment. This PR simply uses the configured `sendmail_path` as the default value for the `command` parameter of the bundle configuration. Therefore emails should work again out of the box, just like it was before when Swiftmailer still supported PHP `mail`. Kind of like the poor-man's version of symfony/symfony#36131 ;) Commits ------- 31a4fed use sendmail_path as default value
This PR was submitted for the 5.x branch but it was squashed and merged into the 5.2 branch instead. Discussion ---------- Complete documentation about mailer integration - Complete framework config reference with `Mailer` (based on #14087 plus `message_bus` and `headers` that was added after 4.4) - Add documentation about `native` DSN protocol (symfony/symfony#36131) Close #14066 Commits ------- a389dfb Complete documentation about mailer integration
This PR aims to allow to use the mailer when sendmail is not on the
/usr/sbin
directory or when the-bs
option is not supported.