From: Michael Date: Sat, 4 Apr 2020 20:26:09 +0000 (+0000) Subject: Issue 8495: Only use "noreply" when no sender mail is defined X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=860d4654c1ca4eb1835f1b4e1f0a402afe8c41f3;p=friendica.git Issue 8495: Only use "noreply" when no sender mail is defined --- diff --git a/src/Util/Emailer.php b/src/Util/Emailer.php index 1254c66188..717366248f 100644 --- a/src/Util/Emailer.php +++ b/src/Util/Emailer.php @@ -64,7 +64,7 @@ class Emailer $this->l10n = $defaultLang; $this->siteEmailAddress = $this->config->get('config', 'sender_email'); - if (empty($sysEmailAddress)) { + if (empty($this->siteEmailAddress)) { $hostname = $this->baseUrl->getHostname(); if (strpos($hostname, ':')) { $hostname = substr($hostname, 0, strpos($hostname, ':')); diff --git a/src/Worker/Delivery.php b/src/Worker/Delivery.php index 01f7476448..94a0f4902b 100644 --- a/src/Worker/Delivery.php +++ b/src/Worker/Delivery.php @@ -564,7 +564,8 @@ class Delivery $headers = 'From: ' . Email::encodeHeader($local_user['username'],'UTF-8') . ' <' . $local_user['email'] . '>' . "\n"; } } else { - $headers = 'From: '. Email::encodeHeader($local_user['username'], 'UTF-8') . ' getHostname() . '>' . "\n"; + $sender = DI::config()->get('config', 'sender_email', 'noreply@' . DI::baseUrl()->getHostname()); + $headers = 'From: '. Email::encodeHeader($local_user['username'], 'UTF-8') . ' <' . $sender . '>' . "\n"; } $headers .= 'Message-Id: <' . Email::iri2msgid($target_item['uri']) . '>' . "\n";