From 054056a8df9b5fd6651db7fbe771ca04ba37761a Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 2 Nov 2018 14:03:11 +0100 Subject: Fallback to default path is sendmail can't be found If the sendmail binary can't be found at all we fallback to the default path. It most likely is not there but then at least a proper error message pops up. Updated the tests to also properly pass. Signed-off-by: Roeland Jago Douma --- lib/private/Mail/Mailer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/private/Mail') diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index 79208f9a695..df23b669365 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -274,7 +274,11 @@ class Mailer implements IMailer { $binaryPath = '/var/qmail/bin/sendmail'; break; default: - $binaryPath = \OC_Helper::findBinaryPath('sendmail'); + $sendmail = \OC_Helper::findBinaryPath('sendmail'); + if ($sendmail === null) { + $sendmail = '/usr/sbin/sendmail'; + } + $binaryPath = $sendmail; break; } -- cgit v1.2.3