Merge pull request #11404 from flokli/sendmail-path
Mailer: discover sendmail path instead of hardcoding it to /usr/sbin/sendmail
This commit is contained in:
commit
4ba709bb71
2 changed files with 12 additions and 2 deletions
|
@ -274,7 +274,11 @@ class Mailer implements IMailer {
|
|||
$binaryPath = '/var/qmail/bin/sendmail';
|
||||
break;
|
||||
default:
|
||||
$binaryPath = '/usr/sbin/sendmail';
|
||||
$sendmail = \OC_Helper::findBinaryPath('sendmail');
|
||||
if ($sendmail === null) {
|
||||
$sendmail = '/usr/sbin/sendmail';
|
||||
}
|
||||
$binaryPath = $sendmail;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue