NS8 - Roundcube: e-mail address autocompletion not working

Hi Dnutan
the Roundcube is running but i have new issue when i compose a new mail and write in the field of receiver when i type the first character from his name there is no Suggestions for existing users to choose it how can i solve it?

Any contact on the address book?

yes any contact?

Address Book Autocompletion

While typing a recipient address, the app continuously searched your address book and suggests matching entries right below the input field. Use the cursor keys (up/down) on the keyboard to select one and then hit or to copy the highlighted address into the recipient field.

Don’t know if LDAP as source for address book is enable in config file or not

1 Like

It should be there as stated in the docs but I couldn’t find it. @stephdl do you have an idea?

I was able to add an LDAP addressbook (copy/pasted from NS7) by creating a new config file:

Create file using nano:

runagent -m roundcubemail1 nano config/config.addressbook.php

with following content:

<?php
$config['ldap_public']['public'] = array(
    'name'                   => 'Public LDAP Addressbook',
    'hosts'                  => array('ldaps://10.5.4.1'),
    'port'                   => 636,
    'use_tls'                => false,
    'user_specific'          => false,
    'base_dn'                => 'dc=ad,dc=domain,dc=com',
    'bind_dn'                => 'ldapservice@ad.domain.com',
    'bind_pass'              => 'SECRET',
    'scope'                  => 'sub',
    'referrals'              => 0,
    'filter'                 => '(&(objectClass=user)(objectCategory=person)(!(isCriticalSystemObject=TRUE)))',
    'search_fields'          => array('mail', 'cn', 'sAMAccountName', 'displayname', 'sn', 'givenName', 'userPrincipalName'),
    'fuzzy_search'           => true,
    'sort'                   => 'cn',
    'fieldmap' => array(
        'name'        => 'displayName',
        'title'       => 'title',
        'email:account' => 'userPrincipalName',
        'email:extra'   => 'mail:*',
        'phone:work'  => 'telephoneNumber',
        'phone:mobile' => 'mobile',
        'phone:workfax' => 'facsimileTelephoneNumber',
        'street'      => 'street',
        'zipcode'     => 'postalCode',
        'locality'    => 'l',
        'department'  => 'departmentNumber',
        'notes'       => 'description',
        'photo'       => 'jpegPhoto',
    ),
);

Then the addressbook is shown but I wasn’t able to search
I think due to wrong config settings.

1 Like

on todo, will try to check but in fact I ask myself if we did not want to hide it because userPrincipalName is not the real email, we do not have a mail field to display and it prones to error

so if you use the ldap to send an email to a user from samba ad, you send it to the wrong domain name

1 Like

i don’t understand your reply
my question was about compose a new email in NS8 i have a users in LDAP and i need to write first character of the user like in NS7 it work but in NS8 there is no suggestion of existing users to choose.

user account !== mail account

foo@ad.domain.com !== foo@domain.com

ok
how can i solve this what i do to enable suggestions of users in email?

got it for openldap

[roundcubemail1@R1-pve state]$ cat  config/config.addressbook.php 
<?php
$config['ldap_public']['public'] = array(
    'name'                   => 'Public LDAP Addressbook',
    'hosts'                  => array('ldap://10.0.2.2:20001'),
    'port'                   => 20001,
    'use_tls'                => false,
    'user_specific'          => false,
    'base_dn'                => 'dc=rocky9-pve,dc=org',
    'bind_dn'                => 'cn=ldapservice,dc=rocky9-pve,dc=org',
    'bind_pass'              => 'vco-kJNx46HGpopH_h89K3fj1KLykkmQ',
    'scope'                  => 'sub',
    'referrals'              => 0,
    'filter'                 => '(objectClass=inetOrgPerson)',
    'search_fields'          => array('mail','cn'),
    'fuzzy_search'           => true,
    'groups'                 => array(
        'base_dn'            => '',
        'filter'             => '(objectClass=posixGroup)',
        'object_classes'     => array("top", "posixGroup"),
        'member_attr'        => 'uid',
  ),
  'fieldmap' => array(
    'name'         => 'cn',
    'surname'      => 'sn',
    'firstname'    => 'givenName',
    'jobtitle'     => 'title',
    'email'        => 'uid',
    'locality'     => 'l',
    'organization' => 'o',
    'department'   => 'ou',
    'phone'        => 'telephoneNumber',
    'street'       => 'street',
  )
);
$config['autocomplete_addressbooks'] = array('sql','public');

@markus you missed to add this to the pod to allow the ldap loopback

    --network=slirp4netns:allow_host_loopback=true \
    --add-host=accountprovider:10.0.2.2

need to test the samba AD

1 Like

to retrieve the ldap settings

[roundcubemail1@R1-pve state]$ runagent python3 -magent.ldapproxy

for samba
cat config/config.addressbook.php

<?php
$config['ldap_public']['public'] = array(
    'name'                   => 'Public LDAP Addressbook',
    'hosts'                  => array('ldap://10.0.2.2:20002'),
    'port'                   => 20002,
    'use_tls'                => false,
    'user_specific'          => false,
    'base_dn'                => 'DC=ad,DC=rocky9-pve,DC=org',
    'bind_dn'                => 'ldapservice@ad.rocky9-pve.org',
    'bind_pass'              => ',r8_bbN+to7XpuO7b6Dfmtrr-9opOwhz',
    'scope'                  => 'sub',
    'referrals'              => 0,
    'filter'                 => '(&(objectClass=user)(objectCategory=person)(!(isCriticalSystemObject=TRUE)))',
    'search_fields'          => array('mail', 'cn', 'sAMAccountName', 'displayname', 'sn', 'givenName', 'userPrincipalName'),
    'fuzzy_search'           => true,
    'sort'                   => 'cn',
    'fieldmap' => array(
        'name'        => 'displayName',
        'title'       => 'title',
        'email:account' => 'cn',
        'email:extra'   => 'mail:*',
        'phone:work'  => 'telephoneNumber',
        'phone:mobile' => 'mobile',
        'phone:workfax' => 'facsimileTelephoneNumber',
        'street'      => 'street',
        'zipcode'     => 'postalCode',
        'locality'    => 'l',
        'department'  => 'departmentNumber',
        'notes'       => 'description',
        'photo'       => 'jpegPhoto',
    ),
);
$config['autocomplete_addressbooks'] = array('sql','public');
1 Like
1 Like

hello

some braves to test

add-module ghcr.io/nethserver/roundcubemail:ldapaddressbook

in the roundcubemail UI you can select the forced domain, you will see it in the ldap address book

in the settings of the mail server you can change the ldap used to authenticate, when you change it, you will see in the UI of the user-panel the change (eg the app roundcubemail listed as an application allowed to use this ldap)

1 Like

something to test please:

2 Likes