Add Missing Fifth Argument to mail() Function Call
This is desperately needed to fix Issue #5190. In case of any unexpected problem, the admin can use `$a->config['system']['sendmail_params'] = false;`
This commit is contained in:
parent
82d55f120f
commit
5b8619f501
|
@ -72,20 +72,28 @@ class Emailer
|
||||||
$multipartMessageBody .=
|
$multipartMessageBody .=
|
||||||
"--" . $mimeBoundary . "--\n"; // message ending
|
"--" . $mimeBoundary . "--\n"; // message ending
|
||||||
|
|
||||||
|
if (Config::get("system", "sendmail_params", true)) {
|
||||||
|
$sendmail_params = '-f ' . $params['fromEmail'];
|
||||||
|
} else {
|
||||||
|
$sendmail_params = null;
|
||||||
|
}
|
||||||
|
|
||||||
// send the message
|
// send the message
|
||||||
$hookdata = [
|
$hookdata = [
|
||||||
'to' => $params['toEmail'],
|
'to' => $params['toEmail'],
|
||||||
'subject' => $messageSubject,
|
'subject' => $messageSubject,
|
||||||
'body' => $multipartMessageBody,
|
'body' => $multipartMessageBody,
|
||||||
'headers' => $messageHeader
|
'headers' => $messageHeader,
|
||||||
|
'parameters' => $sendmail_params
|
||||||
];
|
];
|
||||||
//echo "<pre>"; var_dump($hookdata); killme();
|
//echo "<pre>"; var_dump($hookdata); killme();
|
||||||
Addon::callHooks("emailer_send", $hookdata);
|
Addon::callHooks("emailer_send", $hookdata);
|
||||||
$res = mail(
|
$res = mail(
|
||||||
$hookdata['to'], // send to address
|
$hookdata['to'],
|
||||||
$hookdata['subject'], // subject
|
$hookdata['subject'],
|
||||||
$hookdata['body'], // message body
|
$hookdata['body'],
|
||||||
$hookdata['headers'] // message headers
|
$hookdata['headers'],
|
||||||
|
$hookdata['parameters']
|
||||||
);
|
);
|
||||||
logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
|
logger("header " . 'To: ' . $params['toEmail'] . "\n" . $messageHeader, LOGGER_DEBUG);
|
||||||
logger("return value " . (($res)?"true":"false"), LOGGER_DEBUG);
|
logger("return value " . (($res)?"true":"false"), LOGGER_DEBUG);
|
||||||
|
|
Loading…
Reference in a new issue