On Wed, 2011-04-06 at 11:54 +0100, Keith Edmunds wrote:
The problem is that there are (naturally) spaces in the folder names, which makes command line manipulation challenging. We've ended up with some astonishingly hacky Python scripts that enter each folder starting with (for example) ".sales" and replacing the dovecot-acl file to try to fulfil the above requests. One day our script are going to get it wrong, or requests will become more complex ("give X access all sales/CustA folders, Y access to all sales/CustB folders, and Z access to all sales folders). There must be a Better Way.
Besides the groups solutions others already mentioned, v2.0.10+ makes this easier:
doveadm mailbox list -u admin@domain "sales/CustA/*" | while read mailbox; do doveadm acl set -u user@domain "$mailbox" user@domain +lrw done