Skip to content

[8.x] Add option to set sendmail path. Fix default #5741

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

Merged
merged 2 commits into from
Dec 6, 2021
Merged

[8.x] Add option to set sendmail path. Fix default #5741

merged 2 commits into from
Dec 6, 2021

Conversation

listerr
Copy link
Contributor

@listerr listerr commented Dec 3, 2021

Testing this in an application, it would seem that sendmail -bs is the wrong option for this case?

What Laravel appears to do is pipe an RFC-2822 formatted message on STDIN and requires the sendmail emulation to deal with it,
rather than -bs which initiates an SMTP session.

if Exim is the default MTA then -t would seem to be the correct option.

If you have an alternative installed instead of sendmail/exim, then there's no way to set the path, so I added MAIL_SENDMAIL_PATH
so you can do, e.g.:

MAIL_SENDMAIL_PATH="/usr/bin/msmtp -t --tls=off --from=${MAIL_FROM_ADDRESS} --auto-from=off"

msmtp doesn't support -bs at all

Testing this in an application, it would seem that sendmail -bs is the wrong option for this case?

What Laravel appears to do is pipe an RFC-2822 formatted message on STDIN and requires the sendmail emulation to deal with it,
rather than -bs which initiates an SMTP session.

if Exim is the default MTA then -t would seem to be the correct option.

If you have an alternative installed instead of sendmail/exim, then there's no way to set the path, so I added MAIL_SENDMAIL_PATH
so you can do, e.g.:

MAIL_SENDMAIL_PATH="/usr/bin/msmtp -t --tls=off --from=${MAIL_FROM_ADDRESS} --auto-from=off"

msmtp doesn't support -bs at all
@nunomaduro nunomaduro changed the title Add option to set sendmail path. Fix default [8.x] Add option to set sendmail path. Fix default Dec 3, 2021
config/mail.php Outdated
@@ -59,7 +59,7 @@

'sendmail' => [
'transport' => 'sendmail',
'path' => '/usr/sbin/sendmail -bs',
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change to the default we probably don't want?

@listerr
Copy link
Contributor Author

listerr commented Dec 3, 2021 via email

@taylorotwell
Copy link
Member

You may be correct here. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants