Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/config.sample.php13
-rw-r--r--lib/private/Mail/Mailer.php11
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);
}
}