]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Emailer.php
Avoid "Duplicate entry"
[friendica.git] / src / Util / Emailer.php
index b402abf25e66ca01230ebe3bf286ea58ce8e7aa3..ed6c7b331b29a7c4d133bb58d774848da6d0afad 100644 (file)
@@ -134,6 +134,17 @@ class Emailer
                        return true;
                }
 
+               // @see https://github.com/friendica/friendica/issues/9142
+               $countMessageId = 0;
+               foreach ($email->getAdditionalMailHeader() as $name => $value) {
+                       if (strtolower($name) == 'message-id') {
+                               $countMessageId += count($value);
+                       }
+               }
+               if ($countMessageId > 0) {
+                       $this->logger->warning('More than one Message-ID found - RFC violation', ['email' => $email]);
+               }
+
                $email_textonly = false;
                if (!empty($email->getRecipientUid())) {
                        $email_textonly = $this->pConfig->get($email->getRecipientUid(), 'system', 'email_textonly');