From 0267a048f311935029647a3664f1501b2659c92d Mon Sep 17 00:00:00 2001 From: mark_story Date: Tue, 20 Sep 2011 22:30:17 -0400 Subject: [PATCH] Removing Mime type notice. It causes message delivery failures on some SMTP servers. Amazon SES suffers from this issue. Fixing failing tests caused by additional spaces in email address formatting. Fixes #2005 --- cake/libs/controller/components/email.php | 5 +---- cake/tests/cases/libs/controller/components/email.test.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cake/libs/controller/components/email.php b/cake/libs/controller/components/email.php index 2fae6928e..63615aff6 100755 --- a/cake/libs/controller/components/email.php +++ b/cake/libs/controller/components/email.php @@ -613,9 +613,6 @@ class EmailComponent extends Object{ $this->_createBoundary(); $headers['MIME-Version'] = '1.0'; $headers['Content-Type'] = 'multipart/mixed; boundary="' . $this->__boundary . '"'; - $headers[] = 'This part of the E-mail should never be seen. If'; - $headers[] = 'you are reading this, consider upgrading your e-mail'; - $headers[] = 'client to a MIME-compatible client.'; } elseif ($this->sendAs === 'text') { $headers['Content-Type'] = 'text/plain; charset=' . $this->charset; } elseif ($this->sendAs === 'html') { @@ -781,7 +778,7 @@ class EmailComponent extends Object{ } if ($hasAlias && !empty($matches[2])) { - return $this->_encode($matches[2]) . $this->_strip(' <' . $matches[3] . '>'); + return $this->_encode(trim($matches[2])) . $this->_strip(' <' . $matches[3] . '>'); } return $this->_strip($string); } diff --git a/cake/tests/cases/libs/controller/components/email.test.php b/cake/tests/cases/libs/controller/components/email.test.php index f97be8ec0..29998ab2c 100755 --- a/cake/tests/cases/libs/controller/components/email.test.php +++ b/cake/tests/cases/libs/controller/components/email.test.php @@ -1299,7 +1299,7 @@ HTMLBLOC; function testFormatAddressMultibyte() { $this->Controller->EmailTest->charset = 'UTF-8'; $result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest '); - $this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdCA=?= '); + $this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdA==?= '); $result = $this->Controller->EmailTest->formatAddress('ÄÖÜTest'); $this->assertEqual($result, '=?UTF-8?B?w4TDlsOcVGVzdA==?= ');