Merge pull request #43789 from nextcloud/backport/39607/stable27

This commit is contained in:
John Molakvoæ 2024-02-29 11:36:12 +01:00 committed by GitHub
commit 7b9fed1cb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 10 deletions

View file

@ -45,7 +45,7 @@ if ($_['mail_smtpmode'] === 'qmail') {
$mail_sendmailmode = [
'smtp' => 'smtp (-bs)',
'pipe' => 'pipe (-t)'
'pipe' => 'pipe (-t -i)'
];
?>

View file

@ -350,14 +350,10 @@ class Mailer implements IMailer {
break;
}
switch ($this->config->getSystemValueString('mail_sendmailmode', 'smtp')) {
case 'pipe':
$binaryParam = ' -t';
break;
default:
$binaryParam = ' -bs';
break;
}
$binaryParam = match ($this->config->getSystemValueString('mail_sendmailmode', 'smtp')) {
'pipe' => ' -t -i',
default => ' -bs',
};
return new SendmailTransport($binaryPath . $binaryParam, null, $this->logger);
}

View file

@ -72,7 +72,7 @@ class MailerTest extends TestCase {
public function sendmailModeProvider(): array {
return [
'smtp' => ['smtp', ' -bs'],
'pipe' => ['pipe', ' -t'],
'pipe' => ['pipe', ' -t -i'],
];
}