Mailer: discover sendmail path instead of hardcoding it to /usr/sbin/sendmail

`sendmail` can very well be in a path different from
`/usr/sbin/sendmail`.

We already search `$PATH` at `lib/private/Settings/Admin/Mail.php` to
detect whether we want to offer sendmail as a mail transfer method, so
let's be consistent and actually initialize `\Swift_SendmailTransport`
with this path to sendmail, instead of just hardcoding
`/usr/sbin/sendmail`.

Signed-off-by: Florian Klink <flokli@flokli.de>
This commit is contained in:
Florian Klink 2018-09-27 02:12:02 +02:00 committed by Roeland Jago Douma
parent 166907afef
commit 7078a0e53e
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 1 additions and 1 deletions

View File

@ -274,7 +274,7 @@ class Mailer implements IMailer {
$binaryPath = '/var/qmail/bin/sendmail';
break;
default:
$binaryPath = '/usr/sbin/sendmail';
$binaryPath = \OC_Helper::findBinaryPath('sendmail');
break;
}