Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Take your Zimbra with you!
Post Reply
3345JpMaxMan
Posts: 48
Joined: Fri Sep 12, 2014 10:45 pm

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by 3345JpMaxMan »

Just wanted to let the community know that there appears to be a bug with the Active Sync protocol in the latest Android 4.4 released on the Nexus 5. It is being reported here:

https://code.google.com/p/android/issue ... =&id=61785
I">https://productforums.google.com/d/msg/ ... pCX-KHrA4J
https://code.google.com/p/android/issue ... =&id=61785
I am experiencing the same problem. The symptoms are roughly:
1. Setup a "corporate" account using the native client

2. Enter all relevant details which are confirmed

3. First batch of e-mails, contacts and calendar come down fine

4. The device will no longer receive new e-mail messages

5. Upon further inspection the device is stuck in a continual sync loop

6. This not only stops it from receiving e-mails but also drains the battery
Hope this helps someone from banging their head against the wall!
12335psurana
Posts: 2
Joined: Sat Sep 13, 2014 3:13 am

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by 12335psurana »

Hello,

It looks like people are experiencing the issue with Microsoft exchange server too.
Can you please provide debug logs?

Please follow the steps below to capture the log.
1. Add zimbra sync log level to TRACE

zmprov aal zimbra.sync trace
2. re-configure/setup the account on device.
3. Follow the steps as described and capture the /opt/zimbra/log/sync.log {Please do not grep the log by user/account name as it will not provide xml dump of requests and responses.}
4. You can open product bug and attach log file.
jojolafleur
Posts: 1
Joined: Sat Sep 13, 2014 3:25 am

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by jojolafleur »

Hello,
I''ve have exaclty the same issue... Any Solutions ?
thank you
phoenix
Ambassador
Ambassador
Posts: 27278
Joined: Fri Sep 12, 2014 9:56 pm
Location: Liverpool, England

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by phoenix »

[quote user="jojolafleur"]I''ve have exaclty the same issue... Any Solutions ?[/QUOTE]How about reading the post above yours and providing the information that's been requested?
Regards

Bill

Rspamd: A high performance spamassassin replacement

Per ardua ad astra
3345JpMaxMan
Posts: 48
Joined: Fri Sep 12, 2014 10:45 pm

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by 3345JpMaxMan »

[quote user="12335psurana"]Hello,

It looks like people are experiencing the issue with Microsoft exchange server too.
Can you please provide debug logs?

Please follow the steps below to capture the log.
1. Add zimbra sync log level to TRACE

zmprov aal zimbra.sync trace
2. re-configure/setup the account on device.
3. Follow the steps as described and capture the /opt/zimbra/log/sync.log {Please do not grep the log by user/account name as it will not provide xml dump of requests and responses.}
4. You can open product bug and attach log file.[/QUOTE]
Yes, considering it is across the board with active sync providers including lotus - I don't think it is a problem on Zimbra's end.
However, as I might have some time I will try to get this info and I will also send it to Google.
Klug
Ambassador
Ambassador
Posts: 2767
Joined: Mon Dec 16, 2013 11:35 am
Location: France - Drôme
ZCS/ZD Version: All of them
Contact:

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by Klug »

The Zimbra bug is here:
A">https://bugzilla.zimbra.com/show_bug.cgi?id=85070
A client-side fix (for the smartphones and tablets) should be pushed by Google in the next OTA update of the device.
techman83
Posts: 3
Joined: Sat Sep 13, 2014 3:05 am

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by techman83 »

For those needing a fix sooner you can do some magic with apache. (If someone knows how to do this with Nginx, I'd love to hear it).
You need to set up a reverse proxy in the usual manner.
Download Cmake,make,make install the latest version of libwbxml2 - Available here: libwbxml | Free software downloads at SourceForge.net
Then add the following to your reverse proxy virtual host



RewriteEngine On

RewriteCond %{QUERY_STRING} ^(?:.*&)?Cmd=(Sync).*$

RewriteRule ^ - [env=sync]
ExtFilterDefine decode enableenv=sync mode=input cmd="/bin/wbxml2xml -l ACTIVESYNC - -o -"

ExtFilterDefine fixandroid enableenv=sync mode=input cmd="/bin/sed 's/010
ExtFilterDefine encode enableenv=sync mode=input cmd="/bin/xml2wbxml -a - -o -"





SetInputFilter encode;fixandroid;decode

ExtFilterOptions LogStderr




Note, I did this on an ubuntu 12.04 install and I had to upgrade to a really modern version of Apache via this ppa:


If">https://launchpad.net/~nightuser/+archive/apache2
If nginx can do it, It would be dead trivial to add if you were running a Zimbra proxy server.
It would be just adding this line here



if ($args ~ "^Cmd=(Sync)") {

run external script here eg "/bin/wbxml2xml -l ACTIVESYNC - -o - | /bin/sed 's/010
}


What is going on is the devices are sending a window size of 0, essentially asking for no data


http://www.microsoft.com/">

http://synce.org/formats/airsync_wm5/airsync">







2

1



0



1

http://synce.org/formats/airsync_wm5/airsyncbase">

2

200000












Unfortunately it's binary encoded, so a simple subfilter isn't up to the task. It has to be decoded, window size changed and then re-encoded.
The fix will also be in the next release of Zimbra according to support.
Leon
liverpoolfcfan
Elite member
Elite member
Posts: 1112
Joined: Sat Sep 13, 2014 12:47 am

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by liverpoolfcfan »

[quote user="techman83"]

What is going on is the devices are sending a window size of 0, essentially asking for no data

[/QUOTE]
It is not actually asking for no data. According the the latest ActiveSync specs (regarding WindowSize)
[QUOTE]The WindowSize element appears only in requests that are sent to the server from the client. If the WindowSize element is omitted, the server behaves as if a WindowSize element with a value of 100 were submitted. The server interprets the value 0 (zero) and values above 512 as 512.[/QUOTE]
The problem is that the zimbra ActiveSync implementation appears to be treating the 0 as ZERO - instead of treating it as 512 which is what it should do.
techman83
Posts: 3
Joined: Sat Sep 13, 2014 3:05 am

Nexus 5 Android 4.4 Kit Kat <--> Zimbra Active Sync Bug

Post by techman83 »

[quote user="liverpoolfcfan"]It is not actually asking for no data. According the the latest ActiveSync specs (regarding WindowSize)

The problem is that the zimbra ActiveSync implementation appears to be treating the 0 as ZERO - instead of treating it as 512 which is what it should do.[/QUOTE]
My mistake, I shouldn't pretend that I understand ActiveSync fully, I only learnt enough to work around the problem!
Though It would seem our exchange/groupwise bretheren were not immune to the issue. One of those occaisions where what the specs say and how people implement them are 2 very different things!
Leon
Post Reply