diff options
author | Carsten Wiedmann <carsten_sttgt@gmx.de> | 2018-11-12 23:26:35 +0100 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2018-11-29 16:44:36 +0000 |
commit | ad0a2ee1811dd96364dda4d75623e3232a5d811c (patch) | |
tree | c48e19a3e067ced445200637421fe7fc919b3de6 | |
parent | ea310cbfdfd05dbb42671d5acacdc303508c1e34 (diff) | |
download | nextcloud-server-ad0a2ee1811dd96364dda4d75623e3232a5d811c.tar.gz nextcloud-server-ad0a2ee1811dd96364dda4d75623e3232a5d811c.zip |
Apply patch from @cwiedmann but drop -oi option for pipe
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
-rw-r--r-- | config/config.sample.php | 13 | ||||
-rw-r--r-- | lib/private/Mail/Mailer.php | 11 |
2 files changed, 23 insertions, 1 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index 5190e46ad7f..7a86070c18f 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -422,6 +422,19 @@ $CONFIG = array( 'mail_send_plaintext_only' => false, /** + * Which mode is used for sendmail/qmail: ``smtp`` or ``pipe``. + * + * For ``smtp`` the sendmail binary is started with the parameter ``-bs``: + * - Use the SMTP protocol on standard input and output. + * + * For ``pipe`` the binary is started with the parameters ``-t``: + * - Read message from STDIN and extract recipients. + * + * Defaults to ``smtp`` + */ +'mail_sendmailmode' => 'smtp', + +/** * Proxy Configurations */ 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); } } |