Proplems removing orphaned folder grants

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
derbärtigefrytz
Posts: 7
Joined: Mon Oct 31, 2016 12:49 pm
Location: Germany

Proplems removing orphaned folder grants

Post by derbärtigefrytz »

Hello everybody.
Some of my users have orphaned folder grants. They granted folder rights to a user, that does not exist. (See below, for reasons.)
The grant shows up in the folder properties of the web client without a name and can be removed there without a problem.

With zmsoap I can find something like this:
zmsoap -z GetShareInfoRequest/owner=homer@bue-gmbh.de @by=name
<share folderPath="/MyFolder" granteeDisplayName="" view="contact" ownerName="Homer Simpson" granteeId="1a02827b-95f7-4c6c-b573-be3d5ebe0b13" rights="r" folderUuid="33e295aa-efc8-4795-8972-6ef281758569" ownerId="20282bf0-3257-470c-b9c9-7297734215fb" granteeType="usr" folderId="307" granteeName="" ownerEmail="homer@bue-gmbh.de"/>

As you see, granteeDisplayName and granteeName are empty, while granteeId is set.
I try to remove the Share by
zmmailbox -z -m homer@bue-gmbh.de mfg "/MyFolder" account "" none
or by
zmmailbox -z -m homer@bue-gmbh.de mfg "/MyFolder" account 1a02827b-95f7-4c6c-b573-be3d5ebe0b13 none

In some cases, this seems to work, in others not. I get no error, however the grant is not removed, but modified to read:
<share folderPath="/MyFolder" granteeDisplayName="guest" view="contact" ownerName="Homer Simpson" granteeId="" rights="" folderUuid="33e295aa-efc8-4795-8972-6ef281758569" ownerId="20282bf0-3257-470c-b9c9-7297734215fb" granteeType="guest" folderId="307" granteeName="guest" ownerEmail="homer@bue-gmbh.de"/>
As you see, granteeType, granteeDisplayName and granteeName are "guest", while granteeId and rights are empty.

When I try to remove it by
zmmailbox -z -m homer@bue-gmbh.de mfg "/MyFolder" account "guest" none
nothing happens. The grant still shows up in the web client and can be removed there.

Is this a bug? Am I missing something?
Can anybody help me, on how to remove the orphans?

More info:
I am testing a disaster recovery scenario.
I exported all mailboxes from ZCS 8.8.6 on Ubuntu 16.04 by
zmmailbox -z -m ... -t 0 getRestURL "//?fmt=tgz" > ....tgz
and I imported them on a new installation of ZCS 8.8.15 on Ubuntu 18.04.5 the reverse way.
The complete recovery is done by cli commands. Due to this, the granteeId seems to be orphaned and does not match a regular user.
I know, how to create the new grants and mounts from my backuped information.
However the orphans will annoy the users.
Can anybody help me, on how to remove them?

Best regards to all Zimbra users.
Frytz
Molanajosef
Posts: 1
Joined: Thu Jan 25, 2024 3:34 pm

Re: Proplems removing orphaned folder grants

Post by Molanajosef »

Handling orphaned folder grants in Zimbra can be tricky. It seems like you've already attempted several approaches using zmsoap and zmmailbox. To address this issue, consider directly accessing the underlying Zimbra database to identify and remove the orphaned entries. Utilize the Zimbra MySQL database and run queries to find and delete records related to the orphaned folder grants. for grants you can check nsfas .
Remember to take a backup of your Zimbra database before performing any direct database operations for safety. If you encounter challenges during this process, reaching out to Zimbra community forums or support channels might provide additional insights tailored to your specific version and setup.
Last edited by Molanajosef on Fri Jan 26, 2024 12:05 pm, edited 2 times in total.
Post Reply