Skip to content

Fix for > https://github.com/magento/magento2/issues/6146 #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion library/Zend/Mail/Transport/Sendmail.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ public function _sendMail()
$this->recipients,
$this->_mail->getSubject(),
$this->body,
$this->header);
$this->header,
$this->_getAdditionalParameters());
restore_error_handler();

if ($this->_errstr !== null || !$result) {
Expand Down Expand Up @@ -202,4 +203,18 @@ public function _handleMailErrors($errno, $errstr, $errfile = null, $errline = n
return true;
}

/**
* The additional_parameters parameter can be used to pass additional flags as command line options to the program
* configured to be used when sending mail, as defined by the sendmail_path configuration setting.
* For example, this can be used to set the envelope sender address when using sendmail with the -f sendmail option.
*
* @return null|string
*/
protected function _getAdditionalParameters() {
if (!empty($this->_mail->getReturnPath())) {
return '-f ' . $this->_mail->getReturnPath();
}

return null;
}
}