From 68a0dbed64604405aeb23739ef1304c561f3bc82 Mon Sep 17 00:00:00 2001 From: Rob Lister Date: Mon, 6 Dec 2021 14:24:41 +0000 Subject: [PATCH] [8.x] Add option to set sendmail path. Fix default (#5741) * Add option to set sendmail path. Fix default 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 * Update mail.php Co-authored-by: Taylor Otwell --- config/mail.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/mail.php b/config/mail.php index e8607494..f96c6c7c 100644 --- a/config/mail.php +++ b/config/mail.php @@ -59,7 +59,7 @@ 'sendmail' => [ 'transport' => 'sendmail', - 'path' => '/usr/sbin/sendmail -bs', + 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -t -i'), ], 'log' => [