[dev] [commits] Horde branch master updated. 8527f1d6995f63567686e958ca5dd758c8188367

Michael J Rubinsky mrubinsk at horde.org
Wed Dec 12 23:07:27 UTC 2012


Quoting Michael M Slusarz <slusarz at horde.org>:

> Quoting "Michael J. Rubinsky" <mrubinsk at horde.org>:
>
>> commit 8527f1d6995f63567686e958ca5dd758c8188367
>> Author: Michael J Rubinsky <mrubinsk at horde.org>
>> Date:   Wed Dec 12 12:44:38 2012 -0500
>>
>>    Hopefully finally resolve charset issues breaking iOS syncing.
>>
>>    Must ensure the default charset is us-ascii for messages that contain
>>    no charset information.
>>
>> framework/ActiveSync/lib/Horde/ActiveSync/Imap/Adapter.php |    9 +++++----
>> 1 files changed, 5 insertions(+), 4 deletions(-)
>
> You may have addressed this in further commits... but IMHO you  
> should default to UTF-8 for this.  Considering that US-ASCII is a  
> complete subset of UTF-8, odds are that this would catch a few  
> additional messages that contain non-7bit characters.

The problem I'm trying to prevent here is a broken email that contains  
no charset information, yet contains non ascii AND non-utf-8 data from  
breaking the sync. For example, a spam email containing some invalid  
UTF-8 data with no charset information for the part. Before this  
change, because of the various default charset prefs, the default  
*was* being set to UTF-8 (in IMP_Application::_init IIRC). During the  
process of building the activesync message we perform a  
Horde_String::convertCharset on the body since ActiveSync messages  
MUST contain only valid UTF-8 data. Without using the 'force' option,  
the charset conversion is never performed - so the invalid data is  
sent to the device and can cause the sync to break completely on iOS  
(Android is a bit more tolerant here, as it will ignore the bad data).  
I was originally setting the 'force' option, but this mangled valid  
UTF-8 data when it passed through Utf8_encode().

I now also call Horde_String::validUtf8() on the data and re-convert  
the charset with 'force' if invalid utf-8 data is found. It's extra  
work, but the alternative is having a random email completely break  
the client's ability to sync with any mailbox.

This has been a particularly annoying and problematic issue that I  
(hope) is now finally resolved.
-- 
mike

The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6062 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.horde.org/archives/dev/attachments/20121212/478cda78/attachment.bin>


More information about the dev mailing list