Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #019032: Mail Headers are not encoded when using SMTP
- Loading branch information
Jérôme Vieilledent
committed
Jan 3, 2012
1 parent
12e416f
commit a7f14ad
Showing
3 changed files
with
51 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* File containing the ezpMail class. | ||
* | ||
* @copyright Copyright (C) 1999-2011 eZ Systems AS. All rights reserved. | ||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2 | ||
* @version //autogentag// | ||
*/ | ||
|
||
/** | ||
* ezpMail extends ezcMail in order to override default values and limitations. | ||
*/ | ||
class ezpMail extends ezcMail | ||
{ | ||
/** | ||
* Override of original {@link ezcMail::generateHeaders()}. | ||
* Allows headers customization | ||
* | ||
* @return string The mail headers | ||
*/ | ||
public function generateHeaders() | ||
{ | ||
// Workaround for encoded email addresses. | ||
// When encoded, email addresses (at least the name param) have more characters | ||
// By default, line length is set to 76 characters, after what a new line is created with $lineBreak. | ||
// This operation is done during encoding via iconv (see ezcMailTools::composeEmailAddress()). | ||
// Problem is that this operation is done a 2nd time in ezcMailPart::generateHeaders(). | ||
// Following code ensures that there is no double $lineBreak introduced | ||
// by this process because it potentially breaks headers | ||
$lineBreak = ezcMailTools::lineBreak(); | ||
$headers = str_replace( "$lineBreak$lineBreak", $lineBreak, parent::generateHeaders() ); | ||
return $headers; | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters