Koozali.org: home of the SME Server

Horde 5.2, activesync

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