Configuring Shared Mailbox Dictionaries
james at lottspot.com
james at lottspot.com
Mon Mar 16 13:17:18 UTC 2015
After doing some digging through old mailing list threads, I fonud the
following information on the 'path' directive for dicts.
http://www.dovecot.org/list/dovecot/2009-April/038922.html
It looks like paths are hard coded per plugin, and you simply select one
of the hard coded paths (this is what I gathered from the thread, I have
not verified the accuracy of this).
After taking a romp through the Dovecot source, I was able to gather
that as far as I can tell, the lvalue of anything inside of the fields{}
block will be evaluated as a SQL expression, unless the expression
includes characters '/' or '\\'. So in my case, the following
configuration will *theoretically* meet my needs.
map {
pattern = shared/shared-boxes/user/$to/$from
table = mailbox_user_map
value_field = mailbox_user
fields {
mailbox_user||'@'||mailbox_domain = $from
user_name||'@'||user_domain = $to
}
}
This is untested though, and I have almost certainly overlooked some
devilish detail. Will report back further once I have time to test.
On 2015-03-13 05:48, james at lottspot.com wrote:
> Hello, list!
>
> I am in the midst of configuring a new Dovecot IMAP server, and I'm
> preparing to setup shard mailboxes as part of the ocnfiguration. In
> order to get these setup the way I want, I've figured out that I'm
> going to have to setup an acl_shared_dict. This is where things start
> to get confusing for me, as I have had difficulty finding thorough
> explanations of dictionary configuration.
>
> My primary concern is that all my user details are stored in a sqlite
> database in which the '%n' and '%d' components of username/email
> addresses are stored in separate columns. The SQL dictionary example
> in the Shared Mailboxes document
> [http://wiki2.dovecot.org/SharedMailboxes/Shared] assumes that the
> username is stored as a singular '%n@%d' key. In my authdb lookups, I
> use sqlite syntax to concatenate the '%n' and '%d' columns around a
> '@' character to find the user. Is it possible to implement an
> acl_shared_dict in some similar fashion?
>
> My second question, which is completely unrelated and more out of
> morbid curiosity than anything (although it could affect my
> configuration decisions) is that I noticed every dictionary which
> shows up in the documentation has a "pattern" field. In the case of
> the acl_shared_dict example, the pattern is
> 'shared/shared-boxes/user/$to/$from'. I couldn't figure out by
> studying the example where this value was derived from, or indeed
> where it is derived from in any example dictionaries which are
> documented. Can anyone explain the meaning of the "pattern" field and
> what exactly its value means?
>
> Thanks in advance for all your helpful answers! :)
More information about the dovecot
mailing list