]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Emailer.php
Merge pull request #13161 from annando/bluesky-activities
[friendica.git] / src / Util / Emailer.php
index 8e63b638fa51cdb96aa5b1a646440bad7342d019..5e4d98d4c9e83e18ca46ebac609dd7e7d1b76658 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2021, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -38,9 +38,9 @@ use Psr\Log\LoggerInterface;
  */
 class Emailer
 {
-       /** @var \Friendica\Core\Config\Capability\IManageConfigValues */
+       /** @var IManageConfigValues */
        private $config;
-       /** @var \Friendica\Core\PConfig\Capability\IManagePersonalConfigValues */
+       /** @var IManagePersonalConfigValues */
        private $pConfig;
        /** @var LoggerInterface */
        private $logger;
@@ -65,7 +65,7 @@ class Emailer
 
                $this->siteEmailAddress = $this->config->get('config', 'sender_email');
                if (empty($this->siteEmailAddress)) {
-                       $hostname = $this->baseUrl->getHostname();
+                       $hostname = $this->baseUrl->getHost();
                        if (strpos($hostname, ':')) {
                                $hostname = substr($hostname, 0, strpos($hostname, ':'));
                        }
@@ -141,7 +141,7 @@ class Emailer
                                $countMessageId += count($value);
                        }
                }
-               if ($countMessageId > 0) {
+               if ($countMessageId > 1) {
                        $this->logger->warning('More than one Message-ID found - RFC violation', ['email' => $email]);
                }
 
@@ -163,9 +163,9 @@ class Emailer
 
                // generate a multipart/alternative message header
                $messageHeader = $email->getAdditionalMailHeaderString() .
-                                "From: $fromName <{$fromAddress}>\n" .
-                                "Reply-To: $fromName <{$replyTo}>\n" .
-                                "MIME-Version: 1.0\n" .
+                                "From: $fromName <{$fromAddress}>\r\n" .
+                                "Reply-To: $fromName <{$replyTo}>\r\n" .
+                                "MIME-Version: 1.0\r\n" .
                                 "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\"";
 
                // assemble the final multipart message body with the text and html types included