Skip to content

Commit a13cb4c

Browse files
committed
in progress
1 parent a0e12bd commit a13cb4c

File tree

1 file changed

+40
-29
lines changed

1 file changed

+40
-29
lines changed

docs/core/config/dict.md

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -81,51 +81,62 @@ See [[link,auth_ldap]].
8181

8282
::: code-group
8383
```[dovecot.conf]
84-
dict_legacy {
85-
somedict = ldap:/path/to/dovecot-ldap-dict.conf.ext
84+
dict_server {
85+
dict ldaptest {
86+
driver = ldap
87+
ldap_uris = ldap://{{LDAPHOST}}
88+
ldap_auth_dn = uid=testadmin,cn=users,dc=dovecot,dc=net
89+
ldap_auth_dn_password = testadmin
90+
ldap_timeout_secs = 5
91+
ldap_base = dc=dovecot,dc=net
92+
ldap_starttls = no
93+
ssl_client_require_valid_cert = no
94+
95+
dict_map priv/test/home {
96+
ldap_filter = (&(homeDirectory=*)(uid=%{user}))
97+
value = %{ldap:homeDirectory}
98+
}
99+
}
86100
}
87101
```
88102
:::
89103

90-
#### LDAP Parameters
91-
92-
| Parameter | Required | Description |
93-
| --------- | -------- | ----------- |
94-
| `uri` | **YES** | LDAP connection URI as expected by OpenLDAP. |
95-
| `bind_dn` | NO | DN or upn to use for binding. (default: none) |
96-
| `debug` | NO | Enable debug. `0` = off (default), `1` = on. |
97-
| `password` | NO | Password to use, only SIMPLE auth is supported at the moment. (default: none) |
98-
| `timeout` | NO | How long to wait for reply, in seconds. (default:30 seconds) |
99-
| `max_idle_time` | NO | Disconnect from LDAP server after connection has been idle for this many seconds. (default: never) |
100-
| `tls` | NO | Use TLS?<br/>`yes`: Require either ldaps or successful start TLS<br/> `try`: Send start TLS if necessary (default)<br/> `no`: Do not send start TLS. |
104+
#### LDAP Settings
105+
106+
| Parameter | Mandatory | Description |
107+
| --------- | --------- | ----------- |
108+
| `ldap_uris` | **YES** | LDAP connection URI as expected by OpenLDAP. |
109+
| `ldap_auth_dn` | NO | DN or upn to use for binding. |
110+
| `ldap_auth_dn_password` | NO | Password to use, only SIMPLE auth is supported at the moment. |
111+
| `ldap_timeout_secs` | NO | How long to wait for reply, in seconds. (default:30 seconds) |
112+
| `ldap_max_idle_time_secs` | NO | Disconnect from LDAP server after connection has been idle for this many seconds. |
113+
| `ldap_debug_level` | NO | Enable debug. `0` = off, `1` = on. |
114+
| `ldap_starttls` | NO | Causes starttls on a cleartext ldap channel |
115+
| `ldap_base` | NO | Basedn for the search |
116+
| `ldap_scope` | NO | Scope of the search |
117+
| `ldap_timeout` | NO | Timeout for dict side of ldap connection | FIXME-MB!!!
118+
| `ldap_filter` | YES | The ldap filter to use |
119+
| `dict_map_value` | YES | The value to be returned. |
101120

102121
#### Examples
103122

104123
To map a key to a search:
105124

106125
```
107-
map {
108-
pattern = priv/test/mail
109-
filter = (mail=*) # the () is required
110-
base_dn = ou=container,dc=domain
111-
username_attribute = uid # default is cn
112-
value_attribute = mail
126+
dict_map priv/test/mail {
127+
ldap_filter = (&(uid=%{user})(mail=*))
128+
ldap_base = ou=container,dc=domain
129+
value = %{ldap:mail}
113130
}
114131
```
115132

116133
To do a more complex search:
117134

118135
```
119-
map {
120-
pattern = priv/test/mail/$location
121-
filter = (&(mail=*)(location=%{location}) # the () is required
122-
base_dn = ou=container,dc=domain
123-
username_attribute = uid # default is cn
124-
value_attribute = mail
125-
126-
fields {
127-
location=$location
128-
}
136+
dict_map priv/test/mail/$location {
137+
ldap_filter = (&(uid=%{user})(mail=*)(uid=%{pattern:location}))
138+
ldap_base = ou=container,dc=domain
139+
value = %{ldap:mail}
129140
}
130141
```
131142

0 commit comments

Comments
 (0)