Koozali.org: home of the SME Server

Horde 5.2, activesync

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Horde 5.2, activesync
« on: November 28, 2016, 03:36:34 PM »
I have  a question of understanding activesync with horde.

While following the https://wiki.contribs.org/Horde5 is EAS enabled in default? Or do I have to follow this: https://wiki.horde.org/activesync

As I do not see any templates after installing I assume, EAS has to be enabled seperately. If so, will that work on SME:

Server Setup

To activate the server, it needs to be enabled in Horde's configuration, on the ActiveSync tab. The SQL tables that horde uses are created as usual from the Horde configuration screen.
Webserver

You will need to configure your webserver to redirect the URL /Microsoft-Server-ActiveSync to your horde/rpc.php file. How you do this depends on your webserver and it's configuration. For Apache, something like:
1
   
Alias /Microsoft-Server-ActiveSync /var/www/horde/rpc.php

Note: It has been reported that when running PHP via mod_fcgid on Apache that the Alias directive will not pass the correct URL to the fcgid-script handler. This can be worked around by using a RewriteRule instead (adapted from http://maurus.net/weblog/2010/10/26/running-z-push-1-4-2-with-apache-and-fastcgifcgid/):
1
2
   
RewriteEngine On
RewriteRule ^/Microsoft-Server-ActiveSync /horde/rpc.php [PT,L,QSA]

There has also been a report from that the Authorization headers are not correctly passed when using mod_php with Apache. These are known issues and are should actually already be taken care of by the Horde_Controller_Request object. However, if you are still having issues with ActiveSync complaining about no Authorization errors, you can try the following configuration:
1
2
3
   
RewriteRule .* - [E=HTTP_MS_ASPROTOCOLVERSION:%{HTTP:Ms-Asprotocolversion}]
RewriteRule .* - [E=HTTP_X_MS_POLICYKEY:%{HTTP:X-Ms-Policykey}]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

None of these issues have been reported using lighttpd/fastcgi or Apache+mod_fastcgi+php-fpm.

For Apache + PHP-FPM using mod_proxy_fcgi
1
   
ProxyPassMatch ^/Microsoft-Server-ActiveSync$ unix:/usr/local/php55/sockets/webapps.sock|fcgi://127.0.0.1:9000/var/www/html/horde/rpc.php$1

To activate the server, it needs to be enabled in Horde's configuration, on the ActiveSync tab. Where should that be found?

Is anybody out there with a working configuration for EAS on the SME 9.1? Could that be eventually provided? Maybe in the WIKI?

Thank's for any reply,
stefan
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #1 on: November 28, 2016, 09:05:27 PM »
With the default install and trying to set up EAS on a BB Passport with horde brings up:

access.log: [28/Nov/2016:21:00:32 +0100] "POST /Microsoft-Server-ActiveSync?Cmd=Provision&DeviceType=BlackBerry&User=XXX%5CXXX&DeviceId=BB2BXXX HTTP/1.1" 404 225 "-" "RIM-Passport-SQW100-1/10.3.2.2876"
error.log: File does not exist: /home/e-smith/files/ibays/Primary/html/Microsoft-Server-ActiveSync

The mobile phone brings up auth error.

Has anybody any idea to point me in the right direction?
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

guest22

Re: Horde 5.2, activesync
« Reply #2 on: November 28, 2016, 09:06:19 PM »
Can you reach the URL with a browser?

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #3 on: November 28, 2016, 09:53:22 PM »
Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /Microsoft-Server-ActiveSync.

Reason: Error reading from remote server
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

guest22

Re: Horde 5.2, activesync
« Reply #4 on: November 28, 2016, 09:55:01 PM »
There you go. Analyzing the logs would be an interesting thing. Browsing to the URL (the most simple method) should be flawless.

guest22

Re: Horde 5.2, activesync
« Reply #5 on: November 28, 2016, 09:55:55 PM »
Requesting moderator to split the last post from you into a seperate post.

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #6 on: November 28, 2016, 10:04:50 PM »
Quote
here you go. Analyzing the logs would be an interesting thing. Browsing to the URL (the most simple method) should be flawless.
Report to moderator   Logged

Quote
access.log: [28/Nov/2016:21:00:32 +0100] "POST /Microsoft-Server-ActiveSync?Cmd=Provision&DeviceType=BlackBerry&User=XXX%5CXXX&DeviceId=BB2BXXX HTTP/1.1" 404 225 "-" "RIM-Passport-SQW100-1/10.3.2.2876"
error.log: File does not exist: /home/e-smith/files/ibays/Primary/html/Microsoft-Server-ActiveSync

Can't see no more...
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

guest22

Re: Horde 5.2, activesync
« Reply #7 on: November 28, 2016, 10:05:39 PM »
That's not the log for accessing with a browser....

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Re: Horde 5.2, activesync
« Reply #8 on: November 29, 2016, 03:05:25 AM »
I have  a question of understanding activesync with horde.

While following the https://wiki.contribs.org/Horde5 is EAS enabled in default? Or do I have to follow this: https://wiki.horde.org/activesync

As I do not see any templates after installing I assume, EAS has to be enabled seperately. If so, will that work on SME:

Server Setup

To activate the server, it needs to be enabled in Horde's configuration, on the ActiveSync tab. The SQL tables that horde uses are created as usual from the Horde configuration screen.
Webserver

You will need to configure your webserver to redirect the URL /Microsoft-Server-ActiveSync to your horde/rpc.php file. How you do this depends on your webserver and it's configuration. For Apache, something like:
1
   
Alias /Microsoft-Server-ActiveSync /var/www/horde/rpc.php

Note: It has been reported that when running PHP via mod_fcgid on Apache that the Alias directive will not pass the correct URL to the fcgid-script handler. This can be worked around by using a RewriteRule instead (adapted from http://maurus.net/weblog/2010/10/26/running-z-push-1-4-2-with-apache-and-fastcgifcgid/):
1
2
   
RewriteEngine On
RewriteRule ^/Microsoft-Server-ActiveSync /horde/rpc.php [PT,L,QSA]

There has also been a report from that the Authorization headers are not correctly passed when using mod_php with Apache. These are known issues and are should actually already be taken care of by the Horde_Controller_Request object. However, if you are still having issues with ActiveSync complaining about no Authorization errors, you can try the following configuration:
1
2
3
   
RewriteRule .* - [E=HTTP_MS_ASPROTOCOLVERSION:%{HTTP:Ms-Asprotocolversion}]
RewriteRule .* - [E=HTTP_X_MS_POLICYKEY:%{HTTP:X-Ms-Policykey}]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

None of these issues have been reported using lighttpd/fastcgi or Apache+mod_fastcgi+php-fpm.

For Apache + PHP-FPM using mod_proxy_fcgi
1
   
ProxyPassMatch ^/Microsoft-Server-ActiveSync$ unix:/usr/local/php55/sockets/webapps.sock|fcgi://127.0.0.1:9000/var/www/html/horde/rpc.php$1

To activate the server, it needs to be enabled in Horde's configuration, on the ActiveSync tab. Where should that be found?

Is anybody out there with a working configuration for EAS on the SME 9.1? Could that be eventually provided? Maybe in the WIKI?

Thank's for any reply,
stefan

From the change log of e-smith-horde

* Mon Sep 09 2013 John H. Bennett III <bennettj@johnbennettservices.com> 4.6.0-6
- Patch to add db variable to enable/disable Activesync support.  Forgot to add originally.
- config setprop horde ActiveSyne enabled|disabled

Then do a signal-event email-update.

All of the templates for horde are in the same location they have always been, /etc/e-smith/templates/home/httpd/html/horde/config


And yes, I have a working config, out of the box, and use it everyday.

John
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #9 on: November 29, 2016, 09:02:58 AM »
John,

that sound good. I'll try this today and let you know.

Quote
Posted by: RequestedDeletion
« on: Today at 06:05:39 AM »

That's not the log for accessing with a browser....

Where should I look if not in /var/log/httpd/access.log or error.log?
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #10 on: November 29, 2016, 09:33:56 AM »
John,

no luck:

==> access_log <==
ivb.local 78.42.153.224 - - [29/Nov/2016:09:34:28 +0100] "POST /Microsoft-Server-ActiveSync?Cmd=Provision&DeviceType=BlackBerry&User=xxx.local%5Cyyy&DeviceId=BB2BFxxx HTTP/1.1" 404 225 "-" "RIM-Passport-SQW100-1/10.3.2.2876"

==> error_log <==
[Tue Nov 29 09:34:28 2016] [error] [client 78.42.153.224] File does not exist: /home/e-smith/files/ibays/Primary/html/Microsoft-Server-ActiveSync

edited for syncing contacts:

When I try to sync additionally to emails the contacts, the auth error is back again.

Nothing, no email no contact (did not try the calendar and tasks yet), is synced at all.


I think there's missing something in the apache conf.
« Last Edit: November 29, 2016, 09:41:17 AM by SchulzStefan »
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #11 on: November 29, 2016, 09:57:29 AM »
Quote
- config setprop horde ActiveSyne enabled|disabled

Douhhh - there's a typo: ActiveSyne

Damn copy and paste... should obviously be ActiveSync
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #12 on: November 29, 2016, 11:17:26 AM »
Update

After "config setprop horde ActiveSync enabled", in horde appears the ActiveSync-Tab, BUT - no devices show up.

I tried ActiveSync with two devices, I can see no error in the access_log or error_log.

1. BB Passport setup to connect EAS, emails are synced, BUT - no contacts, no calendar, no tasks
2. Nokia E7, same setup, emails are being synced, BUT - no contacts, no calendar, no tasks

In the horde wiki is said, that both devices should work.

Also is said, that it should be possible to configure a seperate logging for activesync - I can't find where. How can we track down the error?
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #13 on: November 29, 2016, 12:04:41 PM »
For ActiveSync it seems there could be a problem with virtual domains in addition with dyndns also... If as email adress a virtual domain for the eas-credentials is used, no error appears but nothing is synced.
And then one day you find ten years have got behind you.

Time, 1973
(Mason, Waters, Wright, Gilmour)

Offline mrjhb3

  • *
  • 1,188
  • +0/-0
    • John Bennett Services
Re: Horde 5.2, activesync
« Reply #14 on: November 29, 2016, 02:34:25 PM »
Sorry for the typo.


Most of the answers to your questions are in the templates, /etc/e-smith/templates/home/httpd/html/horde/config/conf.php/100ConfHordePHP



{
   if (($horde{'DeviceLog'} || 'disabled') eq 'enabled')
   {
        $OUT =<<'HERE';
$conf['activesync']['logging']['path'] = '/tmp';
$conf['activesync']['logging']['level'] = '1';
$conf['activesync']['logging']['type'] = 'perdevice';
HERE
   } else {
        $OUT =<<'HERE';
$conf['activesync']['logging']['type'] = false;
HERE
}
}




So setting - config setprop horde DeviceLog enabled, then signal-event email-update, will create per device logs in /tmp.  I have used this to send sync logs to the horde devs.


Did you set up in your preferences what address book, calendar, etc., to be used for syncing?


I've not done any testing with virtual domains, or secondary domains set up in SME Server, but all of them do have the same activesync lines in them.


I've also only tested activesync on Andriod and IOS devices.


John
......