<?php
#>GNUNUX
{% set domain = general.roundcube.roundcube_domain.roundcube_domains[rougail_index] %}
$config['login_username_filter'] = '/^[a-z0-9_]+@{{ domain.roundcube_mail_domain }}$/';
{% set family = domain.roundcube_family %}
{% if family %}
$config['ldap_public'] = array (
  'Local' => array (
    'name' => "Ma famille",
    'hosts' =>  array (
      0 => 'ldaps://{{ general.ldap.server.ldap_server_address }}',
      ),
    'port' => 636,
    'use_tls' => false,
    'bind_user' => '',
    'bind_dn' => '{{ general.ldap.client.ldapclient_user }}',
    'bind_pass' => '{{ general.ldap.client.ldapclient_user_password }}',
    'auth_method'    => '',
    'vlv' => false, //Samba do not support Virtual List View functions
    'user_specific' => false,
    'base_dn' => '{{ ldapclient_base_dn|calc_ldapclient_base_dn(family_name=family) }}',
    'writable' => false,
    'required_fields' =>  array (
      0 => 'cn',
      1 => 'sn',
      2 => 'mail',
      3 => 'uid',
      ),
    'groups' => array(
      'base_dn'           => '',
      'object_classes'    => ['top', 'groupOfNames'],                                                 
    ),
    'LDAP_rdn' => 'mail',
    'ldap_version' => 3,
    'search_fields' => array ('mail', 'cn', 'sn', 'givenName'),
    'name_field' => 'cn',
    'email_field' => 'mail',
    'surname_field' => 'sn',
    'firstname_field' => 'gn',
    'sort' => 'cn',
    'scope' => 'sub',
    'filter' => '(mail=*)',
    'fuzzy_search' => true,
    'fieldmap' => array(
      'name'         => 'cn',
      'surname'      => 'sn',
      'firstname'    => 'givenName',
      'email'        => 'mail',
      ),
  ),
);
{% endif %}
#<GNUNUX
?>