View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003055 | SOGo | ActiveSync | public | 2015-01-06 13:01 | 2015-02-11 23:15 |
Reporter | tommie | Assigned To | ludovic | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | [Client] Google | OS | Android | OS Version | Kit Kat |
Product Version | 2.2.13 | ||||
Fixed in Version | 2.2.16 | ||||
Summary | 0003055: Plain/Text mails are missing carriage returns on android | ||||
Description | Mails that are sent as plain/text, are received as a one line message. The message is missing carriage returns. This is also reproducible on Android 5. | ||||
Steps To Reproduce | -Sent a plain/text mail to a SOGo mailbox. | ||||
Tags | No tags attached. | ||||
I'm on a jolla/sailfish phone, and have noticed this as well. (also on 2.2.13) |
|
It works for me. Please attach an EML version of a message exposing the problem. |
|
|
|
Hi, I have just created a small test mail. Which looks fine in SOGo webinterface and thunderbird, but is missing carriage returns in the android mail client. It happens with EVERY plain/text mail. Thanks for looking into this. |
|
It works for me on Android 4.4 with your mail above. It also works with the same mail in Outlook 2013. |
|
I use Cyagenmod 11, maybe the problem is in the mail client there? |
|
Perhaps, ask them! |
|
I have a vanilla Nexus 5 running the plain Google Android 5.0.1 release. It now uses GMail as its ActiveSync mail client and experiences the same problem with line endings that tommie reports. My hunch is that it's a Windows/Linux CR/LF issue somewhere. |
|
Tested against 2.2.15 with Android 5.0.1 on a Nexus 5 and no improvement is seen. All body text is rendered as a single line. |
|
I can confirm the problem. |
|
3055.diff (1,565 bytes)
diff --git a/ActiveSync/SOGoMailObject+ActiveSync.m b/ActiveSync/SOGoMailObject+ActiveSync.m index e7797df..a1b8c84 100644 --- a/ActiveSync/SOGoMailObject+ActiveSync.m +++ b/ActiveSync/SOGoMailObject+ActiveSync.m @@ -227,6 +227,10 @@ struct GlobalObjectId { type = [part valueForKey: @"type"]; subtype = [part valueForKey: @"subtype"]; + // Don't select an attachment as body + if ([[[part valueForKey: @"disposition"] valueForKey: @"type"] isEqualToString: @"attachment"]) + continue; + if ([type isEqualToString: @"text"] && [subtype isEqualToString: @"html"]) htmlKey = key; else if ([type isEqualToString: @"text"] && [subtype isEqualToString: @"plain"]) @@ -439,7 +443,7 @@ struct GlobalObjectId { { s = [s htmlToText]; } - + d = [s dataUsingEncoding: NSUTF8StringEncoding]; } else if ([type isEqualToString: @"multipart"]) @@ -734,7 +738,13 @@ struct GlobalObjectId { len = [content length]; [s appendString: @"<Body xmlns=\"AirSyncBase:\">"]; - [s appendFormat: @"<Type>%d</Type>", preferredBodyType]; + + // Set the correct type if client requested text/html but we got text/plain + if (preferredBodyType == 2 && nativeBodyType == 1) + [s appendString: @"<Type>1</Type>"]; + else + [s appendFormat: @"<Type>%d</Type>", preferredBodyType]; + [s appendFormat: @"<Truncated>%d</Truncated>", truncated]; [s appendFormat: @"<Preview></Preview>"]; |
|
If you are in the position to test a fix try the attached patch. |
|
The patch looks promising and might even cause the Android mail clients to display the content in a fixed pitch font. Will it be included in the nightlies or so I need to apply it to the source and build it? I can test nightlies but I'm not going to be in a situation to build from source for a couple of weeks due to other pressing projects... |
|
I've pushed the patch: https://github.com/inverse-inc/sogo/commit/82178fd6ceb5c4cb9acb10a4be06c022c895de7a If you tell me which distro you're using, I can regenerate a build which will be available in 1 hour so you can test. |
|
Thanks. I'm using Ubuntu 14.04 LTS (Trusty Tahr) 64-bit (amd64) on our server. Let me know once the build completes and I'll pull the packages and give it a test? |
|
It's ready. |
|
That was quick! OK, I've installed sogo-activesync (2.2.15.20150211-1) and restarted all the sogo workers on the system. I issued a "sogo-tool manage-eas resetfolder <id>" command against three folders containing plain text messages, which seemed to correctly clear the folder in GMail on my Nexus 5 (Android 5.0.1) and reload the messages. It's mostly excellent news. Just about all of my plain text messages now wrap correctly. GMail sadly doesn't select a fixed pitch font but that's not your problem to fix! I have two messages that still do not appear to work. One has no body content at all (just headers) and the other is still rendered on a single line. I'm about to upload copies of them to this but with the sensitive information removed. Hope this helps? |
|
Send them to Thomas Fuehrer and myself - you can grab our emails in the mailing list. |
|
Didn't refresh the page before uploading, so they're attached to this bug and I have also e-mailed them to you as requested... |
|
Sorry to mess you around! I've just done a complete DeviceReset and now the message that rendered with no carriage returns is fine. Obviously something was caching the old copy somewhere. The blank message is still blank though and has no body at all. |
|
The black message is probably due to the fact that it has no content-type. |
|
The problem is caused by an invalid us-ascii character ... from sogo.log: Got invalid multibyte sequence. ToEncode: UCS-2LE FromEncode: US-ASCII. The "invalid" character is in this string: fee of œ90 + VAT. |
|
Fix from tfu works and has been pushed. Open an other bug for the other issue. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2015-01-06 13:01 | tommie | New Issue | |
2015-01-07 09:52 | heupink | Note Added: 0008014 | |
2015-01-09 15:54 | ludovic | Note Added: 0008036 | |
2015-01-09 15:54 | ludovic | Severity | major => minor |
2015-01-10 13:59 | tommie | File Added: Test.eml | |
2015-01-10 14:00 | tommie | File Added: Screenshot_2015-01-10-14-57-26.png | |
2015-01-10 14:01 | tommie | Note Added: 0008049 | |
2015-01-12 19:44 | ludovic | Note Added: 0008056 | |
2015-01-12 19:56 | tommie | Note Added: 0008058 | |
2015-01-12 19:57 | ludovic | Note Added: 0008059 | |
2015-01-13 10:13 | McMichaeli | Note Added: 0008063 | |
2015-02-07 13:45 | McMichaeli | Note Added: 0008152 | |
2015-02-09 04:44 | buzzzo | Note Added: 0008155 | |
2015-02-10 09:56 | buzzzo | Note Edited: 0008155 | |
2015-02-11 07:45 | tfu | File Added: 3055.diff | |
2015-02-11 07:47 | tfu | Note Added: 0008166 | |
2015-02-11 09:30 | tfu | Note Edited: 0008166 | |
2015-02-11 13:19 | McMichaeli | Note Added: 0008167 | |
2015-02-11 13:32 | ludovic | Note Added: 0008168 | |
2015-02-11 14:12 | McMichaeli | Note Added: 0008169 | |
2015-02-11 14:27 | ludovic | Note Added: 0008170 | |
2015-02-11 14:52 | McMichaeli | Note Added: 0008171 | |
2015-02-11 14:54 | ludovic | Note Added: 0008172 | |
2015-02-11 15:03 | McMichaeli | File Added: 2.2.15.20150211-1 Blank Body.eml | |
2015-02-11 15:03 | McMichaeli | File Added: 2.2.15.20150211-1 Single Line Body.eml | |
2015-02-11 15:08 | McMichaeli | Note Added: 0008173 | |
2015-02-11 15:18 | McMichaeli | Note Added: 0008174 | |
2015-02-11 16:26 | ludovic | Note Added: 0008175 | |
2015-02-11 16:41 | tfu | Note Added: 0008176 | |
2015-02-11 23:15 | ludovic | Note Added: 0008177 | |
2015-02-11 23:15 | ludovic | Status | new => resolved |
2015-02-11 23:15 | ludovic | Fixed in Version | => 2.2.16 |
2015-02-11 23:15 | ludovic | Resolution | open => fixed |
2015-02-11 23:15 | ludovic | Assigned To | => ludovic |