diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-11-02 14:03:11 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-11-02 14:03:11 +0100 |
commit | 054056a8df9b5fd6651db7fbe771ca04ba37761a (patch) | |
tree | 905df9d0cc6f23a05b9895eb9b32ac008a30bf7c /lib/private/Mail | |
parent | 7078a0e53e3b050c8008f9d8ae43c8d697fbc94c (diff) | |
download | nextcloud-server-054056a8df9b5fd6651db7fbe771ca04ba37761a.tar.gz nextcloud-server-054056a8df9b5fd6651db7fbe771ca04ba37761a.zip |
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 <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Mail')
-rw-r--r-- | lib/private/Mail/Mailer.php | 6 |
1 files changed, 5 insertions, 1 deletions
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; } |