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: [email protected]
2: [email protected]
User 1 wants to share his mailbox "4you" to user 2 by setting these acls:

> # doveadm acl add -u [email protected] 4you 
> [email protected] 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 [email protected] 
> shared/example.com/sharing-user/4you
> doveadm([email protected]): 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-mailboxes
But that doesn't help. Instead I get:

> # doveadm acl debug -u [email protected] 
> shared/example.com/sharing-user/4you
> doveadm([email protected]): Error: Namespace shared: mail_storage 
> settings: Failed to parse configuration: Failed to expand mail_path setting 
> variables: Unknown variable 'owner_domain'
> doveadm([email protected]): Error: Namespace shared: mail_storage 
> settings: Failed to parse configuration: Failed to expand mail_path setting 
> variables: Unknown variable 'owner_domain'
> doveadm([email protected]): Error: Namespace shared: mail_storage 
> settings: Failed to parse configuration: Failed to expand mail_path setting 
> variables: Unknown variable 'owner_domain'
> doveadm([email protected]): 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 [email protected] 
> shared/example.com/sharing-user/4you
> doveadm([email protected]): Info: Mailbox 
> shared/example.com/sharing-user/4you: Mailbox '4you' is in namespace shared
> doveadm([email protected]): Info: Mailbox 
> shared/example.com/sharing-user/4you: Mailbox path: 
> /var/spool/vmail/mail/example.com/sharing-user/mailboxes/4you/dbox-Mails
> doveadm([email protected]): Info: Mailbox 
> shared/example.com/sharing-user/4you: All message flags are shared across 
> users in mailbox
> doveadm([email protected]): Info: Mailbox 
> shared/example.com/sharing-user/4you: User [email protected] has 
> rights: lookup read write-seen
> doveadm([email protected]): Info: Mailbox 
> shared/example.com/sharing-user/4you: Mailbox found from dovecot-acl-list
> doveadm([email protected]): Info: Mailbox 
> shared/example.com/sharing-user/4you: User [email protected] found 
> from ACL shared dict
> doveadm([email protected]): 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

_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to