1

Topic: PHP error: ldap_list failed issue

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.5-1
- Linux/BSD distribution name and version: Ubuntu 14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):LDAP
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====

Hi Zhang,
I build an iredmail server from clean Ubuntu 14-04 server.
But when i check /var/log/mail.err log, i see many entries like this:
mail roundcube: <pbnhyn4r> PHP Error: LDAP: ldap_list failed for dn=domainName=xxxxxx,o=domains,dc=xxxxxx,dc=xxxxx. Bad search filter (POST /mail/?_task=mail&_action=autocomplete)

What happened here? And can you give me some advice to solve this issue?
Thanks!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: PHP error: ldap_list failed issue

Please turn on LDAP debug mode in Roundcube:
http://www.iredmail.org/docs/debug.roundcubemail.html

Then reproduce this issue, and extract related LDAP debug log from Roundcube log file (same as Postfix log file) and paste here. FYI:
http://www.iredmail.org/docs/file.locat … #roundcube

3

Re: PHP error: ldap_list failed issue

i turned on roundcube debug mode but no addition log there. The entries are the same as the log i show above: ldap_list failed, bad search filter. Do you have some idea for this?

4

Re: PHP error: ldap_list failed issue

Then turn on debug mode in OpenLDAP to check which ldap search filter it sent.
FYI: http://www.iredmail.org/docs/debug.roundcubemail.html

5 (edited by tmihalicek 2019-05-17 16:20:28)

Re: PHP error: ldap_list failed issue

This error is still present, so i hit the debug in roundcubemail and posted it here.

Regarding version, everything is latest version on RHEL7

May 17 10:06:21 killah roundcube: <q021jrab> C: Connect [127.0.0.1:389]
May 17 10:06:21 killah roundcube: <q021jrab> S: OK
May 17 10:06:21 killah roundcube: <q021jrab> C: Bind [dn: mail=tmihalicek@domain.org,ou=Users,domainName=domain.org,o=domains,dc=domain,dc=org]
May 17 10:06:21 killah roundcube: <q021jrab> S: OK
May 17 10:06:21 killah roundcube: <q021jrab> C: Search base dn: [domainName=domain.org,o=domains,dc=domain,dc=org] scope [sub] with filter [(&(&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailUser)(objectClas$
May 17 10:06:21 killah roundcube: <q021jrab> Using function ldap_search on scope sub ($ns_function is ldap_search)
May 17 10:06:21 killah roundcube: <q021jrab> C: (Without VLV) Setting a filter of (&(&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))(|(cn=*t*)(givenname=*$
May 17 10:06:21 killah roundcube: <q021jrab> Executing search with return attributes: array (#012  0 => 'cn',#012  1 => 'sn',#012  2 => 'givenname',#012  3 => 'title',#012  4 => 'mail',#012  5 => 'telephonenumber',#012  6 => 'mobile',#012  7 => 'facsimiletelephonenumbe$
May 17 10:06:21 killah roundcube: <q021jrab> S: 4 record(s) found
May 17 10:06:21 killah roundcube: <q021jrab> C: Search base dn: [domainName=domain.org,o=domains,dc=domain,dc=org] scope [] with filter [(&(=*t*))]
May 17 10:06:21 killah roundcube: <q021jrab> Using function ldap_list on scope  ($ns_function is ldap_read)
May 17 10:06:21 killah roundcube: <q021jrab> C: (Without VLV) Setting a filter of (&(=*t*))
May 17 10:06:21 killah roundcube: <q021jrab> Executing search with return attributes: array (#012  0 => 'dn',#012  1 => 'objectClass',#012  2 => NULL,#012  3 => 'mail',#012)
May 17 10:06:21 killah roundcube: <q021jrab> PHP Error: LDAP: ldap_list failed for dn=domainName=domain.org,o=domains,dc=domain,dc=org. Bad search filter (POST /mail/?_task=mail&_action=autocomplete)
May 17 10:06:21 killah journal: ool inet: <q021jrab> C: Close
May 17 10:06:22 killah roundcube: <q021jrab> C: Connect [127.0.0.1:389]
May 17 10:06:22 killah roundcube: <q021jrab> S: OK
May 17 10:06:22 killah roundcube: <q021jrab> C: Bind [dn: mail=tmihalicek@domain.org,ou=Users,domainName=domain.org,o=domains,dc=domain,dc=org]
May 17 10:06:22 killah roundcube: <q021jrab> S: OK
May 17 10:06:22 killah roundcube: <q021jrab> C: Search base dn: [domainName=domain.org,o=domains,dc=domain,dc=org] scope [sub] with filter [(&(&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailUser)(objectClas$
May 17 10:06:22 killah roundcube: <q021jrab> Using function ldap_search on scope sub ($ns_function is ldap_search)
May 17 10:06:22 killah roundcube: <q021jrab> C: (Without VLV) Setting a filter of (&(&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))(|(cn=*tmihalicek*)(gi$
May 17 10:06:22 killah roundcube: <q021jrab> Executing search with return attributes: array (#012  0 => 'cn',#012  1 => 'sn',#012  2 => 'givenname',#012  3 => 'title',#012  4 => 'mail',#012  5 => 'telephonenumber',#012  6 => 'mobile',#012  7 => 'facsimiletelephonenumbe$
May 17 10:06:22 killah roundcube: <q021jrab> S: 1 record(s) found
May 17 10:06:22 killah roundcube: <q021jrab> C: Search base dn: [domainName=domain.org,o=domains,dc=domain,dc=org] scope [] with filter [(&(=*tmihalicek*))]
May 17 10:06:22 killah roundcube: <q021jrab> Using function ldap_list on scope  ($ns_function is ldap_read)
May 17 10:06:22 killah roundcube: <q021jrab> C: (Without VLV) Setting a filter of (&(=*tmihalicek*))
May 17 10:06:22 killah roundcube: <q021jrab> Executing search with return attributes: array (#012  0 => 'dn',#012  1 => 'objectClass',#012  2 => NULL,#012  3 => 'mail',#012)
May 17 10:06:22 killah roundcube: <q021jrab> PHP Error: LDAP: ldap_list failed for dn=domainName=domain.org,o=domains,dc=domain,dc=org. Bad search filter (POST /mail/?_task=mail&_action=autocomplete)
May 17 10:06:22 killah journal: ool inet: <q021jrab> C: Close

6

Re: PHP error: ldap_list failed issue

Compare your LDAP address book relevant settings in Roundcube config file (/opt/www/roundcubemail/config/config.inc.php) with default template, any difference?
https://bitbucket.org/zhb/iredmail/src/ … ok.inc.php

7

Re: PHP error: ldap_list failed issue

refer :https://bbs.iredmail.org/post16080.html#p16080
(That is the Chinese forum)

tmihalicek wrote:

May 17 10:06:21 killah roundcube: <q021jrab> C: (Without VLV) Setting a filter of (&(=*t*))

I remember that it was normal after updating roundcube.
Please refer to see.