Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Take your Zimbra with you!
liverpoolfcfan
Elite member
Elite member
Posts: 1096
Joined: Sat Sep 13, 2014 12:47 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by liverpoolfcfan »

To all users of the zimbra backend running zimbra 8 (or later I assume), please note that following troubleshooting of a user issue the root cause of erratic sync behaviour was narrowed down to ...
Zimbra 8 introduced a new DoSFilter - in their words ...

The denial-of-service filter or DoSFilter was added to the mailbox server in ZCS 8.0 to throttle clients sending a large number of requests over a very short period of time. The DoSFilter is applied to all requests for service, mailbox and admin. This feature was added with the completion of bug 66921.

DoS filtering is enabled by default once ZCS 8 is installed. It may be necessary to adjust the configuration to accommodate specific environmental needs. Disabling DoSFilter is not recommended.
As z-push is usually installed on a separate server from zimbra, it can get blocked by this filter particularly when first synching a device of turning it back on following an extended period of time not synching - basically any time z-push needs to send over many requests to the server in a short space of time. For example, a device requesting a sync on a mailbox that has received 50 new emails since the last sync would generate at a minimum a Search Request and 50 GetMsg Requests. A fast z-push server could fire off these requests very rapidly.
The zimbra wiki page DoSFilter - Zimbra :: Wiki explains how to add the IP address of the z-push server to the DoSFilter whitelist so it is always allowed to issue as many requests as needed.
If you are using versions 8.0.0, 8.0.1, or 8.0.2 please note that the configuration is a more manual process - please see the link at the bottom of the wiki page.
drdre
Outstanding Member
Outstanding Member
Posts: 411
Joined: Fri Sep 12, 2014 10:43 pm

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by drdre »

30/09/2013 16:14:52 [13579] [ERROR] [andreb@chapmans.co.tt] LoopDetection->ProcessLoopDetectionPreviousConnectionFailed(): Command 'Sync' at 30/09/2013 16:08:12 with pid '13544' terminated unexpectedly or is still running.

30/09/2013 16:14:52 [13579] [ERROR] [andreb@chapmans.co.tt] Please check your logs for this PID and errors like PHP-Fatals or Apache segmentation faults and report your results to the Z-Push dev team.
I can receive but cant send again :(
my apache2 log:

[Mon Sep 30 16:20:48 2013] [error] [client 192.168.10.114] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 10240001 bytes) in /usr/share/z-push/backend/zimbra/zimbra.php on line 3613


I know i can change the memory limit for PHP... but i just want to make sure its ok to change it.
drdre
Outstanding Member
Outstanding Member
Posts: 411
Joined: Fri Sep 12, 2014 10:43 pm

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by drdre »

i am using zimbra FOSS 8.0.3 and z-push 2.1.x and zimbra56.1
drdre
Outstanding Member
Outstanding Member
Posts: 411
Joined: Fri Sep 12, 2014 10:43 pm

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by drdre »

liverpoolfcfan you are the best :) ... thumbs up for supporting this module.... if you ever in Trinidad and Tobago or the Caribbean i will definitely buy you a few beers :)
waltholman
Posts: 21
Joined: Sat Sep 13, 2014 12:26 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by waltholman »

Hello all,
I've recently purchased an LG G2 android phone and can't get it working with the zimbrabackend. I've been in contact with Liverpoolcfan, and shown him my logs, setup etc... We can't figure out why it doesn't work. Seems to be a phone issue. I've recently installed the Touchdown app, which works flawlessly, so I don't think it's my configuration, but more likely the phone. During setup on the phone, it gets to the provisioning stage, goes through it fine, and prompts for the Device Administrators Activation screen. Upon activating that, I can see in the logs that it gets to settings, and all looks good in the logs, but the phone errors out at this point and gives an error of:
"Cannot connect to server. Try again after checking network connection and entered information."
Apache does not segfault or give any errors during that time. I'm leaning more and more towards saying it's a buggy email app, but on Liverpool's suggestion, will upgrade to z-push 2.1 to see if that has any impact. Hate to pay $20 for something that ought to work. When I purchased the new phone, I gave my old phone, a Moto Razr to my son. It setup just fine as well. Anyone else have any thoughts on the G2 as to why it might not be working? Thanks for any help,
-Walt
waltholman
Posts: 21
Joined: Sat Sep 13, 2014 12:26 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by waltholman »

Just an update. Upgraded to z-push 2.1 and still getting same error. Touchdown still working like a charm.... What a bummer :(
13123kosnar
Posts: 3
Joined: Sat Sep 13, 2014 3:22 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by 13123kosnar »

Hi,
we have ZCS 8.0.5 with active DoSFilter (I add z-push to whitelist, but it doesn't work), Z-push 2.0.7-1690, zimbraBackend 56.1.
HTC phone synchronization makes many and many "Unnamed" contacts with no data (no phone number, no mail etc.). If I remove some contact, it removes valid one from zimbra.
I thing it is problem only with stock HTC phone - I test HTC Desire C, HTC Desire S, HTC One. I test some Huawei and HTC with Cyanogenmod and this not happen.
My temporrary solution is asleep zimbrabackend before every SOAP request to reach 25 request/sec.
scenario:

1. blank phone, ZCS Directory with at least 31 contacts (DoSFilter default is 30 request/sec)

2. set synchronization on HTC phone, do sync
Have someone any idea.
liverpoolfcfan
Elite member
Elite member
Posts: 1096
Joined: Sat Sep 13, 2014 12:47 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by liverpoolfcfan »

[quote user="13123kosnar"]Hi,
we have ZCS 8.0.5 with active DoSFilter (I add z-push to whitelist, but it doesn't work), Z-push 2.0.7-1690, zimbraBackend 56.1.
HTC phone synchronization makes many and many "Unnamed" contacts with no data (no phone number, no mail etc.). If I remove some contact, it removes valid one from zimbra.
I thing it is problem only with stock HTC phone - I test HTC Desire C, HTC Desire S, HTC One. I test some Huawei and HTC with Cyanogenmod and this not happen.
My temporrary solution is asleep zimbrabackend before every SOAP request to reach 25 request/sec.
scenario:

1. blank phone, ZCS Directory with at least 31 contacts (DoSFilter default is 30 request/sec)

2. set synchronization on HTC phone, do sync
Have someone any idea.[/QUOTE]

I do not have version 8 so I can only ask some general questions about the filter.
Are you sure the changes were accepted ?

Do you have IPv6 enabled ? If so, did you whitelist both IPv4 and IPv6 addresses ?

Is your connection from z-push to zimbra going through a proxy/firewall that might be changing the IP address ?
I have added code to detect the related 503 error for the next release of the backend. Hopefully that will prevent the empty contacts getting created when this issue crops up. If you send me a real email address by Private Message through the forum I can send you a pre-release to try.
In the meantime, can you also try using the setting in the z-push config.php file to limit the number of items output per request.
// Amount of items to be synchronized per request

// Normally this value is requested by the mobile. Common values are 5, 25, 50 or 100.

// Exporting too much items can cause mobile timeout on busy systems.

// Z-Push will use the lowest value, either set here or by the mobile.

// default: 100 - value used if mobile does not limit amount of items

define('SYNC_MAX_ITEMS', 100);
Change it down to 20 for a test - or lower if that still causes an issue. The only real impact would be on initial sync where the device will need to make a lot more requests to get the initial data over - but in normal running it is highly unlikely you would ever have more than two or three maximum items changing at the same time.
Please post back if it makes any difference.
dld75
Posts: 5
Joined: Sat Sep 13, 2014 3:21 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by dld75 »

Hi all,
I have:
CentOS 6.3 64 Bits

PHP 5.3.3

Apache 2.2.15

Zimbra 8.0.3_GA_5664

z-push 2.1.0-1750
I followed the installation steps found in the INSTALL file.
But when I access from a PC to the URL:

Displays">http://correo.dominio.com/Microsoft-Server-ActiveSync
Displays the error message:
Z-Push - Open Source ActiveSync

Version 2.1.0-1750

FatalMisconfigurationException
PHP-MAPI extension is not available
cat /var/log/z-push/access.log
aaa.bbb.ccc.ddd - - [11/Oct/2013:18:16:57 -0500] "GET /Microsoft-Server-ActiveSync HTTP/1.1" 500 2587 "-" "Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Firefox/24.0"
cat /var/log/z-push/z-push.log
11/10/2013 18:16:57 [11570] [INFO] [unknown] Version='2.1.0-1750' method='GET' from='aaa.bbb.ccc.ddd' cmd='' getUser='unknown' devId='' devType=''

11/10/2013 18:16:57 [11570] [FATAL] [unknown] FatalMisconfigurationException: PHP-MAPI extension is not available - code: 0

11/10/2013 18:16:57 [11570] [INFO] [unknown] User-agent: 'unknown'
cat /var/log/z-push/z-push-error.log
11/10/2013 18:16:57 [11570] [FATAL] [unknown] FatalMisconfigurationException: PHP-MAPI extension is not available - code: 0


When I try to install the package php-mapi shows me the error:
yum install php-mapi

Setting up Install Process

No package php-mapi available.

Error: Nothing to do


Apparently the package is not native to the CentOS 6.3, but my question is whether I should just force the installation of the package or the problem is elsewhere?
Thanks
liverpoolfcfan
Elite member
Elite member
Posts: 1096
Joined: Sat Sep 13, 2014 12:47 am

Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks)

Post by liverpoolfcfan »

[quote user="dld75"]

I followed the installation steps found in the INSTALL file.
But when I access from a PC to the URL:

Displays">http://correo.dominio.com/Microsoft-Server-ActiveSync
Displays the error message:
Z-Push - Open Source ActiveSync

Version 2.1.0-1750

FatalMisconfigurationException
PHP-MAPI extension is not available[/QUOTE]

The z-push zimbra backend does not use PHP-MAPI
I suspect you still have the original z-push config.php setting
define('BACKEND_PROVIDER', "BackendZarafa");
You need to change that to
define('BACKEND_PROVIDER', "BackendZimbra");
to use the Zimbra backend
Post Reply