Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: langeman on March 19, 2025, 11:13:46 AM

Title: Massive PHP Warning: Undefined array key errors
Post by: langeman on March 19, 2025, 11:13:46 AM
I installed roundcubemail on AlmaLinux9:

# rpm -q roundcubemail
roundcubemail-1.5.9-1.el9.noarch
# rpm -q php
php-8.0.30-1.el9_2.x86_64
# rpm -q mariadb
mariadb-10.5.22-1.el9_2.alma.1.x86_64

Using  FreeIPA LDAP contacts ("address book") seems to work well using this config:

$config['ldap_public']['Home'] = [
  'name'             => 'Home FreeIPA LDAP directory',
  // Replacement variables supported in host names:
  // %h - user's IMAP hostname
  // %n - http hostname ($_SERVER['SERVER_NAME'])
  // %d - domain (http hostname without the first part)
  // %z - IMAP domain (IMAP hostname without the first part)
  // For example %n = mail.domain.tld, %d = domain.tld
  'hosts'            => [ 'ipa1.example.com', 'ipa2.example.com' ],
  'port'             => 389,
  'use_tls'          => true,
  'ldap_version'     => 3,
  'user_specific'    => false,
  'bind_dn'          => 'uid=ap_roundcube_dev,cn=users,cn=accounts,dc=example,dc=com',
  'bind_pass'        => '2XKcbuZrvfFGNHJS99qY1RrOD',
  'base_dn'          => 'cn=users,cn=accounts,dc=example,dc=com',
  'filter'           => '(memberOf=cn=roundcube_users,cn=groups,cn=accounts,dc=example,dc=com)',
  'writable'         => false,
  'scope'            => 'sub',
  'search_fields'    => [ 'mail', 'displayName', 'cn', 'sn', 'givenName'],  // fields to search in
  'fuzzy_search'     => true,    // server allows wildcard search
  'vlv'              => false,        // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
  'vlv_search'       => false,        // Use Virtual List View functions for autocompletion searches (if server supports it)
  'fieldmap'         => [
    // Roundcube    => LDAP:limit
    'name'          => 'displayName',
    'surname'       => 'sn',
    'firstname'     => 'givenName',
    'jobtitle'      => 'title',
    'email'         => 'mail:*',
    'phone:home'    => 'homePhone',
    'phone:work'    => 'telephoneNumber',
    'phone:mobile'  => 'mobile',
    'phone:pager'   => 'pager',
    'phone:workfax' => 'facsimileTelephoneNumber',
    'street'        => 'street',
    'zipcode'       => 'postalCode',
    'region'        => 'st',
    'locality'      => 'l',
    // if you country is a complex object, you need to configure 'sub_fields' below
    'country'       => 'c',
    'organization'  => 'o',
    'department'    => 'ou',
    'jobtitle'      => 'title',
    'notes'         => 'description',
    'photo'         => 'jpegPhoto',
    // these currently don't work:
    // 'manager'       => 'manager',
    // 'assistant'     => 'secretary',
   ],
  'group_filters' => [
    'roundcube_users' => [
      'name'    => 'Webmail gebruikers',
      'scope'   => 'sub',
      'base_dn' => 'cn=accounts,dc=example,dc=com',
      'filter'  => '(memberof=cn=roundcube_users,cn=groups,cn=accounts,dc=example,dc=com)',
      'name_attr' => 'cn',
    ],
    'calweb-toegang-dev' => [
      'name'    => 'Calweb toegang dev',
      'scope'   => 'sub',
      'base_dn' => 'cn=accounts,dc=example,dc=com',
      'filter'  => '(&(memberof=cn=some-other-group,cn=groups,cn=accounts,dc=example,dc=com)(objectClass=inetorgPerson))',
      'name_attr' => 'cn',
    ],
  ],
];

However, XXX is flooding with warnings as soon as i access "Contacts":

[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 1763
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "name" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "surname" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "firstname" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "jobtitle" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "email" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "phone" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "street" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key "zipcode" in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 167
[19-Mar-2025 15:50:19 Europe/Amsterdam] PHP Warning:  Undefined array key 1 in /usr/share/roundcubemail/program/lib/Roundcube/rcube_ldap.php on line 145

Still, the address book seems to work fine, but this rather massive logging will fill up my disk...

Is something missing in my config, is something wrong in mij config?
Am I hitting a bug?
Title: Re: Massive PHP Warning: Undefined array key errors
Post by: JohnDoh on March 19, 2025, 02:07:01 PM
these warnings were fixed in v1.6
Title: Re: Massive PHP Warning: Undefined array key errors
Post by: langeman on April 01, 2025, 12:39:28 PM
Sorry for the late response, some private issues needed my attention...

Anyhow, sounds great, I will try. Let me see where I can get v1.6 for AlmaLinux9.

Thanks a lot!
Title: Re: Massive PHP Warning: Undefined array key errors
Post by: langeman on April 03, 2025, 02:46:32 AM
I tried roundcubemail 1.6.10 from the remi-repo, works perfectly, the error disappeared :)

Since 1.5.9 is an LTS version, shouldn´t it be fixed in this version also?
Title: Re: Massive PHP Warning: Undefined array key errors
Post by: alec on April 03, 2025, 04:40:18 AM
1.5 is in low maintenance mode, i.e. critical or security fixes only.