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
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #15 on: November 29, 2016, 02:54:47 PM »
typo is no problem...

I'll try the log settings in the evening.

What do you mean with setting up preferences? In the BB-device (also in the nokia) you need to enter

- the account (user),
- password for the user,
- you may enter the domain (usually I leave this empty)
- email of the user (in my case it's an email-adress from a virtual domain)
- server (in my case it's a dyndns),
- port,
- ssl (or not),
- push (or not)
- sync-periods

And what you want to sync. Means email, calendar, contacts...

That's all. Works fine with sogo. On both mobiles.

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 #16 on: November 30, 2016, 12:56:48 AM »
Preferences set up in webmail.  Login, click the gear icon, and set your preferences for each of the modules.
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #17 on: November 30, 2016, 10:56:17 AM »
I enabled logging - no logs in tmp.

Yes, I configured horde... as I understand, most should work out of the box.

I think as long as no device is showing up in the activesync tab (general settings) nothing will be synced. Question is, why does no mobile show up there?

Could there be an interference with sogo? Maybe I should set up a virtualbox for more testings. Right now I only disabled sogo.
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 #18 on: November 30, 2016, 01:20:22 PM »
I set up a virtual server.

Results:

- email seems to be synced (there's more testing needed because of the issue with virtual domains and the depending email-accounts)
- contacts from server to phone seems to work
- contacts from phone to server don't work
- calendar is not being synced at all
- tasks are not synced - an error occurs while editing tasks on the left panel (there's a pencil shown): Forbidden You don't have permission to access /horde/nag/tasklists/edit.php on this server.
- in horde no devices show up in the activesync tab and nothing shows up in the syncml tab.

Log from the device is created in tmp

In /var/log/messages appears:
Nov 30 12:50:26 mond HORDE: [imp] Login success for test (Horde user test@dyndns.org) (89.204.137.9) to {imap://localhost/} [pid 2985 on line 157 of "/home/httpd/html/horde/imp/lib/Auth.php"]

There's no user test@dyndns.org. There's a user "test" but no domain dyndns.org.

Maybe there's some more testing needed...
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 #19 on: December 01, 2016, 10:30:00 AM »
John,

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

Do you see your devices in the activesync tab? Or in the syncml?
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 #20 on: December 01, 2016, 02:27:10 PM »
Yes, all of the devices that are being used with ActiveSync show up in preferences, Global preferences, Activesync tab.

Please show the output of this.
cat /home/httpd/html/horde/imp/config/backends.local.php

Also, this thread should be moved to the  SME 9.x Contribs section since horde 5.2 isn't part of the official SME 9 release.



......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #21 on: December 01, 2016, 02:39:50 PM »
Quote
Yes, all of the devices that are being used with ActiveSync show up in preferences, Global preferences, Activesync tab

I have a "no show".

Quote
Please show the output of this.
cat /home/httpd/html/horde/imp/config/backends.local.php

#------------------------------------------------------------
#          !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
*/

//100Overrides
$servers['imap']['disabled'] = true;

//120IMAPServers
$servers['ivb.local'] = array(
    'disabled' => false,
    'name' => 'IMAP Server',
    'hostspec' => 'localhost',
    'hordeauth' => true,
    'protocol' => 'imap',
    'port' => '143',
    'secure' => 'notls',
    'maildomain' => 'ivb.local',
    'smtphost' => 'localhost',
    'smtpport' => '25',
    'cache' => false,
);
$servers['eyeseetv.de'] = array(
    'disabled' => false,
    'name' => 'IMAP Server',
    'hostspec' => 'localhost',
    'hordeauth' => true,
    'protocol' => 'imap',
    'port' => '143',
    'secure' => 'notls',
    'maildomain' => 'eyeseetv.de',
    'smtphost' => 'localhost',
    'smtpport' => '25',
    'cache' => false,
);
$servers['fax'] = array(
    'disabled' => false,
    'name' => 'IMAP Server',
    'hostspec' => 'localhost',
    'hordeauth' => true,
    'protocol' => 'imap',
    'port' => '143',
    'secure' => 'notls',
    'maildomain' => 'fax',
    'smtphost' => 'localhost',
    'smtpport' => '25',
    'cache' => false,
);
$servers['ivbonline.de'] = array(
    'disabled' => false,
    'name' => 'IMAP Server',
    'hostspec' => 'localhost',
    'hordeauth' => true,
    'protocol' => 'imap',
    'port' => '143',
    'secure' => 'notls',
    'maildomain' => 'ivbonline.de',
    'smtphost' => 'localhost',
    'smtpport' => '25',
    'cache' => false,
);
$servers['objektschilder.de'] = array(
    'disabled' => false,
    'name' => 'IMAP Server',
    'hostspec' => 'localhost',
    'hordeauth' => true,
    'protocol' => 'imap',
    'port' => '143',
    'secure' => 'notls',
    'maildomain' => 'objektschilder.de',
    'smtphost' => 'localhost',
    'smtpport' => '25',
    'cache' => false,
);

?>

Here you are. It's the output from the production server.


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 #22 on: December 02, 2016, 12:57:03 AM »
What URL are you using when trying to access webmail?


You may also need to do this as well, [/size]https://forums.contribs.org/index.php/topic,50969.msg271247.html#msg271247[/color]


I'm also curious of that dyndns.org entry.


John

......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #23 on: December 02, 2016, 09:22:40 AM »
Quote
What URL are you using when trying to access webmail?

https://my.server.ip/webmail or https://my.server.ip/horde

Quote
I'm also curious of that dyndns.org entry.

As I said usually I leave the domain empty for EAS. I'll try to connect with a domain and report.

Quote
You may also need to do this as well, [/size]https://forums.contribs.org/index.php/topic,50969.msg271247.html#msg271247[/color]

I'll try this and report.

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 #24 on: December 02, 2016, 06:58:46 PM »
Quote
You may also need to do this as well, [/size]https://forums.contribs.org/index.php/topic,50969.msg271247.html#msg271247[/color]

This leads from:

HORDE: [imp] Login success for test (Horde user test@dyndns.org) (78.42.153.224) to {imap://localhost/} [pid 2299 on line 157 of "/home/httpd/html/horde/imp/lib/Auth.php"]

to:

HORDE: [imp] Login success for test (Horde user test@eyeseetv.de) (78.42.153.224) to {imap://localhost/} [pid 2794 on line 157 of "/home/httpd/html/horde/imp/lib/Auth.php"]

Anyway - only emails seems to be synced properly. The rest (calendar, contacts, tasks) is not working without errors. All tested in the virtual machine with the nokia device.

The device does not show up in the activesync tab.
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 #25 on: December 03, 2016, 05:58:21 PM »
I did a pear ua.

Among some other modules activesync was also updated. Surprise - (nearly) everything seems to work now. Nearly, because for me it's not possible to login remote as admin. Only with FQHN not with an IP. Tested with a Nokia E7-00 in a virtualbox, SME 9.1 up-to-date, no other contribs installed.

- emails work in both directions
- calendar work in both directions
- tasks work in both directions
- contacts work in both directions

I'll give this a try on a production server.  For years I was happy with zarafa. Due to their new policy I moved to sogo 2.x. Sogo 2.x does not handle invitations, therefore I'm still looking for an alternative. If horde 5.2.x turns out to be stable, I vote for Horde in the next SME major release.

Good work John, thank you.
stefan
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 #26 on: December 03, 2016, 10:21:55 PM »
Thank you for the update.  Very interesting.  I have all the updated files installed on my system, so that means what's on my contribs is old, so I'll get that updated so no one else has to go through the initial pain that you did.

As far as logging in with an IP address as admin, you are going to have to use a custom template for that.  There is a DB key to add additional admins, but it appends the main domain.

You will have to look at the logs for when you login remote to know what to put there.  For my example, my test server is at 10.10.10.50.  I went to https://10.10.10.50/webmail, and logged in as admin.  Here is what's in my log.

Dec  3 15:10:46 www HORDE: [horde] Login success for admin@10.50 to horde (10.10.10.125) [pid 2410 on line 164 of "/home/httpd/html/horde/login.php"]
Dec  3 15:10:46 www HORDE: [imp] Login success for admin (Horde user admin@10.50) (10.10.10.125) to {imap://localhost/} [pid 2410 on line 157 of "/home/httpd/html/horde/imp/lib/Auth.php"]

You need to use the second output that shows Horde user.  This is because the hook that is currently being used, doesn't accommodate when using an IP address to log in.  If you have a dynamic address, then this probably isn't a good solution.  Here is what I did.

/etc/e-smith/templates-custom/home/httpd/html/horde/config/conf.php

//500ConfHordePHP custom template
{
       my @HordeAdmins = split /[,:]/, $horde{Admins} || '';
       $OUT .= "\$conf['auth']['admins'] = array(";
       if (($horde{RemoveUsers} || 'disabled') eq 'enabled')
       {
          $OUT .= "'adminremoveuser'" . ", "  ;
       }
       $OUT .= "'admin\@$DomainName', ";
       $OUT .= "'admin\@10.50', ";     
       foreach my $HordeAdmins (sort @HordeAdmins)
       {
       $OUT .= "'$HordeAdmins" . "@" . "$DomainName'" . ", "  ;
       }
     $OUT .= ");";
}

After this, now when I go to the IP address and login as admin, I have the  Administration options.

John
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #27 on: December 04, 2016, 12:10:07 AM »
Moved to a production server.

Here's what I got:

- email works fine
- contacts are working fine (imported as csv)
- calender is not syncing (imported as ics), maybe too much data?

Here's an error:
HORDE: [kronolith] PHP ERROR: Invalid argument supplied for foreach() [pid 5253 on line 1638 of "/home/httpd/html/horde/kronolith/lib/Kronolith.php"]

Further it seems to me if working remote connected with an IP all kind of imported data (contacts and calendar) is lost with the next connect. Doing exactly the same with FQHN (VNC-connection) the data is all there. I've no idea about this. Working remote over an IP with i.e. sogo works fine.

Another error:
HORDE: [kronolith] PHP ERROR: json_encode() [<a href='function.json-encode'>function.json-encode</a>]: Invalid UTF-8 sequence in argument [pid 2590 on line 242 of "/usr/share/pear/Horde/Serialize.php"]

Quote
You may also need to do this as well, [/size]https://forums.contribs.org/index.php/topic,50969.msg271247.html#msg271247[/color]

I think this should be templated - otherwise EAS over dyndns will not work?

I'd like to know why the calendar on the production machine only syncs one date... could that be a memory problem? Hmm... I didn't import calendar-data in the virtual box, I just played around with a few dates.
« Last Edit: December 04, 2016, 12:28:24 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 #28 on: December 04, 2016, 12:47:43 AM »
I'm not able to access https://FQHN/horde/admin/config/ as admin. Clicking the redirect-button of the browser leads me to the webmail tab of the admin. Doing the same as a user who I added as admin, leads to the webmail tab of the user. Doesn't work either with an access over IP. Strange.
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 #29 on: December 05, 2016, 10:46:57 AM »
Update and a few comments to tests on a production server

1) activesync:

1. Device:
Id: IMEI3548XXX
Policy Key: 0
Programm: NokiaE700/1.00(0)MailforExchange 3gpp-gba
Modell: NokiaE700
IMEI: IMEI3548XXX
Eindeutiger Name: Nokia/Mail For Exchange
OS: 25.007
EAS Version: 12.1

Working except of calendar in the case, that a calendar has been imported to horde. What usually should be the case if one is migrating from another groupware.

2. Device:
Id: BB2BFD4A09
Policy Key: 0
Programm: RIM-Passport-SQW100-1/10.3.2.2876
Modell: Passport SQW100-1
IMEI: 35185XXX
Eindeutiger Name: BlackBerry Passport
Mobile Operator: o2 - de
OS: BlackBerry 10
OS Language: de_DE
Telefonnummer: +491XXX
EAS Version: 14.1
Gespeicherter Heartbeat (Sekunden): 600

Working properly.

3. Device:
Id: 14439XXX
Policy Key: 0
Programm: Thunderbird ActiveSync Lightning/4.7.5
EAS Version: 14.0
Gespeicherter Heartbeat (Sekunden): Nicht verfügbar

Seems to work for email, calendar and addresses. More tests need to be done.


2) access as admin:

No luck remote accessing over an IP. Quite interesting thing - 12 hours before re-starting all important services (I do this nightly for maintanence reasons on all servers) I had no admin privileges in my menu. Yes, I added myself as admin. Now, in the morning the admin menu appears.

3) working with filters

It seems that dovecot-extras have to be installed/enabled. Without dovecot errors have been generated and scripts did not work.
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 #30 on: December 05, 2016, 01:59:41 PM »
Well, don't know what to say...

I altered/added (changed the template in templates, couldn't find a way to do this via templates-custom) to the hooks.local.php a virtual domain I use for the EAS. Guess what: no more admin access possible...?

Secondly I realize, that my configured horde main screen is gone after signal-event post-upgrade; signal-event reboot.

Seems that horde is extremely sensible when it comes to the logins? Not quite easy for EAS and remote work.
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 #31 on: December 05, 2016, 06:38:15 PM »
Update

As I used this for /home/httpd/html/horde/config/hooks.local.php:

Quote
public function authusername($userId, $toHorde)
      {
          // Example #1: Append the virtual domain to the username.
          // ex. $HTTP_HOST = 'mail.mydomain.com', $userId = 'myname' returns:
          // 'myname@mydomain.com'
          $vdomain = getenv('HTTP_HOST');
          preg_match('/[^.]+\.[^.]+$/', $vdomain, $matches);
          $vdomain = $matches[0];   
          $vdomain = 'mydomain.com.mk';
          if ($userId == 'adminremoveuser') {
               return $userId;
          } else {
             if ($toHorde) {
                 return $userId . '@' . $vdomain;
             } else {
                  return (substr($userId, -strlen($vdomain)) == $vdomain)
                  ? substr($userId, 0, -strlen($vdomain)-1)
                  : $userId;
             }
          }
      }


it seems to be necessary to use this also:

Quote
/etc/e-smith/templates-custom/home/httpd/html/horde/config/conf.php

//500ConfHordePHP custom template
{
       my @HordeAdmins = split /[,:]/, $horde{Admins} || '';
       $OUT .= "\$conf['auth']['admins'] = array(";
       if (($horde{RemoveUsers} || 'disabled') eq 'enabled')
       {
          $OUT .= "'adminremoveuser'" . ", "  ;
       }
       $OUT .= "'admin\@$DomainName', ";
       $OUT .= "'admin\@10.50', ";     
       foreach my $HordeAdmins (sort @HordeAdmins)
       {
       $OUT .= "'$HordeAdmins" . "@" . "$DomainName'" . ", "  ;
       }
     $OUT .= ");";
}


I changed the IP to the virtual domain which I use for EAS. After that I was able to access the admin menu as admin with

https://FQHN/horde/admin/config/

All done local - NOT remote.
« Last Edit: December 05, 2016, 06:40:47 PM 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 #32 on: December 13, 2016, 07:59:11 AM »
With the modifications mentioned in this thread, Horde 5.2 is running stable. No more pain so far. IMHO it's a pretty good alternative to zarafa and/or sogo.

As I imported my adresses in horde-turba I'm not quite happy with the email adresses. While googling around I stumbled about this:

https://monotok.org/add-custom-fields-horde-5-turba/, this (in German) http://www.omerzu.de/horde.php besides a few more articles to that issue.

It seems there are solutions for managing two or more email adresses especially to be proper synced. The challenge is to do this in the SME way. Means - how can this be templated? Any help is appreciated.

stefan
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 #33 on: December 15, 2016, 06:16:13 AM »
With the modifications mentioned in this thread, Horde 5.2 is running stable. No more pain so far. IMHO it's a pretty good alternative to zarafa and/or sogo.

As I imported my adresses in horde-turba I'm not quite happy with the email adresses. While googling around I stumbled about this:

https://monotok.org/add-custom-fields-horde-5-turba/, this (in German) http://www.omerzu.de/horde.php besides a few more articles to that issue.

It seems there are solutions for managing two or more email adresses especially to be proper synced. The challenge is to do this in the SME way. Means - how can this be templated? Any help is appreciated.

stefan


There was a bug a while back when using homeEmail and workEmail that had something to do with search or sync.  I don't know if it got fixed, but you can test things out by editing /home/httpd/html/horde/turba/config/backends.php and removing the // from the two lines starting around line 317.  Note that those changes will be lost is you do s post-upgrade and reboot.  If you want them to permanently be there for extended testing, create a custom-template directory and copy the contents of /etc/e-smith/templates/home/httpd/html/horde/turba/config/backends.local.php/40LocalSQL and remove the above mentioned comments.

You can already save an email address with multiple addresses.  In the address book under communications/email, separate your email addresses by a comma (,).  Those sync to my phone (Galaxy S6).

John
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #34 on: January 11, 2017, 10:14:49 AM »
Hi John,

I removed the two slashes and /home/httpd/html/horde/turba/config/backends.php looks like this now:

<?php
/**
 * This file is where you specify the sources of contacts available to users
 * at your installation. It contains a large number of EXAMPLES. Please
 * remove or comment out those examples that YOU DON'T NEED. There are a
 * number of properties that you can set for each server, including:
 *
 * IMPORTANT: DO NOT EDIT THIS FILE!
 * Local overrides MUST be placed in backends.local.php or backends.d/.
 * If the 'vhosts' setting has been enabled in Horde's configuration, you can
 * use backends-servername.php.
 *
 * Example backends.local.php configuration file that enables the LDAP address
 * book and adds a composite field to the SQL address book:
 *
 * <?php
 * $cfgSources['localldap']['disabled'] = false;
 * $cfgSources['localldap']['params']['server'] = 'localhost';
 * $cfgSources['localldap']['params']['root'] = 'cn=contacts,dc=horde,dc=org';
 * $cfgSources['localldap']['params']['bind_dn'] = 'cn=admin,ou=users,dc=horde,dc=org';
 * $cfgSources['localldap']['params']['bind_password'] = 'somesecret';
 * $cfgSources['localsql']['map']['homeAddress'] = array(
 *     'fields' => array(
 *         'homeStreet',
 *         'homePostalCode',
 *         'homeCity',
 *         'homeCountry'
 *     ),
 *     'format' => "%s\n%s %s\n%s"
 * );
 *
 * Properties that can be set for each server:
 *
 * disabled: (boolean) If true, the config entry is disabled.
 *
 * title: (string) This is the common (user-visible) name that you want
 *        displayed in the contact source drop-down box.
 *
 * type: (string) The types 'ldap', 'sql', 'kolab', 'imsp', 'group',
 *       'favourites' and 'prefs' are currently supported. Kolab address books
 *       can be used with any IMAP server that supports METADATA.
 *       Preferences-based address books are not intended for production
 *       installs unless you really know what you're doing - they are not
 *       searchable, and they won't scale well if a user has a large number of
 *       entries.
 *
 * params: (array) These are the connection parameters specific to the contact
 *         source.
 *
 *         General settings:
 *           - charset: (string) The character set that the backend stores
 *                      data in. Many LDAP servers use utf-8. Database servers
 *                      typically use iso-8859-1.
 *           - filter: (string) Filter your result based on certain condition
 *                     in SQL and LDAP backends. A filter can be specified to
 *                     avoid some unwanted data. For example, if the source is
 *                     an external SQL database, to select records with the
 *                     delete flag = 0: 'filter' => 'deleted=0'.
 *                     Don't enclose 'filter' in brackets - this will done
 *                     automatically. Also keep in mind that a full filter
 *                     line will be built from 'filter' and 'objectclass'
 *                     parameters.
 *
 *         Settings that only apply to LDAP servers:
 *           - bind_dn: (string) Only applies to LDAP servers which do not
 *                      allow anonymous connections. Active Directory servers
 *                      do not allow it by default, so before using one as a
 *                      Turba source, you must create a "rightless" user,
 *                      which is only allowed to connect to the server, and
 *                      set the 'bind_dn' parameter like
 *                      'rightless@example.com' (not
 *                      'cn=rightless,dc=example,dc=com').
 *           - bind_password: (string) Only applies to LDAP servers which do
 *                            not allow anonymous connection. You should set
 *                            this to the cleartext password for the user
 *                            specified in 'bind_dn'.
 *           - checkrequired: (boolean) If true, consult the LDAP schema for
 *                            any attributes that are required by the given
 *                            objectclass(es). Required attributes will be
 *                            provided automatically if the
 *                            'checkrequired_string' parameter is present.
 *           - checksyntax: (boolean) If present, inspect the LDAP schema for
 *                          particular attributes by the type defined in the
 *                          corresponding schema.
 *           - deref: (integer) One of:
 *                      - LDAP_DEREF_NEVER
 *                      - LDAP_DEREF_SEARCHING
 *                      - LDAP_DEREF_FINDING
 *                      - LDAP_DEREF_ALWAYS
 *                     This setting tells the LDAP server when to dereference
 *                     aliases. See http://www.php.net/ldap for more
 *                     information.
 *           - dn: (array) Defines the list of LDAP attributes that build a
 *                 valid DN.
 *           - objectclass: (array) Defines a list of objectclasses that
 *                          contacts must belong to, and that new objects will
 *                          be created with.
 *           - referrals: (integer) Either 0 or 1. See the LDAP documentation
 *                        about the corresponding parameter REFERRALS. Windows
 *                        2003 Server requires that you set this parameter to
 *                        0.
 *           - root: (string) Defines the base DN where to start the search
 *                   (i.e. dc=example,dc=com).
 *           - scope: (string) Can be set to 'one' to search one level of the
 *                    LDAP directory, or 'sub' to search all levels. 'one'
 *                    will work for most setups and should be much faster.
 *                    However we default to 'sub' for backwards compatibility.
 *           - sizelimit: (integer) Limit the search to this number of
 *                        entries. Empty value or 0 means no limit. Keep in
 *                        mind that servers can impose their own search
 *                        limits.
 *           - tls: (boolean) If true, try to use a TLS connection to the
 *                  server.
 *           - version: (integer) Specifies LDAP server version: either 2 or
 *                      3. Active Directory servers require version 3.
 *
 * map: (array) A list of mappings from the Turba attribute names (keys) to
 *              the attribute names by which they are known in this contact
 *              source (values).
 *
 *              Turba also supports composite fields. A composite field is
 *              defined by mapping the field name to an array containing a
 *              list of component fields and a format string (similar to a
 *              printf() format string; however, note that positioned
 *              parameters like %1$s will NOT work).
 *
 *              'attribute' defines where the composed value is saved, and is
 *              optional.
 *
 *              'parse' defines a list of format strings and field names that
 *              should be used for splitting up composite fields, in the order
 *              of precedence, and is optional.
 *
 *              An example:
 *                ...
 *                'name' => array(
 *                    'fields' => array('firstname', 'lastname'),
 *                    'format' => '%s %s',
 *                    'attribute' => 'object_name'
 *                ),
 *                'firstname' => 'object_firstname',
 *                'lastname' => 'object_lastname',
 *                ...
 *
 *              Standard Turba attributes are:
 *                - __key: [REQUIRED] A backend-specific ID for the entry (any
 *                         value as long as it is unique inside that source).
 *                - __members: Serialized PHP array with list of Group
 *                             members.
 *                - __owner: User name of the contact's owner
 *                - __type: Either 'Object' or 'Group'
 *                - __uid: Globally unique ID of the entry (used for
 *                         synchronizing and must be able to be set to any
 *                         value).
 *
 *              More Turba attributes are defined in config/attributes.php.
 *
 * tabs: (array) All fields can be grouped into tabs with this optional entry.
 *       This list is multidimensional hash; keys are the tab titles.
 *
 *       Example:
 *         'tabs' => array(
 *             'Addresses' => array(
 *                 'homeAddress',
 *                 'workAddress'
 *             ),
 *             'Names' => array(
 *                 'firstname',
 *                 'lastname',
 *                 'alias'
 *             )
 *         );
 *
 * search: (array) A list of Turba attribute names that can be searched for
 *         this source.
 *
 * strict: (array) A list of native field/attribute names that must always be
 *              matched exactly in a search.
 *
 * approximate: (array) Only applies to LDAP servers. If set, should be an
 *              array of native field/attribute names to search
 *              "approximately" (for example, "Sánchez", "Sanchez", and
 *              "Sanchéz" will all match a search string of "sanchez").
 *
 * export: (boolean) If true, this source will appear on the Export menu,
 *         allowing users to export the contacts to a CSV (etc.) file.
 *
 * browse: (boolean) If true, this source will be browseable via the Browse
 *         menu item, and empty searches against the source will return all
 *         contacts.
 *
 * use_shares: (boolean) If true, Horde_Share functionality will be enabled
 *             for this source - allowing users to share their personal
 *             address books as well as to create new ones.
 *
 *             Since Turba only supports having one backend configured for
 *             creating new shares, use the 'shares' configuration option to
 *             specify which backend will be used for creating new shares.  All
 *             permission checking will be done against Horde_Share, but note
 *             that any 'extended' permissions (such as max_contacts) will
 *             still be enforced. Also note that the backend driver must have
 *             support for using this. Supported: SQL, IMAP/Kolab, and IMSP.
 *
 * all_shares: (boolean) If true (and 'use_shares' is true) the corresponding
 *             source will be assumed to handle all shares that are not
 *             explicitly assigned to another source. Supported: IMAP/Kolab.
 *
 * list_name_field: (string) Taken as the field to store contact list names
 *                  in. This is required when using a composite field as the
 *                  'name' field.
 *
 * alternative_name: (string) Taken as the field to use an alternative in case
 *                   the name field is empty.
 */

/**
 * A local address book in an SQL database. This implements a private
 * per-user address book. Sharing of this source with other users may be
 * accomplished by enabling Horde_Share for this source by setting
 * 'use_shares' => true.
 *
 * Be sure to create a turba_objects table in your Horde database from the
 * schema in turba/scripts/db/turba.sql if you use this source.
 */
$cfgSources['localsql'] = array(
    // ENABLED by default
    'disabled' => false,
    'title' => _("Shared Address Books"),
    'type' => 'sql',
    'params' => array(
        // The default connection details are pulled from the Horde-wide SQL
        // connection configuration.
        // To use another DB connection, you must provide configuration
        // information here - for example,
        //'sql' => array(
        //    'persistent' => false,
        //    'username' => 'horde',
        //    'password' => 'secret',
        //    'socket' => '/var/run/mysqld/mysqld.sock',
        //    'protocol' => 'unix',
        //    'database' => 'horde',
        //    'charset' => 'utf-8',
        //    'ssl' => false,
        //    'splitread' => false,
        //    'phptype' => 'mysql'
        //),
        'table' => 'turba_objects'
    ),
    'map' => array(
        '__key' => 'object_id',
        '__owner' => 'owner_id',
        '__type' => 'object_type',
        '__members' => 'object_members',
        '__uid' => 'object_uid',
        'firstname' => 'object_firstname',
        'lastname' => 'object_lastname',
        'middlenames' => 'object_middlenames',
        'namePrefix' => 'object_nameprefix',
        'nameSuffix' => 'object_namesuffix',
        'name' => array('fields' => array('namePrefix', 'firstname',
                                          'middlenames', 'lastname',
                                          'nameSuffix'),
                        'format' => '%s %s %s %s %s',
                        'parse' => array(
                            array('fields' => array('firstname', 'middlenames',
                                                    'lastname'),
                                  'format' => '%s %s %s'),
                            array('fields' => array('firstname', 'lastname'),
                                  'format' => '%s %s'))),
        // This is a shorter version of a "name" composite field which only
        // consists of the first name and last name.
        // 'name' => array('fields' => array('firstname', 'lastname'),
        //                 'format' => '%s %s'),
        'alias' => 'object_alias',
        'yomifirstname' => 'object_yomifirstname',
        'yomilastname' => 'object_yomilastname',
        'birthday' => 'object_bday',
        'anniversary' => 'object_anniversary',
        'spouse' => 'object_spouse',
        'photo' => 'object_photo',
        'phototype' => 'object_phototype',
        'homeStreet' => 'object_homestreet',
        'homePOBox' => 'object_homepob',
        'homeCity' => 'object_homecity',
        'homeProvince' => 'object_homeprovince',
        'homePostalCode' => 'object_homepostalcode',
        'homeCountry' => 'object_homecountry',
        'homeAddress' => array('fields' => array('homeStreet', 'homeCity',
                                                 'homeProvince',
                                                 'homePostalCode'),
                               'format' => "%s\n%s, %s  %s"),
        'workStreet' => 'object_workstreet',
        'workPOBox' => 'object_workpob',
        'workCity' => 'object_workcity',
        'workProvince' => 'object_workprovince',
        'workPostalCode' => 'object_workpostalcode',
        'workCountry' => 'object_workcountry',
        'workAddress' => array('fields' => array('workStreet', 'workCity',
                                                 'workProvince',
                                                 'workPostalCode'),
                               'format' => "%s\n%s, %s  %s"),
        'otherStreet' => 'object_otherstreet',
        'otherPOBox' => 'object_otherpob',
        'otherCity' => 'object_othercity',
        'otherProvince' => 'object_otherprovince',
        'otherPostalCode' => 'object_otherpostalcode',
        'otherCountry' => 'object_othercountry',
        'otherAddress' => array('fields' => array('otherStreet', 'otherCity',
                                                  'otherProvince',
                                                  'otherPostalCode'),
                                'format' => "%s\n%s, %s  %s"),
        'department' => 'object_department',
        'manager' => 'object_manager',
        'assistant' => 'object_assistant',
        'timezone' => 'object_tz',
        'email' => 'object_email',
        'homeEmail' => 'object_homeemail',
        'workEmail' => 'object_workemail',
        'homePhone' => 'object_homephone',
        'homePhone2' => 'object_homephone2',

--snip

I created a custom-template directory in:

/etc/e-smith/templates-custom/home/httpd/horde/turba/config/backends.local.php

Next step would be:
Quote
copy the contents of /etc/e-smith/templates/home/httpd/html/horde/turba/config/backends.local.php/40LocalSQL and remove the above mentioned comments.

BUT my 40LocalSQL looks like this:

//40LocalSQL
{
    my $sab = ($horde{SharedAddressBooks} || 'enabled') eq 'disabled' ? 'false' : 'true';
    $OUT = "\$cfgSources['localsql']['use_shares'] = $sab;"                                             
}

$cfgSources['localsql']['map']['children'] = 'object_children';
$cfgSources['localsql']['map']['emails'] = 'object_email';

$cfgSources['localsql']['tabs'] = array(
     _("Personal") => array('firstname', 'lastname', 'middlenames',
                            'namePrefix', 'nameSuffix', 'name', 'alias',
                            'birthday', 'spouse', 'anniversary', 'children',
                            'yomifirstname', 'yomilastname', 'photo'),   
     _("Location") => array('homeStreet', 'homePOBox', 'homeCity',
                            'homeProvince', 'homePostalCode', 'homeCountry',
                            'homeAddress', 'workStreet', 'workPOBox',
                            'workCity', 'workProvince', 'workPostalCode',
                            'workCountry', 'workAddress', 'otherStreet',
                            'otherPOBox', 'otherCity', 'otherProvince',
                            'otherPostalCode', 'otherCountry',
                            'otherAddress','timezone'),
     _("Communications") => array('emails', 'homeEmail', 'workEmail',
                                  'homePhone', 'homePhone2',
                                  'workPhone', 'workPhone2', 'carPhone',
                                  'radioPhone', 'companyPhone',
                                  'assistPhone', 'homeFax',
                                  'cellPhone', 'fax', 'pager', 'imaddress',
                                  'imaddress2', 'imaddress3'),
     _("Organization") => array('title', 'role', 'company', 'department', 'logo', 'assistant', 'manager'),
     _("Other") => array('notes', 'website', 'freebusyUrl',
                         'pgpPublicKey', 'smimePublicKey'),
);

In other words - no slashes to remove. What should I do?

I'm facing another problem. While doing a pear ua today (slashes are removed as above mentioned) I am told in the horde admin configuration to perform an update of the horde configuration. I'm not able to do this as admin in the webinterface. Horde tells me it has to be done manually.

How can I solve this?

Thank's for any help,
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 #35 on: January 11, 2017, 10:27:57 AM »
Horde shows the differences between the new and the old configuration:

<?php
/*
#------------------------------------------------------------
#          !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
*/


//100ConfHordePHP
/* CONFIG START. DO NOT CHANGE ANYTHING IN OR AFTER THIS LINE. */
// $Id: ---78acbab5980b3b1531db0732c3611a17deae7c83 $
$conf['vhosts'] = false;
$conf['debug_level'] = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
$conf['max_exec_time'] = 0;
$conf['compress_pages'] = true;
$conf['secret_key'] = 'xxx'; 
$conf['umask'] = 077;
$conf['testdisable'] = true;
$conf['use_ssl'] = 2;
$conf['server']['name'] = $_SERVER['SERVER_NAME'];
$conf['urls']['token_lifetime'] = 30;
$conf['urls']['hmac_lifetime'] = 30;
$conf['urls']['pretty'] = false;
$conf['safe_ips'] = array();
$conf['session']['name'] = 'Horde';
$conf['session']['use_only_cookies'] = true;
$conf['session']['timeout'] = 0;
$conf['session']['cache_limiter'] = 'nocache';
$conf['session']['max_time'] = 0;
$conf['cookie']['domain'] = $_SERVER['SERVER_NAME'];
$conf['cookie']['path'] = '/horde';
$conf['sql']['username'] = 'horde';
$conf['sql']['password'] = 'xxx';
$conf['sql']['socket'] = '/var/lib/mysql/mysql.sock';
$conf['sql']['protocol'] = 'unix';
$conf['sql']['database'] = 'horde';
$conf['sql']['charset'] = 'latin1';
$conf['sql']['ssl'] = false;
$conf['sql']['splitread'] = false;
$conf['sql']['phptype'] = 'mysqli';
$conf['nosql']['phptype'] = false;
$conf['ldap']['useldap'] = false;

$conf['auth']['admins']$conf['auth']['admins'] = array('admin@xxx.local', );'admin@xxx.de');
$conf['auth']['checkip'] = true;
$conf['auth']['checkbrowser'] = true;
$conf['auth']['resetpassword'] = false;
$conf['auth']['alternate_login'] = false;
$conf['auth']['redirect_on_logout'] = false;
$conf['auth']['list_users'] = 'list';
$conf['auth']['params']['app'] = 'imp';
$conf['auth']['driver'] = 'application';

$conf['auth']['params']['count_bad_logins'] = true;
$conf['auth']['params']['login_block'] = true;
$conf['auth']['params']['login_block_count'] = 5;
$conf['auth']['params']['login_block_time'] = 5;
$conf['signup']['allow'] = false;
$conf['log']['priority'] = 'NOTICE';
$conf['log']['ident'] = 'HORDE';
$conf['log']['name'] = LOG_USER;
$conf['log']['type'] = 'syslog';
$conf['log']['enabled'] = true;
$conf['log_accesskeys'] = false;
$conf['prefs']['maxsize'] = 65535;
$conf['prefs']['params']['table'] = 'horde_prefs';
$conf['prefs']['params']['driverconfig'] = 'horde';
$conf['prefs']['driver'] = 'Sql';
$conf['alarms']['params']['table'] = 'horde_alarms';
$conf['alarms']['params']['driverconfig'] = 'horde';
$conf['alarms']['params']['ttl'] = 300;
$conf['alarms']['driver'] = 'Sql';
$conf['group']['params']['driverconfig'] = 'horde';
$conf['group']['driver'] = 'Sql';
$conf['perms']['driverconfig'] = 'horde';
$conf['perms']['driver'] = 'Sql';
$conf['share']['no_sharing'] = false;
$conf['share']['auto_create'] = true;
$conf['share']['world'] = true;
$conf['share']['any_group'] = true;
$conf['share']['hidden'] = false;
$conf['share']['cache'] = false;
$conf['share']['driver'] = 'Sql';
$conf['cache']['default_lifetime'] = 1800;
$conf['cache']['params']['dir'] = '/tmp/';
$conf['cache']['params']['sub'] = 0;
$conf['cache']['driver'] = 'File';
$conf['cache']['use_memorycache'] = '';
$conf['cachecssparams']['url_version_param'] = true;
$conf['cachecss'] = false;
$conf['cachejsparams']['url_version_param'] = true;
$conf['cachejs'] = false;
$conf['cachethemes'] = false;

$conf['lock']['driver'] = 'Null';
$conf['token']['driver'] = 'Null';
$conf['history']['params']['driverconfig'] = 'horde';
$conf['history']['driver'] = 'Sql';
$conf['davstorage']['params']['driverconfig'] = 'horde';
$conf['davstorage']['driver'] = 'Sql';
$conf['mailer']['params']['secure'] = 'tls';
$conf['mailer']['params']['auth'] = false;
$conf['mailer']['params']['lmtp'] = false;
$conf['mailer']['type'] = 'smtp';
$conf['vfs']['params']['vfsroot'] = '/tmp';
$conf['vfs']['type'] = 'File';
$conf['sessionhandler']['type'] = 'Builtin';
$conf['sessionhandler']['hashtable'] = false;
$conf['spell']['params']['path'] = '/usr/bin/hunspell';
$conf['spell']['driver'] = 'aspell';
$conf['gnupg']['path'] = '/usr/bin/gpg';
$conf['gnupg']['keyserver'] = array('pool.sks-keyservers.net', 'subkeys.pgp.net', 'pgp.mit.edu');
$conf['gnupg']['timeout'] = 10;
$conf['openssl']['cafile'] = '/home/e-smith/ssl.crt/xxx.xxx.local.crt';
$conf['openssl']['path'] = '/usr/bin/openssl';
$conf['nobase64_img'] = false;
$conf['image']['convert'] = '/usr/bin/convert';
$conf['image']['identify'] = '/usr/bin/identify';
$conf['image']['driver'] = 'Im';
$conf['exif']['driver'] = 'Bundled';
$conf['mime']['magic_db'] = '/usr/share/magic';
$conf['timezone']['location'] = 'ftp://ftp.iana.org/tz/tzdata-latest.tar.gz';
$conf['problems']['email'] = 'admin@ivb.local';
$conf['problems']['maildomain'] = 'ivb.local';
$conf['problems']['tickets'] = false;
$conf['problems']['attachments'] = false;
$conf['menu']['links']['help'] = 'authenticated';
$conf['menu']['links']['prefs'] = 'authenticated';
$conf['menu']['links']['problem'] = 'never';
$conf['menu']['links']['login'] = 'all';
$conf['menu']['links']['logout'] = 'authenticated';
$conf['portal']['fixed_blocks'] = array();
$conf['accounts']['params']['quota_path'] = '/usr/bin/quota';
$conf['accounts']['params']['grep_path'] = '/bin/grep';
$conf['accounts']['params']['translateMountPoint'] = false;
$conf['accounts']['params']['translationTable'] = '/etc/mtab';
$conf['accounts']['driver'] = 'localhost';
$conf['user']['verify_from_addr'] = true;
$conf['user']['select_view'] = true;
$conf['facebook']['enabled'] = false;
$conf['twitter']['enabled'] = false;
$conf['urlshortener'] = false;
$conf['weather']['provider'] = false;
$conf['imap']['enabled'] = false;
$conf['imsp']['enabled'] = false;
$conf['kolab']['enabled'] = false;
$conf['hashtable']['driver'] = 'none';
$conf['activesync']['params']['driverconfig'] = 'horde';
$conf['activesync']['storage'] = 'Sql';
$conf['activesync']['emailsync'] = true;
$conf['activesync']['version'] = '14.1';
$conf['activesync']['auth']['type'] = 'basic';
$conf['activesync']['autodiscovery'] = 'user';
$conf['activesync']['outlookdiscovery'] = false;
$conf['activesync']['logging']['type'] = false;
$conf['activesync']['ping']['heartbeatmin'] = 60;
$conf['activesync']['ping']['heartbeatmax'] = 2700;
$conf['activesync']['ping']['heartbeatdefault'] = 480;
$conf['activesync']['ping']['deviceping'] = true;
$conf['activesync']['ping']['waitinterval'] = 5;
$conf['activesync']['enabled'] = true;

$conf['activesync']['logging']['type'] = false;


//500ConfHordePHP custom template
$conf['auth']['admins'] = array('admin@xxx.local', 'admin@xxx.de', );
//999Footer
/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */
?>

As far as I can see, these are the modifications I made earlier in this thread. I'll do a signal-event post-upgrade and will report.

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 #36 on: January 11, 2017, 10:46:21 AM »
Update

After/while rebooting the server /var/log/messages shows:

Jan 11 10:32:24 saturn mysql.init: waiting for mysqld to restart
Jan 11 10:32:24 saturn HORDE: [horde] PHP ERROR: mysqli::mysqli() [<a href='mysqli.mysqli'>mysqli.mysqli</a>]: (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [pid 2479 on line 130 of "/usr/share/pear/Horde/Db/Adapter/Mysqli.php"]
Jan 11 10:32:24 saturn HORDE: [horde] Connect failed: (2002) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) [pid 2479 on line 133 of "/usr/share/pear/Horde/Db/Adapter/Mysqli.php"]
Jan 11 10:32:25 saturn mysql.init: waiting for mysqld to restart

Horde is up and running. Everything seems to work.

In the admin configuration is still the advise to upgrade manually.

Even after signal-event post-upgrade and not templating the removed slashes, the slashes have not been overwritten - they're still removed and the two extra email-fields are in the adressbook.
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 #37 on: January 12, 2017, 06:38:33 AM »
To me, it looks like you were trying to access horde after a reboot, but before mysqld had fully started.

Your edit was to the backends.php file, which will be overwritten when a new major version is released.  That is why you should use backends.local.php.
Finally, I didn't tell you the correct thing you need to do with the custom-template of 40LocalSQL


You need to add the below to that file.  I added these lines after the object_email.


$cfgSources['localsql']['map']['homeEmail'] = 'object_homeemail';
$cfgSources['localsql']['map']['workEmail'] = 'object_workemail';


None of the x.local.php files won't be overwritten on a major version release.


The update of the horde configuration is a cosmetic one.  They added something relevant to the conf.php file, so the ID number no longer matches.  I'll get around to fixing that sometime soon.  It doesn't stop the use of horde.


John

......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #38 on: January 12, 2017, 10:48:16 AM »
John,

thank you for your reply.

Quote
To me, it looks like you were trying to access horde after a reboot, but before mysqld had fully started.

I agree, that's making sense to me.

Quote
You need to add the below to that file.  I added these lines after the object_email.


$cfgSources['localsql']['map']['homeEmail'] = 'object_homeemail';
$cfgSources['localsql']['map']['workEmail'] = 'object_workemail';

O.k., now the template in /etc/e-smith/templates-custom/home/httpd/html/horde/turba/config/backends.local.php looks like this:

//40LocalSQL
{
    my $sab = ($horde{SharedAddressBooks} || 'enabled') eq 'disabled' ? 'false' : 'true';
    $OUT = "\$cfgSources['localsql']['use_shares'] = $sab;"                                             
}

$cfgSources['localsql']['map']['children'] = 'object_children';
$cfgSources['localsql']['map']['emails'] = 'object_email';
$cfgSources['localsql']['map']['homeEmail'] = 'object_homeemail';
$cfgSources['localsql']['map']['workEmail'] = 'object_workemail';

$cfgSources['localsql']['tabs'] = array(
     _("Personal") => array('firstname', 'lastname', 'middlenames',
                            'namePrefix', 'nameSuffix', 'name', 'alias',
                            'birthday', 'spouse', 'anniversary', 'children',
                            'yomifirstname', 'yomilastname', 'photo'),   
     _("Location") => array('homeStreet', 'homePOBox', 'homeCity',
                            'homeProvince', 'homePostalCode', 'homeCountry',
                            'homeAddress', 'workStreet', 'workPOBox',
                            'workCity', 'workProvince', 'workPostalCode',
                            'workCountry', 'workAddress', 'otherStreet',
                            'otherPOBox', 'otherCity', 'otherProvince',
                            'otherPostalCode', 'otherCountry',
                            'otherAddress','timezone'),
     _("Communications") => array('emails', 'homeEmail', 'workEmail',
                                  'homePhone', 'homePhone2',
                                  'workPhone', 'workPhone2', 'carPhone',
                                  'radioPhone', 'companyPhone',
                                  'assistPhone', 'homeFax',
                                  'cellPhone', 'fax', 'pager', 'imaddress',
                                  'imaddress2', 'imaddress3'),
     _("Organization") => array('title', 'role', 'company', 'department', 'logo', 'assistant', 'manager'),
     _("Other") => array('notes', 'website', 'freebusyUrl',
                         'pgpPublicKey', 'smimePublicKey'),
);

While doing a expand-template /home/httpd/html/horde/turba/config/backends.local.php

the file /home/httpd/html/horde/turba/config/backends.local.php looks like this:

<?php
/*
#------------------------------------------------------------
#          !!DO NOT MODIFY THIS FILE!!
#
# Manual changes will be lost when this file is regenerated.
#
# Please read the developer's guide, which is available
# at http://www.contribs.org/development/
#
# Copyright (C) 1999-2006 Mitel Networks Corporation
#------------------------------------------------------------
*/


//40LocalSQL
$cfgSources['localsql']['use_shares'] = true;

$cfgSources['localsql']['map']['children'] = 'object_children';
$cfgSources['localsql']['map']['emails'] = 'object_email';
$cfgSources['localsql']['map']['homeEmail'] = 'object_homeemail';
$cfgSources['localsql']['map']['workEmail'] = 'object_workemail';

$cfgSources['localsql']['tabs'] = array(
     _("Personal") => array('firstname', 'lastname', 'middlenames',
                            'namePrefix', 'nameSuffix', 'name', 'alias',
                            'birthday', 'spouse', 'anniversary', 'children',
                            'yomifirstname', 'yomilastname', 'photo'),   
     _("Location") => array('homeStreet', 'homePOBox', 'homeCity',
                            'homeProvince', 'homePostalCode', 'homeCountry',
                            'homeAddress', 'workStreet', 'workPOBox',
                            'workCity', 'workProvince', 'workPostalCode',
                            'workCountry', 'workAddress', 'otherStreet',
                            'otherPOBox', 'otherCity', 'otherProvince',
                            'otherPostalCode', 'otherCountry',
                            'otherAddress','timezone'),
     _("Communications") => array('emails', 'homeEmail', 'workEmail',
                                  'homePhone', 'homePhone2',
                                  'workPhone', 'workPhone2', 'carPhone',
                                  'radioPhone', 'companyPhone',
                                  'assistPhone', 'homeFax',
                                  'cellPhone', 'fax', 'pager', 'imaddress',
                                  'imaddress2', 'imaddress3'),
     _("Organization") => array('title', 'role', 'company', 'department', 'logo', 'assistant', 'manager'),
     _("Other") => array('notes', 'website', 'freebusyUrl',
                         'pgpPublicKey', 'smimePublicKey'),
);

//50LocalLDAP
/**
 * A local address book in an LDAP directory. This implements a public
 * (shared) address book.
 *
 * To store distribution lists in the LDAP directory, you'll need to include
 * horde.schema from Horde in your LDAP configuration.
 *
 * To store freebusy information in the LDAP directory, you'll need to include
 * rfc2739.schema from Horde in your LDAP configuration.
 */
$cfgSources['localldap'] = array(
    // Disabled by default
    'disabled' => false,
    'title' => _("Local LDAP Users Address Book"),
    'type' => 'ldap',
    'params' => array(
        'server' => 'localhost',
        'port' => 389,
        'tls' => false,
         'root' => 'dc=xxx,dc=local',
//         'bind_dn' => 'cn=admin,ou=users,dc=example,dc=com',
//         // For Active Directory:   
//         // 'bind_dn' => 'username@example.com',
//         'bind_password' => '********',
         'sizelimit' => 200,
//         // For Active Directory: 
//         // 'sizelimit' => 0,
         'dn' => array('cn'),
         'objectclass' => array('top',
                                'person',
                                'organizationalPerson',
                                'inetOrgPerson',
                                'calEntry'),

                                // Add 'turbaContact' to this array if using
                                // 'turbaType' attribute below, and 'calEntry'
                                // if using 'freebusyUrl'.
           // For Active Directory:
           // 'objectclass' => array('organizationalPerson',
           //                        'user',
           //                        'group',
           //                        'contact'),
         'scope' => 'sub',
           // For Active Directory:
           // 'scope' => 'sub',
         'charset' => 'UTF-8',
           // Consult the LDAP schema to verify that all required attributes for
           // an entry are set and add them if needed.
         'checkrequired' => false,
           // Value used to fill in missing required attributes.
         'checkrequired_string' => ' ',
           // Check LDAP schema for valid syntax. If this is false an address
           // field is assumed to have postalAddress syntax; otherwise the schema
           // is consulted for the syntax to use.
           'checksyntax' => false,
         'version' => 3,
         'filter' => '&(objectClass=inetOrgPerson)(!(mail=admin@xxx.local))',

         // For Active Directory you probably want to also set the following
         // parameters:
         // 'deref' => LDAP_DEREF_ALWAYS,
         // 'filter' => '&(SAMAccountName=*)(mail=*)',
         // 'referrals' => 0,
     ),
     'map' => array(
         '__key' => 'dn',

         // Remove this mapping if using Active Directory server:
           '__uid' => 'uid',

         // From horde.schema.  Make sure you have 'turbaContact' objectClass
         // included above:
           '__type' => 'turbaType',
           '__members' => 'turbaMembers',

         'name' => 'cn',
         'email' => 'mail',
         'homePhone' => 'homephone',
         'workPhone' => 'telephonenumber',
         'cellPhone' => 'mobiletelephonenumber',
//         'homeAddress' => 'street',    <-- this is what was used for sme7 before horde 4
         'homeAddress' => 'homepostaladdress',

         // From rfc2739.schema:
         'freebusyUrl' => 'calFBURL',       

         // For Active Directory servers:
         // 'name' => 'displayname',
         // 'title' => 'title',
         // 'cellPhone' => 'mobile',
         // 'department' => 'department',
         // 'company' => 'company',
     ),
     'search' => array(
         'name',
         'email',
         'homePhone',
         'workPhone',
         'cellPhone',
         'homeAddress'
     ),
     'strict' => array(
         'dn',
     ),
     'approximate' => array(
         'cn',
     ),
//     // For Active Directory servers:
//     // 'approximate' => array(
//     //     'displayname',
//     //     'samaccountname',
//     // ),
     'export' => true,
     'browse' => true,
);

//60LocalLDAPGroups
/**
 * A local address book in an LDAP directory. This implements a public
 * (shared) address book.
 *
 * To store distribution lists in the LDAP directory, you'll need to include
 * horde/scripts/ldap/horde.schema in your LDAP configuration.
 *
 * To store freebusy information in the LDAP directory, you'll need to include
 * turba/scripts/ldap/rfc2739.schema in your LDAP configuration.
 */
$cfgSources['localldapgroups'] = array(
     'disabled' => false,
     'title' => _("Local LDAP Groups Address Book"),
     'type' => 'ldap',
     'params' => array(
         'server' => 'localhost',
         'port' => 389,
         'tls' => false,
         'root' => 'dc=xxx,dc=local',
         'sizelimit' => 200,
         'dn' => array('cn'),
         'objectclass' => array('posixGroup'),
         'scope' => 'sub',
         'charset' => 'UTF-8',
         'checkrequired' => false,
         'checkrequired_string' => ' ',
         'version' => 3,
     ),
     'map' => array(
         '__key' => 'dn',
         '__uid' => 'uid',
         'name' => 'cn',
         'email' => 'mail',
         'groupdescription' => 'description',
         'groupmembers' => 'memberUid',
     ),
     'search' => array(
         'name',
         'email',
         'groupdescription',
         'groupmembers',
     ),
     'strict' => array(
         'dn',
     ),
     'approximate' => array(
         'cn',
     ),
     'export' => true,
     'browse' => true,
);

//90 Favourites
$cfgSources['favourites']['disabled'] = true;

?>

Can you confirm, that is correct now?

Quote
Your edit was to the backends.php file, which will be overwritten when a new major version is released.

That is correct:

ls /etc/e-smith/templates-custom/home/httpd/html/horde/config/conf.php/500admin

How can this be moved or implemented in the backends.local.php?

stefan
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 #39 on: January 12, 2017, 03:37:25 PM »
Yes, this matches what I have on my servers.


conf.php isn't over-written on major releases, so what you have should always work.  You will just need to remember that you set a custom template if you ever need to troubleshoot, or if/when we get around to looking for a permanent fix for the various domain type logins.


John
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #40 on: January 13, 2017, 09:10:02 AM »
John, thank you so far.

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 #41 on: January 18, 2017, 09:52:19 AM »
I'd like to hide the "delete" function in the context menu of imp (webmail). Clicking the right mouse-button brings up a context-menu for a user. Among several functions there is one to "delete" a folder. I want to prevent a user to delete a folder. Does anybody know where to configure this? No luck with google so far...

stefan
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 #42 on: January 20, 2017, 03:53:04 AM »
You would more than likely have to hack the code, which will then be lost on an upgrade.  You could try asking on the horde mailing list.


John
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #43 on: January 27, 2017, 06:47:27 PM »
John,

I followed your suggestion and got this back:

https://lists.horde.org/archives/imp/Week-of-Mon-20170123/057312.html

 In the Mailbox.php I commented out the "delete" function.

/* Mailbox context menu. */
$context['ctx_mbox'] = array(
'_mbox' => '',
'_sep1' => null,
'create' => _("Create subfolder"),
'rename' => _("Rename"),
'empty' => _("Empty"),
--->  /* 'delete' => _("Delete"), */  <----
'_sep2' => null,
'setflag' => _("Mark all as"),
'_sep3' => null,
'poll' => _("Check for New Mail"),
'nopoll' => _("Do Not Check for New Mail"),
'sub' => _("Subscribe"),
'unsub' => _("Unsubscribe"),
'_sep4' => null,
'search' => _("Search"),
'_sub1' => array(
'_sep5' => null,
'expand' => _("Expand All"),
'collapse' => _("Collapse All")
),
'_sep6' => null,
'export' => _("Export"),
'import' => _("Import"),
'_sep7' => null,
'size' => _("Mailbox Size"),
'_sub2' => array(
'_sep8' => null,
'acl' => _("Edit ACL")
),
);

That did the trick. Now it's a little safer for the "monday morning user"... (and for the admin too ;))

It could make sense to template this, what do you think?
stefan
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 #44 on: January 29, 2017, 11:43:27 PM »
I'm on the list, and saw your question.  I'm not inclined to template this, but you could do what Mike suggested and create a hook for that. 
You can create a custom template for hooks.php with something like the following:





<?php
/**
 * IMP Hooks configuration file.
 *
 * THE HOOKS PROVIDED IN THIS FILE ARE EXAMPLES ONLY.  DO NOT ENABLE THEM
 * BLINDLY IF YOU DO NOT KNOW WHAT YOU ARE DOING.  YOU HAVE TO CUSTOMIZE THEM
 * TO MATCH YOUR SPECIFIC NEEDS AND SYSTEM ENVIRONMENT.
 *
 * For more information please see the horde/config/hooks.php.dist file.
 *
 * $Id: a70eb0b3eb1a2dda4789ff83e249943b05f39816 $
 */


class IMP_Hooks
{


    /**
     * Alter access permissions for a mailbox.
     *
     * The better way to accomplish this is to directly manipulate the ACLs
     * on the IMAP server (admins can do this via the ACL management page in
     * IMP's preferences). However, if ACL is not available on the remote
     * server, or mailbox permissions need to be dynamically altered, this
     * hook can be used instead.
     *
     * NOTE: This hook is only called once during a user's session - the
     * results of this hook are cached within the session.
     *
     * @param IMP_Mailbox $mailbox             The mailbox.
     * @param Horde_Imap_Client_Data_Acl $acl  The mailbox ACL.
     */
    public function mbox_acl(IMP_Mailbox $mailbox,
                             Horde_Imap_Client_Data_Acl $acl)
    {
        if ($mailbox != 'zzzzz112334') {
            unset(
                $acl[Horde_Imap_Client::ACL_DELETEMBOX]
            );
        }
    }


}


I just set the mailbox name to be something very unlikely to be created, and now no mailboxes can be deleted.  Even as admin.  To delete a mailbox, you will have to do it via the CLI.  This provides the same function you want, and won't be overridden on an upgrade.


John
......

Offline SchulzStefan

  • *
  • 620
  • +0/-0
Re: Horde 5.2, activesync
« Reply #45 on: January 31, 2017, 10:18:15 PM »
Well, that was the first I tried - it didn't work for me. I ended with the "hack" in the mailbox.php. Maybe someone else could check this? Perhaps I made a mistake.
And then one day you find ten years have got behind you.

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