Roundcube Community Forum

News and Announcements => General Discussion => Topic started by: rohroh on February 23, 2016, 12:07:58 AM

Title: Troubles exporting Global LDAP address book.
Post by: rohroh on February 23, 2016, 12:07:58 AM
Hi, I have several customers who are using Roundcube (via an iRedMail installation) that want to export their Global LDAP address book.  I have been able to replicate the problem myself and was able to capture some errors. Hoping that someone may be able to point me in the right direction to maybe sort this issue out.

When exporting it appears to generate the VCF file however when you try to import it just imports blank entries.  This is a copy of the contents of the VCF file.

BEGIN:VCARD
VERSION:3.0
END:VCARD
BEGIN:VCARD
VERSION:3.0
END:VCARD
BEGIN:VCARD
VERSION:3.0
END:VCARD
BEGIN:VCARD
VERSION:3.0
END:VCARD
BEGIN:VCARD
VERSION:3.0
END:VCARD
BEGIN:VCARD
VERSION:3.0
END:VCARD


There is 6 known contacts that all have complete details in their records and yet the export gives 6 blank vCards.  The error log when i turn on LDAP logging in Roundcube config shows the following. Running the same sort of LDAP query from a LDAP front end returns the results i am expecting. I have obviously changed the details to protect LDAP entries etc.

Feb 23 10:32:49 iredmail roundcube: C: Connect to 127.0.0.1:389 [Global LDAP Address Book]
Feb 23 10:32:49 iredmail roundcube: S: OK
Feb 23 10:32:49 iredmail roundcube: C: Bind mail=xxxxx@mydomainname.com,ou=Users,domainName=mydomainname.com,o=domains,dc=xxxxxx,dc=xxxxxxxxxx,dc=xxx,dc=xx, pass: **** [12]
Feb 23 10:32:49 iredmail roundcube: S: OK
Feb 23 10:32:49 iredmail roundcube: C: Search domainName=mydomainname.com,o=domains,dc=xxxxxx,dc=xxxxxxxxx,dc=xxx,dc=xx for (&(enabledService=mail)(enabledService=deliver)(enabledService=displayedInGlobalAddressBook)(|(objectClass=mailList)(objectClass=mailAlias)(objectClass=mailUser)))
Feb 23 10:32:49 iredmail roundcube: S: 6 record(s) found
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: PHP Warning:  Invalid argument supplied for foreach() in /var/www/roundcubemail-1.0.8/program/steps/addressbook/export.inc on line 136
Feb 23 10:32:49 iredmail roundcube: C: Close



Any help would be greatly appreciated as this really doesn't make much sense at the moment.
Title: Re: Troubles exporting Global LDAP address book.
Post by: alec on February 23, 2016, 02:30:23 AM
Try with this https://github.com/roundcube/roundcubemail/commit/e25b0d7781edf02f15401078430c8d40f5c9e544
Title: Re: Troubles exporting Global LDAP address book.
Post by: rohroh on February 23, 2016, 06:54:10 PM
Alec,

You are a LEGEND!!!! :) :) :)

That fixed it straight away.  Will this be rolled into the next version so i don't have to patch when upgrading?  We like to have a fully documented upgrade path that we keep on file.


Title: Re: Troubles exporting Global LDAP address book.
Post by: alec on February 24, 2016, 02:07:53 AM
I backported the fix to 1.0 branch, so it will be part of next release. It was already fixed in 1.1 and 1.2.