1
0
Fork 0

Merge pull request #5245 from miqrogroove/patch-1

Add Missing Fifth Argument to mail() Function Call
This commit is contained in:
Hypolite Petovan 2018-06-19 17:55:24 -04:00 committed by GitHub
commit a863a73e08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View file

@ -85,6 +85,7 @@ Example: To set the automatic database cleanup process add this line to your .ht
* **pushpoll_frequency** - * **pushpoll_frequency** -
* **qsearch_limit** - Default value is 100. * **qsearch_limit** - Default value is 100.
* **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one. * **remove_multiplicated_lines** (Boolean) - If enabled, multiple linefeeds in items are stripped to a single one.
* **sendmail_params** (Boolean) - Normal sendmail command parameters will be added when the PHP mail() function is called for sending e-mails. This ensures the Sender Email address setting is applied to the message envelope rather than the host's default address. Default is true. Set to false if your non-sendmail agent is incompatible, or to restore old behavior of using the host address.
* **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones. * **show_unsupported_addons** (Boolean) - Show all addons including the unsupported ones.
* **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones. * **show_unsupported_themes** (Boolean) - Show all themes including the unsupported ones.
* **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node. * **show_global_community_hint** (Boolean) - When the global community page is enabled, use this option to display a hint above the stream, that this is a collection of all public top-level postings that arrive on your node.

View file

@ -5,6 +5,7 @@
namespace Friendica\Util; namespace Friendica\Util;
use Friendica\Core\Addon; use Friendica\Core\Addon;
use Friendica\Core\Config;
use Friendica\Core\PConfig; use Friendica\Core\PConfig;
use Friendica\Protocol\Email; use Friendica\Protocol\Email;
@ -72,20 +73,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);