gab2contacts with univention not syncing LDAP Kopano contacts



  • Hi,

    on my UCS server I added some contacts under LDAP Kopano contacts which are created as kopano-contacts in the GAB. Unfortunately gab2contacts is not syncing those contacts.

    When I read out these contacts and echo them on the command line, they look like following

    [973078558] =>
    [973471754] => -2147221233
    [974192670] => tester
    [974716938] => -2147221233
    [974520330] => -2147221233
    [974585866] => -2147221233
    [972947486] =>
    [973602826] => -2147221233
    [975372298] => -2147221233
    [974454794] => -2147221233
    [975831050] => -2147221233
    [975699978] => -2147221233
    [975634442] => -2147221233
    [974913546] => -2147221233
    [973668362] => -2147221233
    [975241226] => -2147221233
    [-1935802358] => -2147221233
    [974127114] => -2147221233
    [956628995] => 6
    [805371934] =>
    [1738997770] => -2147221233
    

    How can I modify the gab2contacts script, that these contacts are synced as well?

    Thanks for help?

    Andy


  • Kopano



  • @fbartels : Correct, the intention to post this in the Kopano forum is to modify the script itself. In the univention forum to look if it’s the right behaviour that those contacts seem to be rooms.

    A kind of hint if it’s the correct behaviour of LDAP Kopano contacts in UCS or a mod of the script would be necessary would be helpful.

    Cheers!

    Andy


  • Kopano

    Hi @raceface2nd ,

    there is still a lot over overlap, thats why I will only reply to one of the threads.

    I have by now looked into this and am not quite sure I see the same as you see. If I create a contact through the Univention udm module, this will show up as a contact in the gab (with https://static.9wd.eu/kopano/gab-contact-symbol.PNG). These items will indeed be ignored by the copy script. e.g. before adding the contact:

    $ z-push-gab2contacts -a sync
    Sync - Objects in GAB: 6 - in folder (before run): 3 - created: 0 - updated: 0 - deleted: 0 - untouched: 3 - ignored: 3
    

    and after adding it:

    $ z-push-gab2contacts -a sync
    Sync - Objects in GAB: 7 - in folder (before run): 3 - created: 0 - updated: 0 - deleted: 0 - untouched: 3 - ignored: 4
    

    I think your question about rooms comes from the fact that contacts are seemingly ignored because of this line https://stash.z-hub.io/projects/ZP/repos/z-push/browse/tools/gab2contacts/lib/kopano.php#205 ?


  • Kopano

    Hi Andy,

    I’ve created a JIRA issue for this: https://jira.z-hub.io/browse/ZP-1401. It will be available in Z-Push 2.4.2 (we plan to release beta at latest in the next couple of weeks) . In the meantime you can find the fix in stash: https://stash.z-hub.io/projects/ZP/repos/z-push/pull-requests/691/diff.

    Manfred



  • Hi Felix,
    Hi Manfred,

    It is correct, that the contacts I add in univention are written into the GAB. But without the fix these contacts have been ignored. A question beside . . . How can I view the GAB in the WebApp and/ or in Outlook without the OLE?

    @Manfred : With your fix the contacts are added to the contacts but unfortunately n-1 contacts are added every time the script runs. When I delete a contact it is not deleted while the sync runs.

    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    

    Deletion also seems to work only for 1 contact at a time. After the above creation I deleted 3 contacts at a time but only one contact has been deleted, I had to run the script several times to delete all contacts that have been created with this script.

    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 6 - in folder (before run): 6 - created: 0 - updated: 0 - deleted: 1 - untouched: 5 - ignored: 1
    

    As a more mobile user I love this script as it helps having these contacts from the GAB in my address book also in situations without mobile data so I would find it very cool to get it running as expected. Because it is working perfect with all users I was not sure if the way those contacts are written into the UCS LDAP could be buggy.

    I appreciate your help!

    Andy


  • Kopano

    Hi Andy,

    @raceface2nd said in gab2contacts with univention not syncing LDAP Kopano contacts:

    Hi Felix,
    Hi Manfred,

    It is correct, that the contacts I add in univention are written into the GAB. But without the fix these contacts have been ignored. A question beside . . . How can I view the GAB in the WebApp and/ or in Outlook without the OLE?

    What do you mean by OLE? KOE?
    In the Webapp there’s “Address book” button (2nd from left) which opens the GAB.
    Outlook with ActiveSync requires KOE and gab-sync in order GAB to be available.

    @raceface2nd said in gab2contacts with univention not syncing LDAP Kopano contacts:

    @Manfred : With your fix the contacts are added to the contacts but unfortunately n-1 contacts are added every time the script runs. When I delete a contact it is not deleted while the sync runs.

    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    

    I’m not able to reproduce that. If there were no changes in GAB, the script doesn’t add anything:

    root@ubuntu:/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 32 - in folder (before run): 27 - created: 0 - updated: 0 - deleted: 0 - untouched: 27 - ignored: 5
    
    root@ubuntu:/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 32 - in folder (before run): 27 - created: 0 - updated: 0 - deleted: 0 - untouched: 27 - ignored: 5
    
    

    @raceface2nd said in gab2contacts with univention not syncing LDAP Kopano contacts:

    Deletion also seems to work only for 1 contact at a time. After the above creation I deleted 3 contacts at a time but only one contact has been deleted, I had to run the script several times to delete all contacts that have been created with this script.

    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:~# /etc/kopano/userscripts/createuser.d/01updatecontacts
    Sync - Objects in GAB: 6 - in folder (before run): 6 - created: 0 - updated: 0 - deleted: 1 - untouched: 5 - ignored: 1
    

    I was also not able to reproduce that. I deleted two contacts and ran the script:

    root@ubuntu:/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 30 - in folder (before run): 27 - created: 0 - updated: 0 - deleted: 2 - untouched: 25 - ignored: 5
    
    

    What are the contents of /etc/kopano/userscripts/createuser.d/01updatecontacts and what calls it?

    Manfred



  • Hi Manfred,

    Yes, I ment the KOE.
    Thx for the hint with the button in the WebApp, I never pressed it :-)

    I tried some times again with new LDAP contacts. They are created only once in the GAB but everytime the sync script runs in the contacts.

    0_1524155905768_25a40aa2-18e0-4e23-a027-9af57f5bc108-grafik.png

    0_1524155691232_564f2e48-0e62-4126-9762-db1db38e04bd-grafik.png

    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 6 - in folder (before run): 5 - created: 0 - updated: 0 - deleted: 0 - untouched: 5 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 5 - created: 3 - updated: 0 - deleted: 0 - untouched: 5 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 9 - in folder (before run): 6 - created: 2 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    

    The content of /etc/kopano/userscripts/createuser.d/01updatecontacts is taken from the gab2contacts tutorial and is following

    #!/bin/sh
    set -e
    
    GABCONTACTS=/usr/share/z-push/tools/gab2contacts/gab2contacts.php
    
    if [ -e $GABCONTACTS ]; then
            $GABCONTACTS -a sync
    fi
    

    Best regards!

    Andy


  • Kopano

    Hi Andy,

    that’s weird. As you can see the from the script output, it looks like that some contacts are missing (9 in GAB and 6 in the folder, from the missing 3 contacts 2 are created and 1 ignored). Are display_errors and error_reporting enabled in php.ini? Are there any errors when you run the script?

    Which KC and php-mapi versions are you using?

    The only thing I could think of is that there’s some strange caching issue on your server.

    Manfred



  • Hi Manfred,

    I am running KC 8.4.5.0 on UCS 4.3-0 errata12, Z-Push is 2.3.8+0, MAPI Support 8.4.5.0. I can’t say if there’s any strange caching, because I didn’t do any modifications on that UCS. display_errors is actually disabled and error_reporting shows 22527.

    I think I could figure out the source of this in this moment. gab2contacts I tried was 2.4.1 installed in an old folder /usr/share/z-push which looks like that it is no longer used by Kopano4UCS Z-Push.

    Is there a way to install gab2contacts on UCS 4.3 with KC 8.4.5 and z-push 2.3.8?

    Thx!

    Andy


  • Kopano

    Hi Andy,

    I don’t know if UCS does it differently, but /usr/share/z-push is the default Z-Push installation location for quite some time already.

    If gab2contacts is not in tools folder of your z-push installation, you can download the z-push-2.3.8.tar.gz file and extract gab2contacts from it.

    Manfred


  • Kopano

    @raceface2nd said in gab2contacts with univention not syncing LDAP Kopano contacts:

    /usr/share/z-push which looks like that it is no longer used by Kopano4UCS Z-Push.

    This is the default install directory and should be used in any case.

    To install gab2contacts you just need to install the package for it. i.e. ´univention-install z-push-kopano-gab2contacts´.

    ps: if you want to have the most recent Z-Push version its recommended to configure the Y-Push repo inside of the app. read https://wiki.z-hub.io/display/K4U/Updating+Kopano+packages+directly+from+the+Kopano+download+server for more instructions.



  • So, I uninstalled gab2contacts 2.4.1, downloaded 2.3.8, configured it and performed the modifications from https://stash.z-hub.io/projects/ZP/repos/z-push/pull-requests/691/diff.

    The issue is still the same.

    0_1524488809370_c5168d04-04bb-4eba-800f-82e63d1107a1-grafik.png

    0_1524488837748_4194e167-51c8-443a-8fa9-4e7b25e46c2f-grafik.png

    Tonight I will try upgrading all z-push components to 2.4 in the hope it will work then.

    Andy



  • Tonight I upgraded to z-push 2.4.1+0 but the problem still exists.

    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 8 - in folder (before run): 5 - created: 2 - updated: 0 - deleted: 0 - untouched: 5 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 8 - in folder (before run): 6 - created: 1 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 8 - in folder (before run): 6 - created: 1 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Sync - Objects in GAB: 8 - in folder (before run): 6 - created: 1 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    
    ii  kopano4ucs-z-push                                   1.3.26                                           all          Meta package for Z-Push installation
    ii  z-push-autodiscover                                 2.3.8+0-0                                        all          Z-Push autodiscover
    ii  z-push-backend-kopano                               2.4.1+0-0                                        all          Z-Push Kopano backend
    ii  z-push-common                                       2.4.1+0-0                                        all          open source implementation of the ActiveSync protocol
    ii  z-push-config-apache                                2.3.8+0-0                                        all          Z-Push apache configuration
    ii  z-push-config-apache-autodiscover                   2.3.8+0-0                                        all          Z-Push autodiscover apache configuration
    ii  z-push-ipc-sharedmemory                             2.4.1+0-0                                        all          Z-Push ipc shared memory provider
    ii  z-push-kopano                                       2.4.1+0-0                                        all          Z-Push for Kopano
    ii  z-push-kopano-gab2contacts                          2.4.1+0-0                                        all          GAB sync into a contacts folder for Kopano
    ii  z-push-kopano-gabsync                               2.4.1+0-0                                        all          GAB sync for Kopano
    

    It’s a kind of weird.

    Maybe you have some ideas what it could be?

    Regards!

    Andy


  • Kopano

    Hi Andy,

    did you apply fixes from https://jira.z-hub.io/browse/ZP-1401 after updating to Z-Push 2.4.1?

    Could you add this line in gab2contacts/lib/kopano.php right after or before $created++; (it should be around line 260):

    print_r($entry);
    

    Manfred



  • Hi Manfred,

    yes I applied the fix before. Please find below the output of 2 runs directly after another:
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync

    Array
    (
        [268370178] => ▒!▒P@▒▒H▒▒S0D%NjBkNjEyZjgtZGI3My0xMDM3LTgwYWEtOTNjZTFmZjUxNzI0
        [973078558] =>
        [973471754] => -2147221233
        [974192670] => neuer1
        [974716938] => -2147221233
        [974520330] => -2147221233
        [974585866] => -2147221233
        [972947486] =>
        [973602826] => -2147221233
        [975372298] => -2147221233
        [974454794] => -2147221233
        [975831050] => -2147221233
        [975699978] => -2147221233
        [975634442] => -2147221233
        [974913546] => -2147221233
        [973668362] => -2147221233
        [975241226] => -2147221233
        [-1935802358] => -2147221233
        [974127114] => -2147221233
        [956628995] => 6
        [805371934] =>
        [1738997770] => -2147221233
    )
    Array
    (
        [268370178] => ▒!▒P@▒▒H▒▒S0D%NjQ1N2ZkZWMtZGI3My0xMDM3LTgwYWItOTNjZTFmZjUxNzI0
        [973078558] =>
        [973471754] => -2147221233
        [974192670] => neuer2
        [974716938] => -2147221233
        [974520330] => -2147221233
        [974585866] => -2147221233
        [972947486] =>
        [973602826] => -2147221233
        [975372298] => -2147221233
        [974454794] => -2147221233
        [975831050] => -2147221233
        [975699978] => -2147221233
        [975634442] => -2147221233
        [974913546] => -2147221233
        [973668362] => -2147221233
        [975241226] => -2147221233
        [-1935802358] => -2147221233
        [974127114] => -2147221233
        [956628995] => 6
        [805371934] =>
        [1738997770] => -2147221233
    )
    Sync - Objects in GAB: 8 - in folder (before run): 5 - created: 2 - updated: 0 - deleted: 0 - untouched: 5 - ignored: 1
    
    root@mail2:/usr/share/z-push/tools/gab2contacts# ./gab2contacts.php -a sync
    Array
    (
        [268370178] => ▒!▒P@▒▒H▒▒S0D%NjQ1N2ZkZWMtZGI3My0xMDM3LTgwYWItOTNjZTFmZjUxNzI0
        [973078558] =>
        [973471754] => -2147221233
        [974192670] => neuer2
        [974716938] => -2147221233
        [974520330] => -2147221233
        [974585866] => -2147221233
        [972947486] =>
        [973602826] => -2147221233
        [975372298] => -2147221233
        [974454794] => -2147221233
        [975831050] => -2147221233
        [975699978] => -2147221233
        [975634442] => -2147221233
        [974913546] => -2147221233
        [973668362] => -2147221233
        [975241226] => -2147221233
        [-1935802358] => -2147221233
        [974127114] => -2147221233
        [956628995] => 6
        [805371934] =>
        [1738997770] => -2147221233
    )
    Sync - Objects in GAB: 8 - in folder (before run): 6 - created: 1 - updated: 0 - deleted: 0 - untouched: 6 - ignored: 1
    

    Andy


  • Kopano

    Hi Andy,

    when you’re creating a contact, aren’t you required to also enter username, not only last name? I have no idea how it works in the UCS, in the LDAP on my test system kopano-contacts do have this attribute.

    Manfred



  • Hi Manfred, there are 2 types of GAB contacts. 1st are users that require a username and a primary email address and additional 2nd there is an extra option provided by Kopano4UCS where you can add contacts to the GAB like business contacts where only the last name is required. This option can be found under the main option domain in UCS. Users are synched without any issues. The problem is with contacts.

    Andy


  • Kopano

    Hi Andy,

    it’s a problem that the contacts don’t have a separate username, only the last name. The script uses the username field to check if this entry was already synced. The easiest workaround would be if you would add a unique value as a username for the contacts as well.

    Manfred



  • Hi Manfred,

    that explains why the sync is not working. Unfortunately there is no option in the Kopano4UCS LDAP contacts to enter a user name. The only option is a displayname which does not seem to be the same like the username.

    0_1524664079035_428651c8-7a09-4d4f-9c8c-963e1401a7ac-image.png

    It looks like that this displayname is stored in a different way in the LDAP by Kopano4UCS so it is not synched into the GAB. Maybe @fbartels knows more about the workflow behind the sync of these contacts into the GAB?

    The Kopano4UCS LDAP contacts are stored in the LDAP scheme like in following screenshot.
    0_1524664564092_1190d032-69ef-4de9-8f80-ade77d9268db-image.png

    Regards!

    Andy


Log in to reply