Horde Groupware

to get the mail address you may search for userPrincipalName

1 Like

[quote=“m.traeumner, post:24, topic:5679”]

@m.traeumner Hello
I am stuck at this stage , once I try to generate the configurations the page displays an error and cannot proceed any further.
When I reset the config.conf to its previous state I can regain access to horde configs.

  1. I have Nethserver-LDAP installed. in order to access it from my windows machine using ldapmanager gui I have to use anonymous else no way that I cant get through
    If I use the password that is in /var/lib/nethserver/secrets/ldapservice or ldapuser I get authentication error.

  2. I do not have Account provider Samba active directory installed. Nethserver-DC
    Again here if I try to install it I get an error

Resolving RPM dependencies
The install/update may have failed due to metadata caching issues. Please clean the cache by clicking the button below and retry the install/update operation.

If I clear YUM and try again the same error.

Could you please assist in overcoming this problem ?

I can’t try at this moment, I can’t reach my Test-Server, but I didn’t find the error. If I’ve found my network-error I’ll try.[quote=“ghost, post:106, topic:5679”]
The install/update may have failed due to metadata caching issues. Please clean the cache by clicking the button below and retry the install/update operation.
[/quote]

Please try to clear yum cache at the terminal

yum clean all

@m.traeumner Actually Nethserver is only accepting either one.
If I remove LDAP I can install DC and vice versa hence it is not accepting both at the same time.
Now how is Horde above instructions are referring to both ?

My instructions are for AD, for LDAP you have to change some configuration. “samaccountname” has to be replaced with “uid”. I don’t know if you have to change more, but if you want to try, I try to help you.

@m.traeumner My bad I misunderstood the instructions.

By the way I tried today the Bluemind (https://download.bluemind.net/bm-download/ ), it is an opensource however the calendar sync and activesync are for subscribers only (paid services)
It is nice, not complicated very classic in the offering. Weak when it comes to LDAP and AD.

On the other hand I suggest that you try the iRedmail ( http://www.iredmail.org/ )
It is opensource, combines SoGo and roundcube. full fledged. I failed to install on Nethserver however I was able to load it on a separate Linux machine.

I am yet to try Horde prior to comment on it as well.

Please have a look at message 7 to 12, there are infos about bluemind, @robb gets some more info from BlueMind, it’s more an all-in-one solution,
I think iredmail is a mail-server and it would be nice if we can use the postfix and dovecot which is already integrated in nethserver.

Thanks for your interest and your help.

I’d like to move this howto in the howto section and into the wiki. What do you think? We run the risk it may be lose

Only Problem I have, it’s not ready yet.I don’t have a solution for getting mail-adresses and names for the mail component from active directory

Hi Marc,
sorry for late answer, I didn’t realized your message.

Can you explain it on the basis of the hook I posted?

It is possible there were some typing errors on the searchBase of your hooks file.
Made some minor changes (surely there’s room for improvement; call to coders :wink: ):

<?php
class Horde_Hooks
{
    public function prefs_init($pref, $value, $username, $scope_ob)
    {
        // LDAP connection parameters
        $ldapServer = '192.168.x.x'; //Adress of Samba Container
        $ldapPort = 389;
        $searchBase = 'cn=users,dc=MyDomain,dc=de';
        $binddn = 'MyBindDN';
        $bindpw = 'MyBindPW';

        switch ($pref)  {

            case 'from_addr':

                if (is_null($username)) {
                    return $value;
                }

                $ds = @ldap_connect($ldapServer, $ldapPort);

                if (@ldap_bind($ds, $binddn, $bindpw)) {
                    $searchResult = @ldap_search($ds, $searchBase, 'samaccountname=' . $username);
                    $information = @ldap_get_entries($ds, $searchResult);
                    if (($information === false) || ($information['count'] == 0)) {
                        $user = $username . '@mydomain.de';
                    } else {
                        $user = ($information[0]['userprincipalname'][0] != '')
                        ? $information[0]['userprincipalname'][0]
                        : $information[0]['mail'][0];
                    }
                }

                ldap_close($ds);
                return empty($user) ? $username : $user;


            case 'fullname':

                if (is_null($username)) {
                    return $value;
                }
                $ds = @ldap_connect($ldapServer, $ldapPort);

                if (@ldap_bind($ds, $binddn, $bindpw)) {
                    $searchResult = @ldap_search($ds, $searchBase, 'samaccountname=' . $username);
                    $information = @ldap_get_entries($ds, $searchResult);
                    if (($information === false) || ($information['count'] == 0)) {
                        $name = '';
                    } else {
                        $name = ($information[0]['displayname'][0] != '')
                        ? $information[0]['displayname'][0]
                        : $information[0]['givenname'][0];
                    }
                }

                ldap_close($ds);
                return empty($name) ? $username : $name;
        }
    }
}

Hi Marc,
thanks for your reply.
I edited my hook that it’s the same like yours, except LDAP connection parameters.
It’s the same issue, name field and mail-adress contain only the username.

The email hook is working on my setup (with all users but administrator), the fullname not so sure.

Prior to the hooks file, I’ve created the /usr/share/horde/config/prefs.local.php file:

<?php
 $_prefs['from_addr']['hook'] = true;
 $_prefs['fullname']['hook'] = true;

Hi Marc,
it doesn’t work for me. If I do so I haven’t any input to mailadress.
My prefs.local.php looks like this:

<?php
// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['from_addr'] =  array(
    'locked' => 'false',
    'value' => '',
    'hook' => 'true',
    'type' => 'text',
    'desc' =>  _("The default e-mail address to use with this identity:")
);

With this I get only the username

Please, let me know when it’s ready so we can share it with the whole community

@alefattorini Of course I’ll do so.

@dnutan After I deleted my hook file and copyed your one and changed my prefs file to the following, mail adress works.

// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['fullname'] = array(
    'locked' => 'false',
    'value' => '',
    'hook' => 'true',
    'type' => 'text',
    'desc' => _("Your full name:")
);


// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['from_addr'] =  array(
    'locked' => 'false',
    'value' => '',
    'hook' => 'true',
    'type' => 'text',
    'desc' =>  _("The default e-mail address to use with this identity:")
);

For the givenname I tried this hook, but it doesn’t work

            case 'fullname':

                if (is_null($username)) {
                    return $value;
                }
                $ds = @ldap_connect($ldapServer, $ldapPort);

                if (@ldap_bind($ds, $binddn, $bindpw)) {
                    $searchResult = @ldap_search($ds, $searchBase, 'samaccountname=' . $username);
                    $information = @ldap_get_entries($ds, $searchResult);
                    if (($information === false) || ($information['count'] == 0)) {
                        $name = '';
                    } else {
                        $name = ($information[0]['displayName'][0] != '')
                        ? $information[0]['displayName'][0]
                        : $information[0]['cn'][0];
                    }
                }

                ldap_close($ds);
                return empty($name) ? $username : $name;

I tried with givenName instead of displayName too, same result only the username.
For example: mmustermann instead of Max Mustermann is filled in the fully name field.

If somebody has an idea? Thanks in advance.

It works with displayname. Just edited the code above.

2 Likes

Hi Marc,
thanks for your help, it works now.
I looked for the field I have to use at phpLDAPadmin, there it’s displayName with a big “N”, that doesn’t work, also I used cn instead of givenname.

@alefattorini I will update my howto next days.

Yes you are right, I’ll have a look at it

Edit: It has to be member not memberuid at

$conf[group][params][memberuid]

After changing this it works for me.

The new howto is at

Thanks for your help and interest.

2 Likes