roundcubemail 加上Active Directory 通訊錄範例

修改config/config.inc.php
網域伺服器 192.168.1.1
網域: test.com

$config['address_book_type'] = 'ldap';

$config['ldap_public']['Global'] = array(
'name' => '台灣總公司',
'hosts' => array('192.168.1.1'),
'port' => 3268,
'user_specific' => false,
'base_dn' => 'dc=test,dc=com',
'bind_dn' => 'cn=administrator,cn=users,dc=test,dc=com',
'bind_pass' => 'password',
'ldap_version' => 3,
'search_fields' => array (
'mail','cn',),
'name_field' => 'cn',
'email_field' => 'mail',
'writable' => 'false',
'scope' => 'sub',
'sizelimit' => 6000,
'sort' => 'cn',
'filter' => '(&(mail=)(|(&(objectClass=user)(!(objectClass=computer)))))',
'fuzzy_search' => true,
'global_search' => true
);

2022/11/05

我後來使用docker doundcubemail 重新安裝, 因為用latest , 當時版本 1.6.x 版本 , 發現上面的設定已經不能用了, 改用以下設定(紅色部分需調整)

$config['address_book_type'] = 'ldap';
$config['ldap_debug'] = true;
$config['ldap_public'] = array(
    'MyAdLdap' => array (
        'name' => 'TW',
        'hosts' => array('網域主機IP'),
        'sizelimit' => 6000,
        'port' => 3268,
        'use_tls' => false,
        'user_specific' => false,
        'base_dn' => 'OU=group,DC=test,DC=com',
        'bind_dn' => 'user@test.com',
        'bind_pass' => 'password',
        'writable' => false,
        'ldap_version' => 3,
        'search_fields' => array(
           'mail',
           'cn',
        ),
        'fieldmap' => array(
            'name' => 'cn',
            'email' => 'mail',
            'surname' => 'sn',
            'firstname' => 'givenName',
        ),
        'sort' => 'sn',
        'scope' => 'sub', # or 'list'
        'filter' => '(&(mail=*)(|(&(objectClass=user)(!(objectClass=computer)))(objectClass=group)))',
        'global_search' => true,
        'fuzzy_search' => true,
        'vlv' => false,
    ),
);

詳請參考 https://github.com/roundcube/roundcubemail/wiki/Configuration:-LDAP-Address-Books#prerequisites

發表迴響