Skip to content

Commit 80f1347

Browse files
committed
Don't advertise that emails are generated by CakePHP.
Refs #5424
1 parent 4b7de4d commit 80f1347

File tree

4 files changed

+2
-19
lines changed

4 files changed

+2
-19
lines changed

src/Network/Email/Email.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ class Email {
4444

4545
use StaticConfigTrait;
4646

47-
/**
48-
* Default X-Mailer
49-
*
50-
* @var string
51-
*/
52-
const EMAIL_CLIENT = 'CakePHP Email';
53-
5447
/**
5548
* Line length - no should more - RFC 2822 - 2.1.1
5649
*
@@ -787,9 +780,6 @@ public function getHeaders(array $include = array()) {
787780
}
788781

789782
$headers += $this->_headers;
790-
if (!isset($headers['X-Mailer'])) {
791-
$headers['X-Mailer'] = static::EMAIL_CLIENT;
792-
}
793783
if (!isset($headers['Date'])) {
794784
$headers['Date'] = date(DATE_RFC2822);
795785
}

tests/TestCase/Network/Email/DebugTransportTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,12 @@ public function testSend() {
5050
$email->messageID('<4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>');
5151
$email->subject('Testing Message');
5252
$date = date(DATE_RFC2822);
53-
$email->setHeaders(array('X-Mailer' => Email::EMAIL_CLIENT, 'Date' => $date));
53+
$email->setHeaders(array('Date' => $date));
5454
$email->expects($this->once())->method('message')->will($this->returnValue(array('First Line', 'Second Line', '.Third Line', '')));
5555

5656
$headers = "From: CakePHP Test <noreply@cakephp.org>\r\n";
5757
$headers .= "To: CakePHP <cake@cakephp.org>\r\n";
5858
$headers .= "Cc: Mark Story <mark@cakephp.org>, Juan Basso <juan@cakephp.org>\r\n";
59-
$headers .= "X-Mailer: CakePHP Email\r\n";
6059
$headers .= "Date: " . $date . "\r\n";
6160
$headers .= "Message-ID: <4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>\r\n";
6261
$headers .= "Subject: Testing Message\r\n";

tests/TestCase/Network/Email/EmailTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ public function testHeaders() {
566566
$this->CakeEmail->setHeaders(array('X-Something' => 'nice'));
567567
$expected = array(
568568
'X-Something' => 'nice',
569-
'X-Mailer' => 'CakePHP Email',
570569
'Date' => date(DATE_RFC2822),
571570
'MIME-Version' => '1.0',
572571
'Content-Type' => 'text/plain; charset=UTF-8',
@@ -578,7 +577,6 @@ public function testHeaders() {
578577
$expected = array(
579578
'X-Something' => 'very nice',
580579
'X-Other' => 'cool',
581-
'X-Mailer' => 'CakePHP Email',
582580
'Date' => date(DATE_RFC2822),
583581
'MIME-Version' => '1.0',
584582
'Content-Type' => 'text/plain; charset=UTF-8',
@@ -593,7 +591,6 @@ public function testHeaders() {
593591
'From' => 'cake@cakephp.org',
594592
'X-Something' => 'very nice',
595593
'X-Other' => 'cool',
596-
'X-Mailer' => 'CakePHP Email',
597594
'Date' => date(DATE_RFC2822),
598595
'MIME-Version' => '1.0',
599596
'Content-Type' => 'text/plain; charset=UTF-8',
@@ -611,7 +608,6 @@ public function testHeaders() {
611608
'To' => 'cake@cakephp.org, CakePHP <php@cakephp.org>',
612609
'X-Something' => 'very nice',
613610
'X-Other' => 'cool',
614-
'X-Mailer' => 'CakePHP Email',
615611
'Date' => date(DATE_RFC2822),
616612
'MIME-Version' => '1.0',
617613
'Content-Type' => 'text/plain; charset=UTF-8',
@@ -625,7 +621,6 @@ public function testHeaders() {
625621
'To' => 'cake@cakephp.org, CakePHP <php@cakephp.org>',
626622
'X-Something' => 'very nice',
627623
'X-Other' => 'cool',
628-
'X-Mailer' => 'CakePHP Email',
629624
'Date' => date(DATE_RFC2822),
630625
'MIME-Version' => '1.0',
631626
'Content-Type' => 'text/plain; charset=ISO-2022-JP',

tests/TestCase/Network/Email/SmtpTransportTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,14 @@ public function testSendData() {
380380
$email->messageID('<4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>');
381381
$email->subject('Testing SMTP');
382382
$date = date(DATE_RFC2822);
383-
$email->setHeaders(array('X-Mailer' => Email::EMAIL_CLIENT, 'Date' => $date));
383+
$email->setHeaders(array('Date' => $date));
384384
$email->expects($this->once())
385385
->method('message')
386386
->will($this->returnValue(array('First Line', 'Second Line', '.Third Line', '')));
387387

388388
$data = "From: CakePHP Test <noreply@cakephp.org>\r\n";
389389
$data .= "To: CakePHP <cake@cakephp.org>\r\n";
390390
$data .= "Cc: Mark Story <mark@cakephp.org>, Juan Basso <juan@cakephp.org>\r\n";
391-
$data .= "X-Mailer: CakePHP Email\r\n";
392391
$data .= "Date: " . $date . "\r\n";
393392
$data .= "Message-ID: <4d9946cf-0a44-4907-88fe-1d0ccbdd56cb@localhost>\r\n";
394393
$data .= "Subject: Testing SMTP\r\n";

0 commit comments

Comments
 (0)