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:
mark_story 2011-09-23 22:41:19 -04:00
parent f57f7305f5
commit c2104a3613
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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>';