[Dovecot] Is there any more detailed docs about dict configuration

Timo Sirainen tss at iki.fi
Fri Apr 17 02:33:24 EEST 2009


On Tue, 2009-04-07 at 16:38 +0800, Xueron Nee wrote:
> dovecot-dict-sql.conf
> map {
>     pattern = shared/shared-boxes/user/$from/$to
>     table   = shared_dict
>     value_field = status
>     fields {
>         from_user = $from
>         to_user   = $to
>     }
> }
> 
> dovecot.conf
> acl_shared_dict = proxy::shared_dict
> 
> It works, and when i use 'setacl', it can add a record.
> 
> All I want are some more detailed docs about the `pattern' line, and
> such as how to add a `group' function. :) 

First you'll need to know what kind of dict paths the code uses. ACL
plugin uses these paths:

shared/shared-boxes/anyone/$owner
shared/shared-boxes/user/$user/$owner
shared/shared-boxes/group/$group/$owner

$owner is the user who is sharing the mailbox. $user and $group are the
users/groups who the mailbox is being shared to.

Next you need to decide how those paths are mapped to SQL. You've
currently mapped only the /user/ part. You could probably combine the
user and group by making that part in the path a $type
(shared/shared-boxes/$type/$id/$owner) and adding a new "type" column to
SQL table that would contain either "user" or "group". But perhaps a
cleaner solution would be to add a whole new table for it, something
like:

map {
    pattern = shared/shared-boxes/group/$group/$owner
    table   = shared_dict_groups
    value_field = status
    fields {
        group = $group
        owner = $owner
    }
}

And something similar for "anyone" if you want to enable it.

Hopefully that works, I haven't tried it. :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20090416/76759cdd/attachment.bin 


More information about the dovecot mailing list