Author Topic: [SOLVED] Z-push -> Android 2.2.2  (Read 5346 times)

Trym

  • Zen Warrior
  • ***
  • Posts: 117
  • Karma: +1/-0
    • View Profile
[SOLVED] Z-push -> Android 2.2.2
« on: March 20, 2011, 02:01:35 pm »
Got a shiny new toy yesterday, an Optimus 2x running Android 2.2.2 ;D

First thing I wanted to try was of course syncing with Zarafa using the built in Android client (which is called "MS Exchange", although it's an ActiveSync app{*}), as this would be immensely useful for me. The net seems to be full of success stories (as well as people wanting to smash their phones), so I'm figuring I'm doing something wrong.

I cannot get past the "Connecting to server - The phone is connecting to the email-server"-bit. It just sits there forever rotating its little "wait a while" circle.

While the phone is "connecting" there definitively is something going on; apache, mysql and zarafa-server each use some processor time, seemingly in a repeating pattern.

I'm connecting to the "domain", ie. virtual web-server address which Zarafa is set at. If I connect to the same "<domain>/Microsoft-Server-ActiveSync" in a browser I get challenged by a username/password auth-box, that bit seems to be working for both http and https. I've tried connecting with SSL set to both on and off.

I figured maybe my mailbox was too large and something timed out, so I made another quick setup in a virtual machine with an empty account, same thing happens.

Also, if I type a non-existing server address or an address without Z-push listening, the app doesn't even get past the point of configuring the connection, so it does find something it likes before trying to connect.

I don't know where to go from here, the usual logs show no clues.

The parameters you can input in the client are:

e-mail address:
username:
password
domain:
Server address:

The only mysterious parameter is the domain, I'm not sure what to input, I've tried a blank domain as well as the zarafa-domain and the virtual e-mail domain, it doesn't seem to make any difference, most guides leave it blank.

If I had to guess, I'd guess that something goes wrong during the authentication-process, and that it just keeps trying (looking at the processes in 'top'.) I've tried with and without a certificate for Zarafa Gateway Server, which shouldn't really matter. (Wrong certificate perhaps? I've no clue how to make a correct one if that's the case.)

Other thoughts:

*1) I may have missed the plot completely, and the "MS Exchange" listed under Sync is not an ActiveSync client, but a full Outlook Client, in which case I need to install the community version of Zarafa. There's supposed to be built-in support for Active Sync in Froyo though, so if it's the wrong app, where the heck is the correct one?

2) The security settings on the phone does not match the criteria for ActiveSync, and the phone somehow neglects to notice/tell me.

3) Z-push in Zentyal's Zarafa is not correctly configured?

4) Z-push version is too old?

Any ideas at all welcome, feel free to speculate. If you've got any of this working, or even just semi-working I'd be very thankful for any configuration pointers.

::Trym
« Last Edit: March 20, 2011, 09:34:06 pm by Trym »

Trym

  • Zen Warrior
  • ***
  • Posts: 117
  • Karma: +1/-0
    • View Profile
Re: Z-push -> Android 2.2.2
« Reply #1 on: March 20, 2011, 05:25:09 pm »
I've since found that when visiting the correct URL in a browser, after the auth-challenge you should get an error-message like this:

"Your device requested the Z-Push URL without the required GET parameters", which I can find in /usr/share/z-push/index.php
 
All I get is a blank page.

So for now the theory is that Z-push/apache is misconfigured.
« Last Edit: March 20, 2011, 05:40:21 pm by Trym »

Trym

  • Zen Warrior
  • ***
  • Posts: 117
  • Karma: +1/-0
    • View Profile
Re: [SOLVED] Z-push -> Android 2.2.2
« Reply #2 on: March 20, 2011, 09:38:27 pm »
Yep, for Android use it's misconfigured.

You need to edit "/usr/share/z-push/config.php" and change "

define('PROVISIONING', true);

to

define('PROVISIONING', false);

If you need some safety for other types of devices you can change

define('LOOSE_PROVISIONING', false);

to

define('LOOSE_PROVISIONING', true);

instead, although I haven't tested this.

Works beatifully now, my only fear is that this config will somehow get overwritten, will see if I can find a template to edit by use of hooks instead.

Zentayl team, add a checkbox for this?

::Trym
« Last Edit: March 20, 2011, 09:41:04 pm by Trym »

satyris

  • Zen Monk
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: [SOLVED] Z-push -> Android 2.2.2
« Reply #3 on: March 21, 2011, 08:45:27 am »
Have you changed anything on the buildin Zarafa to reach that?

My wish is to try that with a Samsung Bada mobile :-)

Trym

  • Zen Warrior
  • ***
  • Posts: 117
  • Karma: +1/-0
    • View Profile
Re: [SOLVED] Z-push -> Android 2.2.2
« Reply #4 on: March 21, 2011, 10:23:52 am »
No, the only thing that needed changing was the config.php on a standard Zentyal installation.

::Trym

jsalamero

  • Zentyal Staff
  • Zen Hero
  • *****
  • Posts: 1419
  • Karma: +45/-1
    • View Profile
Re: [SOLVED] Z-push -> Android 2.2.2
« Reply #5 on: April 08, 2011, 04:38:53 am »
Will update zpush packages soon and I'll have a look on this, thanks Trym.