Issue Details (XML | Word | Printable)

Key: ZF-2559
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Satoru Yoshida
Reporter: Sergey Voyachek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

Email subject encoding bug

Created: 04/Feb/08 09:11 AM   Updated: 10/Apr/09 03:18 PM   Resolved: 02/Jan/09 10:54 PM
Return to search "Fixed in 1.5.1"
Component/s: Zend_Mail
Affects Version/s: 1.0.3, 1.7.2
Fix Version/s: 1.7.3

Time Tracking:
Original Estimate: Not Specified
Remaining Estimate: 0 minutes
Remaining Estimate - 0 minutes
Time Spent: 3 hours
Time Spent - 3 hours

File Attachments: 1. Text File header.patch (0.6 kB)

Issue Links:
Dependency
 
Related
 

Fix Version Priority: Must Have


 Description  « Hide

I tried to send letter using charset 'cp1251' or 'win1251'. For this purpose I created new instance of Zend_Mail passed this charset in constructor. Then called functions setSubject and setBodyHtml pointed my message.
$mail = new Zend_Mail('cp1251');
$mail->setSubject('Поздравляем с успешной регистрацией');
$mail->setBodyHtml("<b>Blah-blah</b>");

Receved message has problem with subject.
The subject has useless symbol.
GMail: 'Поздравляем с успешной рег_истрацией' ('_' means space)
Yandex: 'Поздравляем с успешной рег=истрацией' ('' means space)
Mail.ru: 'Поздравляем с успешной регE8истрацией'

I think that problem happened around cyrillic symbols.

Thank you!



Jonathan Bond-Caron added a comment - 08/Feb/08 12:11 PM

protected function _encodeHeader($value)
{
if (Zend_Mime::isPrintable($value)) { return $value; } else { return '=?' . $this->_charset . '?B?' . Zend_Mime::encodeBase64($value) . '?='; }

This should fix your problem, the problem is Zend_Mime::encodeQuotedPrintable looks buggy so I used a B encode (base64) on the subject . This was the quick fix for me, I'll try to put togheter a patch and fix Zend_Mime::encodeQuotedPrintable.


Wil Sinclair added a comment - 17/Dec/08 01:30 PM

Was this fixed in the repository? If not, this should probably be marked 'won't fix'.


Wil Sinclair added a comment - 17/Dec/08 01:31 PM

Please verify resolved status.


Sergey Voyachek added a comment - 18/Dec/08 01:57 AM

I wrote the same patch and problem was resolved.


Jonathan Bond-Caron added a comment - 18/Dec/08 06:31 AM

The patch


Jonathan Bond-Caron added a comment - 18/Dec/08 06:35 AM

I attached the 'quick fix' patch, please commit

Another issue should probably be opened for Zend_Mime::encodeQuotedPrintable, more testing with utf-8?


Satoru Yoshida added a comment - 02/Jan/09 10:54 PM

Solved in SVN r13496.

1) Change _encodeHeader() can encode by not only quotedPrintable but also by Base64.

2) Add $_encodingOfHeaders and setter/getter functions.


Satoru Yoshida added a comment - 23/Jan/09 06:46 AM

I changed the name to $_headerEncoding