I can't filter my addressbook when it opened - it show me all.
For example I want addressbook only with mailgroups:
Quote
$config['ldap_public'] = [
'test' => [
'name' => 'test',
'hosts' => ['1.1.1.1'],
'base_dn' => 'OU=1, OU=2,OU=3, DC=4, DC=local',
'bind_dn' => 'USER',
'bind_pass' => 'PASSWD',
'writable' => false,
'ldap_version' => 3,
'network_timeout' => 10,
'user_specific' => false,
'scope' => 'sub',
'search_fields' => ['displayname','mail'],
'fieldmap' => [
'name' => 'displayname',
'email' => 'mail'
],
'sort' => 'displayname',
'scope' => 'sub',
'filter' => '(objectCategory=group)',
'fuzzy_search' => true
]
];
when I open it - I see users, computers.
log
Quote
Jul 10 11:10:05 mail roundcube: <a03e1p5q> C: Connect [ldap://1.1.1.1:389]
Jul 10 11:10:05 mail roundcube: <a03e1p5q> S: OK
Jul 10 11:10:05 mail roundcube: <a03e1p5q> C: Bind [dn: USER]
Jul 10 11:10:05 mail roundcube: <a03e1p5q> S: OK
Jul 10 11:10:05 mail roundcube: <a03e1p5q> C: Search base dn: [OU=1, OU=2,OU=3, DC=4, DC=local] scope with filter [(objectclass=*)]
Jul 10 11:10:05 mail roundcube: <a03e1p5q> Using function ldap_search on scope sub ($ns_function is ldap_search)
Jul 10 11:10:05 mail roundcube: <a03e1p5q> C: (Without VLV) Setting a filter of (objectclass=*)
Jul 10 11:10:05 mail roundcube: <a03e1p5q> Executing search with return attributes: array (
Jul 10 11:10:05 mail roundcube: 0 => 'displayname',
Jul 10 11:10:05 mail roundcube: 1 => 'mail',
Jul 10 11:10:05 mail roundcube: 2 => 'objectClass',
Jul 10 11:10:05 mail roundcube: )
Jul 10 11:10:05 mail roundcube: <a03e1p5q> S: 13 record(s) found
what I do wrong ? I use Active Directory as LDAP server
I just try simple 'filter' => '(mail=*@domain.com)', and its not work too.
I created a ticket https://github.com/roundcube/roundcubemail/issues/9061, a fix should be available today.
Thank you!
FIX working fine!
all work fine but sometime I see in log:
Quote
Jul 12 13:02:45 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:02:45 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:02:45 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
its happen when user open address book with Groups from AD (for adddressbook only with users - no errors)
log looks like (I open GROUPS after open USERS and after again open GROUPS):
Quote
root@mail:~# tail -f /var/log/syslog |grep roundcube
Jul 12 13:07:15 mail roundcube: <qampuosu> C: Connect [ldap://1.1.1.1:389]
Jul 12 13:07:15 mail roundcube: <qampuosu> S: OK
Jul 12 13:07:15 mail roundcube: <qampuosu> C: Bind [dn: USER@DOMAIN]
Jul 12 13:07:15 mail roundcube: <qampuosu> S: OK
Jul 12 13:07:15 mail roundcube: <qampuosu> C: Search base dn: [OU=1,OU=2,DC=3,DC=local] scope with filter [(&(objectCategory=group)(mail=*@DOMAIN.COM))]
Jul 12 13:07:15 mail roundcube: <qampuosu> Using function ldap_search on scope sub ($ns_function is ldap_search)
Jul 12 13:07:15 mail roundcube: <qampuosu> C: (Without VLV) Setting a filter of (&(objectCategory=group)(mail=*@DOMAIN.COM))
Jul 12 13:07:15 mail roundcube: <qampuosu> Executing search with return attributes: array (
Jul 12 13:07:15 mail roundcube: 0 => 'cn',
Jul 12 13:07:15 mail roundcube: 1 => 'mail',
Jul 12 13:07:15 mail roundcube: 2 => 'objectClass',
Jul 12 13:07:15 mail roundcube: )
Jul 12 13:07:15 mail roundcube: <qampuosu> S: 7 record(s) found
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:15 mail roundcube: <qampuosu> C: Connect [ldap://1.1.1.1:389]
Jul 12 13:07:15 mail roundcube: <qampuosu> S: OK
Jul 12 13:07:15 mail roundcube: <qampuosu> C: Bind [dn: USER@DOMAIN]
Jul 12 13:07:15 mail roundcube: <qampuosu> S: OK
Jul 12 13:07:15 mail roundcube: <qampuosu> C: Search base dn: [OU=1,OU=2,DC=3,DC=local] scope with filter [(&(!(useraccountcontrol:1.2.840.113556.1.4.803:=2))(samaccountType=805306368)(mail=*@DOMAIN.COM))]
Jul 12 13:07:15 mail roundcube: <qampuosu> Using function ldap_search on scope sub ($ns_function is ldap_search)
Jul 12 13:07:15 mail roundcube: <qampuosu> C: (Without VLV) Setting a filter of (&(!(useraccountcontrol:1.2.840.113556.1.4.803:=2))(samaccountType=805306368)(mail=*@DOMAIN.COM))
Jul 12 13:07:15 mail roundcube: <qampuosu> Executing search with return attributes: array (
Jul 12 13:07:15 mail roundcube: 0 => 'displayname',
Jul 12 13:07:15 mail roundcube: 1 => 'mail',
Jul 12 13:07:15 mail roundcube: 2 => 'objectClass',
Jul 12 13:07:15 mail roundcube: )
Jul 12 13:07:15 mail roundcube: <qampuosu> S: 352 record(s) found
Jul 12 13:07:16 mail roundcube: <qampuosu> C: Connect [ldap://1.1.1.1:389]
Jul 12 13:07:16 mail roundcube: <qampuosu> S: OK
Jul 12 13:07:16 mail roundcube: <qampuosu> C: Bind [dn: USER@DOMAIN]
Jul 12 13:07:16 mail roundcube: <qampuosu> S: OK
Jul 12 13:07:16 mail roundcube: <qampuosu> C: Search base dn: [OU=1,OU=2,DC=3,DC=local] scope with filter [(&(objectCategory=group)(mail=*@DOMAIN.COM))]
Jul 12 13:07:16 mail roundcube: <qampuosu> Using function ldap_search on scope sub ($ns_function is ldap_search)
Jul 12 13:07:16 mail roundcube: <qampuosu> C: (Without VLV) Setting a filter of (&(objectCategory=group)(mail=*@DOMAIN.COM))
Jul 12 13:07:16 mail roundcube: <qampuosu> Executing search with return attributes: array (
Jul 12 13:07:16 mail roundcube: 0 => 'cn',
Jul 12 13:07:16 mail roundcube: 1 => 'mail',
Jul 12 13:07:16 mail roundcube: 2 => 'objectClass',
Jul 12 13:07:16 mail roundcube: )
Jul 12 13:07:16 mail roundcube: <qampuosu> S: 7 record(s) found
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Undefined index: groups in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
Jul 12 13:07:16 mail roundcube: PHP Notice: Trying to access array offset on value of type null in /var/www/html/webmail/program/lib/Roundcube/rcube_ldap.php on line 1630
and one analog error not for this case:
QuoteJul 12 13:54:20 mail roundcube: PHP Notice: Undefined index: charset in /var/www/html/webmail/program/lib/Roundcube/rcube_imap.php on line 2456
I'll fix the warnings, but you probably miss 'name_attr' property in 'groups' config.
Yes, not probably - im sure I miss it )))
I read default conf, but not clear understand section with 'groups'.
Now I use LDAP conf like this (from RC 1.5.3):
Quote
$config['ldap_public'] = [
'ldap_users' => [
'name' => 'COMPANY USERS',
'hosts' => ['1.1.1.1'],
'sizelimit' => 1000,
'use_tls' => false,
'user_specific' => false,
'base_dn' => 'OU=1,OU=2,DC=3,DC=local',
'bind_dn' => 'LDAP_USER',
'bind_pass' => 'LDAP_PASSWD',
'writable' => false,
'ldap_version' => 3,
'search_fields' =>['displayname','mail'],
'fieldmap' => [
'name' => 'displayname',
'email' => 'mail'
],
'sort' => 'displayname',
'scope' => 'sub',
'filter' => '(&(!(useraccountcontrol:1.2.840.113556.1.4.803:=2))(samaccountType=805306368)(mail=*@domain.com))', // not blocked users with email.
'fuzzy_search' => true,
'vlv' => false,
'vlv_search' => false
],
'ldap_groups' => [
'name' => 'MAILGROUPS',
'hosts' => ['1.1.1.1'],
'sizelimit' => 1000,
'use_tls' => false,
'user_specific' => false,
'base_dn' => 'OU=1,OU=2,DC=3,DC=local',
'bind_dn' => 'LDAP_USER',
'bind_pass' => 'LDAP_PASSWD',
'writable' => false,
'ldap_version' => 3,
'search_fields' => ['cn','mail'],
'fieldmap' => [
'name' => 'cn',
'email' => 'mail'
],
'sort' => 'cn',
'scope' => 'sub',
'filter' => '(&(objectCategory=group)(mail=*@domain.com))', // groups with email
'fuzzy_search' => true,
'vlv' => false,
'vlv_search' => false
]
];
I must use "groups" in my case ?
I try
Quote
.........
// 'fieldmap' => [
// 'name' => 'cn',
// 'email' => 'mail'
// ],
'name_attr' => 'cn',
'email_attr' => 'mail',
......
but its not work (screenshot) and still the same errors in log.
Im little bit confused :)
Ok, I didn't think of a use-case where you don't use 'groups' property at all. You rather return groups for contacts list. So, you can ignore my comment. I fixed the warnings in git.
ok!
Thank you!