Merge pull request #8497 from annando/issue-8495

Issue 8495: Only use "noreply" when no sender mail is defined
This commit is contained in:
Hypolite Petovan 2020-04-04 19:30:01 -04:00 committed by GitHub
commit d44c858320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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, ':'));

View File

@ -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') . ' <noreply@' . DI::baseUrl()->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";