This is for sharing full mailboxes, not just one or two folders; this will share at the root of the account (this includes all contacts, calendars, briefcases, etc). Our main purpose here is to create a shared mailbox and have it show up in the same Zimbra web UI of the user that has been granted the share (note, this method also allows it to show up in Outlook using Activesync via zpush and the Blackberry mail app using Activesync via zpush).
https://forums.zimbra.org/viewtopic.php?t=30328
In this setup we are going to create an “Inbox Archive” and restricted “Sent” folder so that any incoming or outgoing E-Mail from this account will always be available. The reason for this is that the shared nature of the mailbox leaves the opportunity for things to become lost without others knowing about it.
zmmailbox -z -m shared.mailbox01@domainname.com cf -V message "/Inbox Archive"
zmmailbox -z -m shared.mailbox01@domainname.com afrl -f "Inbox Archive: create 2nd copy of inbound E-mail with limited permissions for shared users" active any date after 19401231 fileinto "/Inbox" fileinto "/Inbox Archive" stop
Here the account shared.mailbox01@domainname.com represents the sharer and person_receiving_share@domainname.com represents the sharee.
zmmailbox -z -m shared.mailbox01@domainname.com mfg / account person_receiving_share@domainname.com rwixd
zmmailbox -z -m shared.mailbox01@domainname.com mfg "Inbox Archive" account person_receiving_share@domainname.com r
zmmailbox -z -m shared.mailbox01@domainname.com mfg /Sent account person_receiving_share@domainname.com rwix
zmmailbox -z -m person_receiving_share@domainname.com createMountpoint /shared.mailbox01@domainname.com shared.mailbox01@domainname.com /
zmprov grr account shared.mailbox01@domainname.com usr person_receiving_share@domainname.com sendAs
zmprov rvr account shared.mailbox01@domainname.com usr person_receiving_share@domainname.com sendAs
zmmailbox -z -m shared.mailbox01@domainname.com mfg / account person_receiving_share@domainname.com none
zmmailbox -z -m shared.mailbox01@domainname.com mfg "Inbox Archive" account person_recieving_share@domainname.com none zmmailbox -z -m shared.mailbox01@domainname.com mfg /Sent account person_recieving_share@domainname.com none
zmmailbox -z -m person_recieving_share@domainname.com deleteFolder /shared.mailbox01@domainname.com
zmmailbox -z -m shared.mailbox01@domainname.com gaf
zmmailbox -z -m shared.mailbox01@domainname.com gfg "/" zmmailbox -z -m shared.mailbox01@domainname.com gfg "/Inbox Archive" zmmailbox -z -m shared.mailbox01@domainname.com gfg "/Sent" zmmailbox -z -m shared.mailbox01@domainname.com gfg "/Inbox"
zmprov ckr account shared.mailbox01@domainname.com person_recieving_share@domainname.com sendAs
Note: Available permissions details: r, rw, rwix, rwixd, rwixda, none.
(r)ead - search, view overviews and items (w)rite - edit drafts/contacts/notes, set flags (i)nsert - copy/add to directory, create subfolders action (x) - workflow actions, like accepting appointments (d)elete - delete items and subfolders, set \Deleted flag (a)dminister - delegate admin and change permissions
For later, a possible script to check all shares on all accounts: https://www.linuxquestions.org/questions/programming-9/hoping-for-help-with-a-shell-script-that-will-allow-me-to-display-all-shared-folders-4175521575/
This is to copy and paste into a text document and replace with your own addresses
zmmailbox -z -m shared.mailbox01@domainname.com cf -V message "/Inbox Archive" zmmailbox -z -m shared.mailbox01@domainname.com afrl -f "Inbox Archive: create 2nd copy of inbound E-mail with limited permissions for shared users" active any date after 19401231 fileinto "/Inbox" fileinto "/Inbox Archive" stop zmmailbox -z -m shared.mailbox01@domainname.com mfg / account person_recieving_share@domainname.com rwixd zmmailbox -z -m shared.mailbox01@domainname.com mfg "Inbox Archive" account person_recieving_share@domainname.com r zmmailbox -z -m shared.mailbox01@domainname.com mfg /Sent account person_recieving_share@domainname.com rwix zmmailbox -z -m person_recieving_share@domainname.com createMountpoint /shared.mailbox01@domainname.com shared.mailbox01@domainname.com / zmprov grr account shared.mailbox01@domainname.com usr person_recieving_share@domainname.com sendAs