mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 11:06:15 +00:00
Stripping - from default Message-ID header.
This fixes issues where certiain spamassassin rules would flag EmailComponent messages as spam due to too many - in the messageID. Fixes #2019
This commit is contained in:
parent
f57f7305f5
commit
c2104a3613
2 changed files with 2 additions and 2 deletions
|
@ -589,7 +589,7 @@ class EmailComponent extends Object{
|
|||
|
||||
if ($this->messageId !== false) {
|
||||
if ($this->messageId === true) {
|
||||
$headers['Message-ID'] = '<' . String::uuid() . '@' . env('HTTP_HOST') . '>';
|
||||
$headers['Message-ID'] = '<' . str_replace('-', '', String::uuid()) . '@' . env('HTTP_HOST') . '>';
|
||||
} else {
|
||||
$headers['Message-ID'] = $this->messageId;
|
||||
}
|
||||
|
|
|
@ -1211,7 +1211,7 @@ HTMLBLOC;
|
|||
$this->assertTrue($this->Controller->EmailTest->send('This is the body of the message'));
|
||||
$result = $this->Controller->Session->read('Message.email.message');
|
||||
|
||||
$this->assertPattern('/Message-ID: \<[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}@' . env('HTTP_HOST') . '\>\n/', $result);
|
||||
$this->assertPattern('/Message-ID: \<[a-f0-9]{32}@' . env('HTTP_HOST') . '\>\n/', $result);
|
||||
|
||||
$this->Controller->EmailTest->messageId = '<22091985.998877@localhost>';
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue