[Dovecot] Syntax of pattern in map section
I can't seem to find any documentation on the meaning/syntax of the "pattern" variable in map sections that are found in dovecot-dict-sql.conf.ext for example. I am trying to setup shared folders.
The only thing[1] I found is:
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
What is a "dict path"? Is this some kind of hard coded identifier in the Dovecot code?
I need to understand how they work because I can't use the example in http://wiki2.dovecot.org/SharedMailboxes/Shared. This is because in my PostreSQL table users are not a single column but two columns with the local and domain part[2]:
Table "public.shared_mailboxes"
Column | Type
-----------------------+------------------------
shared_mailbox_local | character varying(64)
shared_mailbox_domain | character varying(253)
shared_to_local | character varying(64)
shared_to_domain | character varying(253)
How should a map section look in this case?
[1]http://www.dovecot.org/list/dovecot/2009-April/038922.html [2]I did this in order to use REFERENCES to ensure the user exist.
Kind regards
On Sunday 16 February 2014 17:30:33 da-dovecotlist-15@abelonline.de wrote:
I can't seem to find any documentation on the meaning/syntax of the "pattern" variable in map sections that are found in dovecot-dict-sql.conf.ext for example. I am trying to setup shared folders.
I need to understand how they work because I can't use the example in http://wiki2.dovecot.org/SharedMailboxes/Shared. This is because in my PostreSQL table users are not a single column but two columns with the local and domain part
I couldn't find anything myself even after skimming through the code so I created PostgreSQL rules to circumvent the problem. Here they are in case anyone has the same problem.
This is the view I created for listing shared folders:
CREATE VIEW view_shared_mailboxes AS SELECT shared_mailbox_local || '@' || shared_mailbox_domain AS "shared_mailbox", shared_to_local || '@' || shared_to_domain AS "shared_to", 1 AS "dummy" FROM shared_mailboxes;
And these are the rules to enable INSERTSs and DELETEs:
CREATE RULE view_shared_mailboxes_insert AS ON INSERT TO view_shared_mailboxes DO INSTEAD INSERT INTO shared_mailboxes (shared_mailbox_local, shared_mailbox_domain, shared_to_local, shared_to_domain) VALUES (split_part(NEW.shared_mailbox,'@',1), split_part(NEW.shared_mailbox,'@',2), split_part(NEW.shared_to,'@',1), split_part(NEW.shared_to,'@',2));
CREATE RULE view_shared_mailboxes_delete AS ON DELETE TO view_shared_mailboxes DO INSTEAD DELETE FROM shared_mailboxes WHERE shared_mailbox_local = split_part(OLD.shared_mailbox,'@',1) AND shared_mailbox_domain = split_part(OLD.shared_mailbox,'@',2) AND shared_to_local = split_part(OLD.shared_to,'@',1) AND shared_to_domain = split_part(OLD.shared_to,'@',2);
participants (2)
-
Boris
-
da-dovecotlist-15@abelonline.de