Skip to content

Commit

Permalink
fix for issue nextcloud#11281
Browse files Browse the repository at this point in the history
  • Loading branch information
cwiedmann committed Sep 29, 2018
1 parent 48b48fa commit 816dc56
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
14 changes: 14 additions & 0 deletions config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,20 @@
*/
'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 -oi``:
* - Read message from STDIN and extract recipients.
* - Ignore dots.
*
* Defaults to ``smtp``
*/
'mail_sendmailmode' => 'smtp',

/**
* Proxy Configurations
*/
Expand Down
11 changes: 10 additions & 1 deletion lib/private/Mail/Mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,15 @@ protected function getSendMailInstance(): \Swift_SendmailTransport {
break;
}

return new \Swift_SendmailTransport($binaryPath . ' -bs');
switch ($this->config->getSystemValue('mail_sendmailmode', 'smtp')) {
case 'pipe':
$binaryParam = ' -t -oi';
break;
default:
$binaryParam = ' -bs';
break;
}

return new \Swift_SendmailTransport($binaryPath . $binaryParam);
}
}

0 comments on commit 816dc56

Please sign in to comment.