File tree Expand file tree Collapse file tree 1 file changed +47
-0
lines changed
source/configuration_manual Expand file tree Collapse file tree 1 file changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,50 @@ Example:
2525 protocol imap {
2626 imap_metadata = yes
2727 }
28+
29+ Storing metadata in SQL dictionary
30+ ==================================
31+
32+ You can store metadata into a database too. This works best with dedicated
33+ table for storing the entries.
34+
35+ Database schema
36+ ---------------
37+
38+ Since username is a primary key, it is required to have some value. When empty,
39+ it means that the value applies to keys with ``shared/ `` prefix. Keys
40+ with ``priv/ `` prefix are expected to have a non-empty username.
41+
42+ .. code :: sql
43+
44+ CREATE TABLE metadata (
45+ username VARCHAR(255) NOT NULL DEFAULT '',
46+ attr_name VARCHAR(255) NOT NULL,
47+ attr_value VARCHAR(65535),
48+ PRIMARY KEY(username, attr_name)
49+ );
50+
51+ Configuration
52+ -------------
53+
54+ Create dictionary config file with following map::
55+
56+ ## driver specific config excluded
57+
58+ map {
59+ pattern = $key
60+ table = attr_priv
61+ fields {
62+ attr_name = $key
63+ }
64+ username_field = username
65+ value_field = attr_value
66+ }
67+
68+ Then in dovecot add::
69+
70+ dict {
71+ metadata = driver:/path/to/config
72+ }
73+
74+ mail_attribute_dict = proxy::metadata
You can’t perform that action at this time.
0 commit comments