[Tickets #11805] Copy to sent folder fails with charset LATIN1

bugs at horde.org bugs at horde.org
Mon Dec 3 16:09:46 UTC 2012


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/11805
------------------------------------------------------------------------------
  Ticket             | 11805
  Created By         | horde at albasoft.com
  Summary            | Copy to sent folder fails with charset LATIN1
  Queue              | Synchronization
  Version            | Git master
  Type               | Bug
  State              | Unconfirmed
  Priority           | 2. Medium
  Milestone          |
  Patch              | 1
  Owners             |
------------------------------------------------------------------------------


horde at albasoft.com (2012-12-03 16:09) wrote:

When I send an email from an iPhone with iso-8859-1 chars at the  
message body,  I get an unreadable message on my email client  
(Thunderbird email reader), and an error on iPhone while reading sent  
folder.

iPhone properly composes the message with base64, and so there's a  
header like:
  Content-Transfer-Encoding: base64
but message arrives to my SMTP server with that header unchanged but  
body content already decoded. So my email reader unsuccessfully tries  
to decode it again.

I think there are some errors in Core/ActiveSync/Driver.php with  
charset handling. At line 1183:
   $msg = $copy->toString(array('headers' => $headers->toString()));
where $headers are a copy of the original headers (including  
Content-Transfer-Encoding: base64), but $copy ->toString  will  
generate a string with quoted-printable encoding. The resulting  
message will be unreadable.

If I insert the following lines fixing encoding just before line 1183,  
everything works as expected:
if ($headers->getValue('Content-Transfer-Encoding')) {
   
$copy->setTransferEncoding($headers->getValue('Content-Transfer-Encoding'),  
array('send' => true));
}
Now body message encoding matches that at headers (base64).





More information about the bugs mailing list