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>
$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;
}
->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() {