diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-11-29 17:43:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 17:43:03 +0100 |
commit | ee2cb46cdc161fc0e90f4c9bea40607511d1087e (patch) | |
tree | e0a6e0eaf2d2f5e2b3d18a582f9bd3aae438cebc /lib | |
parent | f77e519137d8b934ce599548a0ce3bdd81b826a2 (diff) | |
parent | 4a2c56b71400de7a044e0a3c05a62ae34c4c4d69 (diff) | |
download | nextcloud-server-ee2cb46cdc161fc0e90f4c9bea40607511d1087e.tar.gz nextcloud-server-ee2cb46cdc161fc0e90f4c9bea40607511d1087e.zip |
Merge pull request #12424 from nextcloud/feature/add-pipe-mode-for-sendmail
Add pipe mode for sendmail
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Mail/Mailer.php | 11 | ||||
-rw-r--r-- | lib/private/Settings/Admin/Mail.php | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/Mail/Mailer.php b/lib/private/Mail/Mailer.php index df23b669365..7a8b4ad2599 100644 --- a/lib/private/Mail/Mailer.php +++ b/lib/private/Mail/Mailer.php @@ -282,6 +282,15 @@ class Mailer implements IMailer { break; } - return new \Swift_SendmailTransport($binaryPath . ' -bs'); + switch ($this->config->getSystemValue('mail_sendmailmode', 'smtp')) { + case 'pipe': + $binaryParam = ' -t'; + break; + default: + $binaryParam = ' -bs'; + break; + } + + return new \Swift_SendmailTransport($binaryPath . $binaryParam); } } diff --git a/lib/private/Settings/Admin/Mail.php b/lib/private/Settings/Admin/Mail.php index fc20b7eeb3f..40dcc3dba0d 100644 --- a/lib/private/Settings/Admin/Mail.php +++ b/lib/private/Settings/Admin/Mail.php @@ -57,6 +57,7 @@ class Mail implements ISettings { 'mail_smtpauth' => $this->config->getSystemValue('mail_smtpauth', false), 'mail_smtpname' => $this->config->getSystemValue('mail_smtpname', ''), 'mail_smtppassword' => $this->config->getSystemValue('mail_smtppassword', ''), + 'mail_sendmailmode' => $this->config->getSystemValue('mail_sendmailmode', 'smtp'), ]; if ($parameters['mail_smtppassword'] !== '') { |