Skip to content

Commit

Permalink
🐛 N°7917 SF#2272 EmailLaminas.php: Fix Message-ID format (#671)
Browse files Browse the repository at this point in the history
* 🐛 N°2272 EmailLaminas.php: Fix Message-ID format

* EmailLaminas.php: Add MessageId import

as suggested by @steffunky in PR 671
  • Loading branch information
vlk-charles authored Nov 4, 2024
1 parent e8ecc85 commit 58e964f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sources/Core/Email/EmailLaminas.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -331,11 +332,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 MessageId())->setId($sId));
}

public function SetReferences($sReferences)
Expand Down

0 comments on commit 58e964f

Please sign in to comment.