Merge remaining Zentyal changes to openchange master and gets everything sync'ed

@kernevil this code is Zentyal specific, can you make it generic?