Skip to content

Commit ed80259

Browse files
committed
config: dict.md - Update to config-rewrite
1 parent a0e12bd commit ed80259

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

.github/actions/spelling/expect.txt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ backported
5353
badpassword
5454
bantime
5555
barfoo
56+
Basedn
5657
bayes
5758
bcc
5859
benumber
@@ -270,12 +271,10 @@ hdr
270271
hendrik
271272
hexblob
272273
hexlify
273-
hexuc
274274
hhmm
275275
highestmodseq
276276
HIGHESTPVTMODSEQ
277277
Hopmann
278-
hostaddr
279278
hostdomain
280279
hostip
281280
howto
@@ -358,6 +357,7 @@ lda
358357
ldapi
359358
ldapmodify
360359
ldaps
360+
ldaptest
361361
LDFLAGS
362362
ldif
363363
leastconn
@@ -532,7 +532,6 @@ NOCHILDREN
532532
nodelay
533533
nodeps
534534
NOINFERIORS
535-
noiv
536535
nolock
537536
nologin
538537
nonindexable
@@ -580,8 +579,8 @@ opie
580579
opsec
581580
optboolean
582581
optname
583-
orcpt
584582
OR'ing
583+
orcpt
585584
ORing
586585
OSFILE
587586
otherinstance
@@ -642,7 +641,6 @@ qmail
642641
qmgr
643642
QQACg
644643
qresync
645-
qwerty
646644
rampup
647645
randkey
648646
randomfail
@@ -666,7 +664,6 @@ resolv
666664
restorecon
667665
resyncing
668666
rfcs
669-
RHu
670667
Roskakori
671668
roundcube
672669
roundrobin
@@ -731,7 +728,6 @@ socketpath
731728
solib
732729
solrcloud
733730
solrconfig
734-
somedict
735731
sourceforge
736732
sourceuser
737733
sourceware
@@ -799,6 +795,7 @@ tempdisabled
799795
tempfail
800796
tempfailing
801797
terabyte
798+
testadmin
802799
testdomain
803800
testmbox
804801
testpass
@@ -913,11 +910,9 @@ wikis
913910
winbind
914911
wso
915912
xapian
916-
XBAR
917913
xchange
918914
xclient
919915
Xes
920-
XFOO
921916
xfs
922917
xoauth
923918
XRCPTFORWARD

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` | NO | How long to wait for reply, in seconds. (default:30 seconds) |
112+
| `ldap_max_idle_time` | 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_filter` | YES | The ldap filter to use |
118+
| `dict_map_value` | YES | The value to be returned. |
119+
| `dict_map_pattern` | NO | The pattern for the attribute. Defaults to the filter name. |
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)