Hi,
I've had a hard time trying to upgrade my dovecot 2.3 setup to v. 2.4 (debian 13, Dovecot installed from repo.dovecot.org). One thing I still haven't got to work is mailbox sharing.
I have configured this (full doveconf -n output attached):
mail_driver = mdbox mail_home = /var/spool/vmail/home/%{user | domain}/%{user | username} mail_path = /var/spool/vmail/mail/%{user | domain}/%{user | username} mail_plugins = quota acl
namespace inbox { inbox = yes separator = / }
namespace shared { mail_home = /var/spool/vmail/home/%{owner_domain}/%{owner_username} list = children prefix = shared/$domain/$username/ separator = / subscriptions = no type = shared }
acl_driver = vfile
mail_plugins { acl = yes }
protocol imap { mail_plugins { imap_acl = yes } }
acl_sharing_map { dict file { path = /var/spool/vmail/home/shared-mailboxes } }
Now, given two users: 1: sharing-user@example.com 2: sharing-client@example.net User 1 wants to share his mailbox "4you" to user 2 by setting these acls:
doveadm acl add -u sharing-user@example.com 4you user=sharing-client@example.net lookup read write-seen
But the shared mailbox isn't visible for user 2 (in fact, not even the namespace is, since list = children). acl debug shows this:
doveadm acl debug -u sharing-client@example.net shared/example.com/sharing-user/4you
doveadm(sharing-client@example.net): Error: Mailbox shared/example.com/sharing-user/4you: Mailbox '4you' in namespace shared doesn't exist in /var/spool/vmail/mail/example.net/sharing-client/mailboxes/4you/dbox-Mails
So the shared mailbox is looked for in user 2's mail_path, not in user 1's, who shares it and where the mailbox actually resides.
So, I tried and set mail_path = /var/spool/vmail/path/%{owner_domain}/%{owner_username} for the shared namespace. This does not only seem reasonable but also is mentioned in the second config example here: https://doc.dovecot.org/2.4.4/core/config/shared_mailboxes.html#user-shared-... But that doesn't help. Instead I get:
doveadm acl debug -u sharing-client@example.net shared/example.com/sharing-user/4you
doveadm(sharing-client@example.net): Error: Namespace shared: mail_storage settings: Failed to parse configuration: Failed to expand mail_path setting variables: Unknown variable 'owner_domain' doveadm(sharing-client@example.net): Error: Namespace shared: mail_storage settings: Failed to parse configuration: Failed to expand mail_path setting variables: Unknown variable 'owner_domain' doveadm(sharing-client@example.net): Error: Namespace shared: mail_storage settings: Failed to parse configuration: Failed to expand mail_path setting variables: Unknown variable 'owner_domain' doveadm(sharing-client@example.net): Error: Mailbox shared/example.com/sharing-user/4you: Can't open mailbox shared/example.com/sharing-user/4you: Internal error occurred. Refer to server log for more information. [2026-08-20 14:53:40]
Swapping %{owner_domain} and %{owner_username} in the config above, I get Unknown variable 'owner_username' as error.
If I set mail_path = /var/spool/vmail/mail/example.com/sharing-user i. e. I hard-code the sharing user's mail_path, sharing works for this particular user. But that won't help if a second user wants to share mailboxes too.
doveadm acl debug -u sharing-client@example.net shared/example.com/sharing-user/4you
doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: Mailbox '4you' is in namespace shared doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: Mailbox path: /var/spool/vmail/mail/example.com/sharing-user/mailboxes/4you/dbox-Mails doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: All message flags are shared across users in mailbox doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: User sharing-client@example.net has rights: lookup read write-seen doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: Mailbox found from dovecot-acl-list doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: User sharing-user@example.com found from ACL shared dict doveadm(sharing-client@example.net): Info: Mailbox shared/example.com/sharing-user/4you: Mailbox shared/example.com/sharing-user/4you is visible in LIST
What am I doing wrong? How to do ist right?
-- Regards mks