Currently I have a problem with my understanding of public mailboxes with dovecot. What is currently running is postfix together with dovecot (also with dovecot's sasl). Whenever an e-mail reaches my server, one or more userdb-lookups (against my ldap) are done and if the destination address exists, the mailbox is created (location depending on the ldap info) and the mail delivered. Fine.
What I'm now trying to set up is, that if the destination address of the e-mail (e.g. [email protected]) doesn't correspond to a normal accout but rather a group in my ldap (e.g. info), this mailbox should be created as a public mailbox, which can then be subscribed to (I know I would still need to set the ACLs; however I wrote a working dovecot plugin to do this right after creation).
After digging through dovecot's documentation, I ended up with this config:
namespace {
type = private
separator = /
#prefix =
inbox = yes
#subscriptions = yes
}
namespace {
type = public
separator = /
prefix = groups/
location = maildir:/var/vmail/%d/groups/%n/mail:LAYOUT=fs
subscriptions = no
list = children
}
What is working, is that (corresponding to the home and mail location of the group account from ldap) the mailbox is created under /var/vmail/example.com/groups/info Unfortunately this mailbox seems to be created under the private namespace, so obviously dovecot doesn't care about my file structure.
Could you please explain to me, what other parameters are used by dovecot in order to determine, whether a mailbox is private or public? Besides the typical folders, there is the dovecot-acl-list file in the mail folder, but I doubt this could be it; or is it?
Furthermore: do you know, whether dovecot is at all capable to autocreate public mailboxes?
Thank you very much in advance!
Alright, made it on my own. Trial and error brought me to this:
My public mailboxes will now have their mail folders directly under e.g. /var/vmail/example.com/groups/info/, but hey, at least it works now ;)
The reason for my missunderstanding was, that my plugin always reported, the box' namespace would be private. That was because when using dovecot as the LDA (which triggers the autocreation of the mailbox), you don't have a "normal user" context, which could identify this namespace as public.
Thanks anyway to everybody who has read this post!