From 0cc09ab7e3e92726d5845d56dfeb5fd8b0ce8b1b Mon Sep 17 00:00:00 2001 From: Karel Vlk Date: Mon, 21 Oct 2024 23:38:26 +0200 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20N=C2=B02272=20EmailLaminas.php:=20F?= =?UTF-8?q?ix=20Message-ID=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sources/Core/Email/EmailLaminas.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/Core/Email/EmailLaminas.php b/sources/Core/Email/EmailLaminas.php index fe900010c8..3839dc37f3 100644 --- a/sources/Core/Email/EmailLaminas.php +++ b/sources/Core/Email/EmailLaminas.php @@ -331,11 +331,11 @@ public function SetMessageId($sId) { $this->m_aData['message_id'] = $sId; - // Note: Swift will add the angle brackets for you + // Note: The email library will add the angle brackets for you // so let's remove the angle brackets if present, for historical reasons $sId = str_replace(array('<', '>'), '', $sId); - $this->m_oMessage->getHeaders()->addHeaderLine('Message-ID', $sId); + $this->m_oMessage->getHeaders()->addHeader((new Laminas\Mail\Header\MessageId())->setId($sId)); } public function SetReferences($sReferences) From 447dfd99518f669d0b36bdbdb463b7090115239d Mon Sep 17 00:00:00 2001 From: Karel Vlk Date: Fri, 25 Oct 2024 22:56:34 +0200 Subject: [PATCH 2/2] EmailLaminas.php: Add MessageId import as suggested by @steffunky in PR 671 --- sources/Core/Email/EmailLaminas.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/Core/Email/EmailLaminas.php b/sources/Core/Email/EmailLaminas.php index 3839dc37f3..160113b057 100644 --- a/sources/Core/Email/EmailLaminas.php +++ b/sources/Core/Email/EmailLaminas.php @@ -8,6 +8,7 @@ use Combodo\iTop\Core\Authentication\Client\OAuth\OAuthClientProviderFactory; use Laminas\Mail\Header\ContentType; +use Laminas\Mail\Header\MessageId; use Laminas\Mail\Message; use Laminas\Mail\Protocol\Smtp\Auth\Oauth; use Laminas\Mail\Transport\File; @@ -335,7 +336,7 @@ public function SetMessageId($sId) // so let's remove the angle brackets if present, for historical reasons $sId = str_replace(array('<', '>'), '', $sId); - $this->m_oMessage->getHeaders()->addHeader((new Laminas\Mail\Header\MessageId())->setId($sId)); + $this->m_oMessage->getHeaders()->addHeader((new MessageId())->setId($sId)); } public function SetReferences($sReferences)