summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Mail/Mailer.php6
-rw-r--r--tests/lib/Mail/MailerTest.php8
2 files changed, 12 insertions, 2 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;
}
diff --git a/tests/lib/Mail/MailerTest.php b/tests/lib/Mail/MailerTest.php
index d724cd630d3..ddae38ff54d 100644
--- a/tests/lib/Mail/MailerTest.php
+++ b/tests/lib/Mail/MailerTest.php
@@ -55,7 +55,13 @@ class MailerTest extends TestCase {
->with('mail_smtpmode', 'smtp')
->will($this->returnValue('sendmail'));
- $this->assertEquals(new \Swift_SendmailTransport('/usr/sbin/sendmail -bs'), self::invokePrivate($this->mailer, 'getSendMailInstance'));
+ $path = \OC_Helper::findBinaryPath('sendmail');
+ if ($path === null) {
+ $path = '/usr/sbin/sendmail';
+ }
+
+ $expected = new \Swift_SendmailTransport($path . ' -bs');
+ $this->assertEquals($expected, self::invokePrivate($this->mailer, 'getSendMailInstance'));
}
public function testGetSendMailInstanceSendMailQmail() {