[Dovecot] Is there any more detailed docs about dict configuration
Hi,
I am looking for some help on dict configration. I'm trying to config shared and public mailbox, and use sql as acl backend.
Here is my config:
table:
CREATE TABLE shared_dict
(
id
int(10) NOT NULL AUTO_INCREMENT,
from_user
char(50) NOT NULL,
to_user
char(50) NOT NULL,
status
int(10) NOT NULL DEFAULT '1',
PRIMARY KEY (id
),
KEY from_user
(from_user
),
KEY to_user
(to_user
)
)
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. :)
Detailed on quota/expire dict configration are welcome, too. :)
Thanks!
-- Xueron Nee http://www.xueron.com
There is a log:
dict: sql dict iterate: Invalid/unmapped path: shared/shared-boxes/anyone/
is 'anyone' a default key and queried every time?
On Tue, 07 Apr 2009 16:38:12 +0800 Xueron Nee xueron@xueron.com wrote:
Hi,
I am looking for some help on dict configration. I'm trying to config shared and public mailbox, and use sql as acl backend.
Here is my config: table: CREATE TABLE
shared_dict
(id
int(10) NOT NULL AUTO_INCREMENT,from_user
char(50) NOT NULL,to_user
char(50) NOT NULL,status
int(10) NOT NULL DEFAULT '1', PRIMARY KEY (id
), KEYfrom_user
(from_user
), KEYto_user
(to_user
) )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. :)Detailed on quota/expire dict configration are welcome, too. :)
Thanks!
-- Xueron Nee http://www.xueron.com
-- Xueron Nee http://www.xueron.com
Sometimes a customer of mine, receives from thunderbird the error "Maximum number of channel opens..." or something similar. I've tried to put this :
mail_max_userip_connections=100;
Into dovecot.conf but without results. The customers have 3 IMAP account on the server.
Can you please help me ?
Hi, kako.
On Tue, 2009-04-07 at 15:15 +0200, Kakà wrote:
Sometimes a customer of mine, receives from thunderbird the error "Maximum number of channel opens..." or something similar.
Probably the exact error message would help. I tried googling but didn't find what error you were trying to refer to.
I've tried to put this :
mail_max_userip_connections=100;
If that doesn't help, it's unlikely it's a Dovecot problem.
On Tue, 2009-04-07 at 13:05 -0400, Timo Sirainen wrote:
mail_max_userip_connections=100;
If that doesn't help, it's unlikely it's a Dovecot problem.
Although it depends on where you put it.. Show your dovecot -n output.
Does it helps ? Mmmmmmmmmm
# 1.1.7: /usr/local/etc/dovecot.conf # OS: Linux 2.6.18-92.1.22.el5 i686 CentOS release 5.2 (Final) ext3 base_dir: /var/run/dovecot/ log_path: /var/log/maillog log_timestamp: %Y-%m-%d %H:%M:%S protocols: imap pop3 imaps pop3s ssl_listen: * ssl_disable: yes disable_plaintext_auth: no login_dir: /var/run/dovecot-login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login mail_max_userip_connections: 100 first_valid_uid: 150 last_valid_uid: 150 mail_access_groups: mail mail_location: maildir:/home/vmail/%d/%n/Maildir mail_debug: yes mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 namespace: type: private separator: . prefix: INBOX. inbox: yes list: yes subscriptions: yes auth default: mechanisms: plain login debug_passwords: yes passdb: driver: sql args: /etc/dovecot-mysql.conf userdb: driver: passwd userdb: driver: static args: uid=150 gid=12 home=/home/vmail/%d/%n allow_all_users=yes userdb: driver: sql args: /etc/dovecot-mysql.conf socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: postfix master: path: /var/run/dovecot-auth-master mode: 384 user: vmail
Timo Sirainen ha scritto:
On Tue, 2009-04-07 at 13:05 -0400, Timo Sirainen wrote:
mail_max_userip_connections=100;
If that doesn't help, it's unlikely it's a Dovecot problem.
Although it depends on where you put it.. Show your dovecot -n output.
On Tue, 2009-04-07 at 21:11 +0800, Xueron Nee wrote:
There is a log:
dict: sql dict iterate: Invalid/unmapped path: shared/shared-boxes/anyone/
is 'anyone' a default key and queried every time?
Oh, right, I forgot in my previous mail that "anyone" is queried every time. It contains mailboxes that have been shared to everyone. By default users aren't allowed to share their mailboxes to "anyone", but Dovecot still need to look it up.
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. :)
participants (3)
-
Kakà
-
Timo Sirainen
-
Xueron Nee