GAB sync script under ./userscripts/createuser.d not executed when new user created

Hello all,

I have realized that whenever I create I new user in Samba4 ActiveDirectory the gabsync script is not automatically executed as desired.

I have installed and configured GAB sync as explained on this wiki:

If Z-Push is running on the same system as your Kopano, then you could also add the above script to /etc/kopano/userscripts/createuser.d to additionally run it whenever a new user has been created.

So did I but it does not seem to work. First I created the daily cronjob:

$ ls -lh /etc/cron.daily/z-push-gabsync

-rwxr-xr-x 1 root root 126 Mai 21 08:52 /etc/cron.daily/z-push-gabsync

$ cat /etc/cron.daily/z-push-gabsync

set -e


if [ -e $GABSYNC ]; then
        $GABSYNC -a sync

But the daily execution is not enough because I want to reflect a adduser oder deluser action immediately to the GAB. So initially I tried by creating a symlink to the existing script:

$ ln -s /etc/cron.daily/z-push-gabsync /etc/kopano/userscripts/createuser.d/ && ls -lh

-rwxr-xr-x 1 root root 429 Mai 17 09:19 00createstore
lrwxrwxrwx 1 root root  30 Mai 28 17:11 z-push-gabsync -> /etc/cron.daily/z-push-gabsync

Unfortunately this doesn’t work. I thought the reason could be the symlink so I reverted this change and created a real file (no symlink) within /etc/kopano/userscripts/createuser.d/ directory and named it 10z-push-gabsync:

$ cat /etc/kopano/userscripts/createuser.d/10z-push-gabsync

set -e


if [ -e $GABSYNC ]; then
        $GABSYNC -a sync

But this doesn’t work either. The script is there of course and it’s executable:

$ ls -lh /usr/share/z-push/tools/gab-sync/gab-sync.php

-rwxr-xr-x 1 root root 9,2K Apr 11 19:16 /usr/share/z-push/tools/gab-sync/gab-sync.php

In AD I create a new user and even when I wait 10min this new user is not shown in the global adress book. Even not when in Outlook2013 I click on KOL and the REFRESH GAB.

By trying various stuff out I found out, that the GAB will be synced in following cases:

a) when I execute one of those commands on my Kopano server
kopano-admin -l or kopano-admin --details someuser

b) when I execute the gab sync script manually by /etc/cron.daily/z-push-gabsync or /etc/kopano/userscripts/createuser.d/10z-push-gabsync or /usr/share/z-push/tools/gab-sync/gab-sync.php

  1. any user within WebApp is clicking on the GAB when clicking to compose a new message–>TO:\ field and thus the GAB will be loaded.

In these cases the sync instantly takes place and I even can see it in the window of Outlook2013 when I leave the GAB window open (create new message, clicked on TO:\ field and viewing the GAB)

For me it looks like the sync is triggered only when this ressource actively is “pushed” by a process like those described.

any ideas what I am missing here ? is anything known about this behaviour?

PS: I want to add that I also added the script to /etc/kopano/userscripts/deleteuser.d so the procedure takes please also when a user is deleted from the user directory. This works fine, too but only in the above described manner. Wanted to emphasize that, maybe you could update the wiki article so anyone could also add this script to the userscript deleteuser.d folder, too.

Thanks to anyone in advance for shedding some light into this manner.

what you are describing in a) and 3. is the expected behaviour. If you add a new user to the ldao source Kopano-server (this is exactly the same as it was with zarafa btw) does not automagically know that you added a user.

If you have ˋsync_gab_realtimeˋ to true, then any user getting the gab will trigger the sync, if the setting is set to false, then a ˋkopano-cli --syncˋ will trigger it. In both cases accessing the user directly (when logging in or getting its dateils on the cli) will trigger a sync as well.

This is also explained in the LDAP part of the manual.

for the sake of completeness. b) gets a user list and as explained above therefore triggers the sync as well.

Hello Felix and thanks for the reply. I thought I had miss something, but so this is normal behaviour and everything seems to work fine, glad to hear that.

One more question. As in our case, noone is using WebApp, all employees use Outlook2010 or Outlook2013. When will a sync be initiiated in this case where noone logs into WebApp and no admin is executing a kopano-cli or kopano-admin command ? will the sync take only place next day because I am using cron.daily ? Of course I could put this script into cron.hourly for example, but I want to understand the mechanism how it’s triggered.

Thank you again and have a nice day.

Hi @micro ,

there is no “the server will do a sync automatically every x”, so a sync will only happen when getting a user list or at latest when the user is accessed (log in for example).

Since you are still using the old mapi client. here opening the gab will trigger a sync as well.

So you could add a daily/hourly cron for --sync, or you could show more people the awesome WebApp ;-)


thank you, will do so (hourly.cron). Believe me or not, I tried so many things and even presentations and live demos. Now I also showed them the DeskApp, but …

… noone want to use WebApp, they really don’t like it. They all want to work with Outlook :(

Looks like we have a bug that causes symlinks to get ignored, only processing regular files. derp :-p

thanks for your attention Jan.

try find -type f -xtype f maybe ? good luck and thank you.