Skip to content

Commit 5d14649

Browse files
committed
global: Update variable syntax
1 parent 9e5077f commit 5d14649

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+188
-194
lines changed

docs/core/admin/migration.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,22 +213,22 @@ Common settings:
213213
Master password auth:
214214

215215
```
216-
imapc_user = %u
216+
imapc_user = %{user}
217217
imapc_password = supersecret
218218
```
219219

220220
Master user auth:
221221

222222
```
223-
imapc_user = %u
223+
imapc_user = %{user}
224224
imapc_master_user = master-user
225225
imapc_password = master-password
226226
```
227227

228228
Individual password auth:
229229

230230
```
231-
imapc_user = %u
231+
imapc_user = %{user}
232232
233233
# doveadm -o imapc_password=password backup -Ru user imapc:
234234
```
@@ -250,7 +250,7 @@ pop3c_host = hostname
250250
# Authenticate as masteruser / masteruser-secret, but use a separate login
251251
# user.
252252
# If you don't have a master user, remove the pop3c_master_user setting.
253-
pop3c_user = %u
253+
pop3c_user = %{user}
254254
pop3c_master_user = masteruser
255255
pop3c_password = masteruser-secret
256256

docs/core/admin/rawlog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ If your userdb can't return a home directory directly, you can add:
9999
userdb db1 {
100100
# ...
101101
fields {
102-
home = /home/%u
102+
home = /home/%{user}
103103
# or temporarily even e.g. home = /tmp/temp-home
104104
}
105105
}

docs/core/admin/testing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ System configuration
259259
Enable LMTP delivery times in the configuration:
260260

261261
```[dovecot.conf]
262-
deliver_log_format = msgid=%m from=<%f> size=%p vsize=%w session=%{session_time}ms delivery=%{delivery_time}ms: %$
262+
deliver_log_format = msgid=%{msgid} from=<%{from}> size=%{size} vsize=%{vsize} session=%{session_time}ms delivery=%{delivery_time}ms: %{message}
263263
```
264264

265265
You can then see log entries like:
@@ -332,7 +332,7 @@ total_user_count = 800
332332
rampup_time = 0s
333333
334334
user lmtptest {
335-
username_format = testuser%n
335+
username_format = testuser%{num}
336336
count = 100%
337337
338338
mail_inbox_delivery_interval = 1s
@@ -390,7 +390,7 @@ total_user_count = 2000000
390390
rampup_time = 600s
391391
392392
user pop3 {
393-
username_format = testuser%7n
393+
username_format = testuser%{num | fill('0', 7)}
394394
username_start_index = 1
395395
count = 100%
396396
@@ -433,7 +433,7 @@ total_user_count = 4000000
433433
rampup_time = 60s
434434
435435
user imap_poweruser {
436-
username_format = testuser%7n
436+
username_format = testuser%{num | fill('0', 7)}
437437
username_start_index = 2000000
438438
count = 50%
439439

docs/core/config/auth/databases/ldap.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $ ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f doveauth_access.ldif
8383
The two important settings in password lookups are:
8484

8585
- [[setting,ldap_filter]] specifies the LDAP filter how user is found from the
86-
LDAP. You can use all the normal [[variable]] like `%u` in the filter.
86+
LDAP. You can use all the normal [[variable]] like `%{user}` in the filter.
8787

8888
- [[setting,passdb_fields]] specifies a list of attributes that are returned and
8989
how to produce the returned value.
@@ -133,7 +133,7 @@ to the same case as it's in the LDAP database. You can do this by
133133
returning "user" field in [[setting,passdb_fields]] setting, as shown in the above example.
134134

135135
If you can't normalize the username in LDAP, you can alternatively
136-
lowercase the username via [[setting,auth_username_format,%Lu]].
136+
lowercase the username via [[setting,auth_username_format,%{user | lower}]].
137137

138138
#### Use Worker
139139

@@ -160,7 +160,7 @@ A typical configuration would look like:
160160
passdb ldap {
161161
bind = no
162162
default_password_scheme = MD5
163-
ldap_filter = (&(objectClass=posixAccount)(uid=%u))
163+
ldap_filter = (&(objectClass=posixAccount)(uid=%{user}))
164164
fields {
165165
user = %{ldap:uid}
166166
password = %{ldap:userPassword}
@@ -201,7 +201,7 @@ Example:
201201
```[dovecot.conf]
202202
passdb ldap {
203203
bind = yes
204-
ldap_filter = (&(objectClass=posixAccount)(uid=%u))
204+
ldap_filter = (&(objectClass=posixAccount)(uid=%{user}))
205205
fields {
206206
user = %{ldap:uid}
207207
}
@@ -224,14 +224,14 @@ so the prefetch optimization doesn't help.
224224
If you're using DN template, [[setting,passdb_fields]] and [[setting,ldap_filter]] settings
225225
are completely ignored. That means you can't make passdb return any
226226
[[link,passdb_extra_fields]]. You should also set
227-
[[setting,auth_username_format,%Lu]] in `dovecot.conf` to normalize the
227+
[[setting,auth_username_format,%{user | lower}]] in `dovecot.conf` to normalize the
228228
username by lowercasing it.
229229

230230
::: code-group
231231
```[dovecot.conf]
232232
passdb ldap {
233233
bind = yes
234-
bind_userdn = cn=%u,ou=people,o=org
234+
bind_userdn = cn=%{user},ou=people,o=org
235235
}
236236
```
237237
:::
@@ -355,7 +355,7 @@ The most important settings are:
355355

356356
::: code-group
357357
```[dovecot.conf]
358-
passdb_ldap_bind_userdn = %u
358+
passdb_ldap_bind_userdn = %{user}
359359
passdb_ldap_bind = yes
360360
```
361361
:::
@@ -403,15 +403,15 @@ distinct values inside each [[setting,passdb]] / [[setting,userdb]] section):
403403

404404
::: code-group
405405
```[dovecot.conf]
406-
ldap_filter = (mailRoutingAddress=%u)
406+
ldap_filter = (mailRoutingAddress=%{user})
407407
```
408408
:::
409409

410410
- How to iterate through all the valid usernames:
411411

412412
::: code-group
413413
```[dovecot.conf]
414-
ldap_filter = (mailRoutingAddress=%u)
414+
ldap_filter = (mailRoutingAddress=%{user})
415415
ldap_iterate_filter = (objectClass=messageStoreRecipient)
416416
iterate_fields {
417417
user = %{ldap:mailRoutingAddress}
@@ -434,7 +434,7 @@ The following variables can be used inside the [[setting,passdb]] / [[setting,us
434434
| `%{ldap_multi:attrName:::default}` | [[added,ldap_multi_added]] How to specify a column `":"` as separator, default explicitly defined. |
435435
| `%{ldap_multi:attrName:,}` | [[added,ldap_multi_added]] How to specify a comma `","` as separator, default is `""`. |
436436
| `%{ldap_multi:attrName:,:default}` | [[added,ldap_multi_added]] How to specify a comma `","` as separator, default explicitly defined. |
437-
| `%{ldap_dn}` | Retrieves the Distinguished Name of the entry. |
437+
| `%{ldap:dn}` | Retrieves the Distinguished Name of the entry. |
438438

439439
### Multiple Queries via userdbs
440440

@@ -463,7 +463,7 @@ userdb ldap2 {
463463

464464
### Variables and Domains
465465

466-
User names and domains may be distinguished using the Variables `%n` and `%d`.
466+
User names and domains may be distinguished using the Variables `%{username}` and `%{domain}`.
467467
They split the previous username at the `@` character.
468468

469469
The previous username is:
@@ -477,19 +477,19 @@ The previous username is:
477477
If the (LDAP) password database has:
478478
```
479479
fields {
480-
user = %n
480+
user = %{username}
481481
}
482482
```
483483
then the domain part of the login name will be stripped by the password database.
484484

485-
- The userdb will not see any domain part, i.e. `%n` and `%u` are the same
485+
- The userdb will not see any domain part, i.e. `%{username}` and `%{user}` are the same
486486
thing for the userdb. The userdb may set a new username, too, using:
487487
```
488488
fields {
489489
user = ...
490490
}
491491
```
492-
This will be used for Logging `%u` and `%d`
492+
This will be used for Logging `%{user}` and `%{domain}`
493493
variables in other parts of the configuration (e.g. quota file names).
494494

495495
::: code-group
@@ -540,7 +540,7 @@ them globally with [[setting,mail_uid]] and [[setting,mail_gid]] settings instea
540540
returning them from LDAP.
541541

542542
```
543-
ldap_filter = (&(objectClass=posixAccount)(uid=%u))
543+
ldap_filter = (&(objectClass=posixAccount)(uid=%{user}))
544544
ldap_iterate_filter = (objectClass=posixAccount)
545545
fields {
546546
home = %{ldap:homeDirectory}
@@ -580,12 +580,12 @@ fields {
580580
```
581581

582582
You can add static fields that aren't looked up from LDAP. For example
583-
create a "mail_path" field with value `/var/vmail/%d/%n/Maildir`:
583+
create a "mail_path" field with value `/var/vmail/%{domain}/%{username}/Maildir`:
584584

585585
```
586586
fields {
587587
quota_storage_size = %{ldap:quotaBytes}B
588-
mail_path = /var/vmail/%d/%n/Maildir
588+
mail_path = /var/vmail/%{domain}/%{username}/Maildir
589589
}
590590
```
591591

@@ -596,17 +596,17 @@ userDomain attribute doesn't exist, example.com is used instead.
596596
### Variables and Domains
597597

598598
User names and domains may be distinguished using the [[variable]]
599-
`%n` and `%d`. They split the *previous username* at the "@" character. The
599+
`%{username}` and `%{domain}`. They split the *previous username* at the "@" character. The
600600
*previous username* is:
601601

602602
- For LMTP, it will be `user@hostname`, where hostname depends on e.g.
603603
the Postfix configuration.
604604

605605
- For IMAP, it will be whatever the password database has designated as
606606
the username. If the (LDAP) password database [[setting,passdb_fields ]]
607-
contains `user=%n`, then the domain part of the login name will be stripped by
607+
contains `user=%{username}`, then the domain part of the login name will be stripped by
608608
the password database. The userdb will not see any domain part, i.e.
609-
%n and %u are the same thing for the userdb.
609+
%{username} and %{user} are the same thing for the userdb.
610610

611611
The userdb may set a new username, too, using
612612
```
@@ -619,5 +619,5 @@ This will be used for:
619619

620620
- Logging
621621

622-
- `%u` and `%d` variables in other parts of the configuration (e.g. quota
622+
- `%{user}` and `%{domain}` variables in other parts of the configuration (e.g. quota
623623
file names)

docs/core/config/auth/databases/oauth2.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ passdb static {
100100
fields {
101101
nopassword = yes
102102
proxy = yes
103-
proxy_mech = %m
103+
proxy_mech = %{mech}
104104
# ...
105105
}
106106
}
@@ -113,7 +113,7 @@ oauth2 {
113113
# ...
114114
fields {
115115
proxy = y
116-
proxy_mech = %m
116+
proxy_mech = %{mech}
117117
}
118118
}
119119
```

docs/core/config/auth/databases/passwd_file.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ You can use all [[variable]] in the passwd-file filenames, for example:
6060
```[dovecot.conf]
6161
passdb passwd-file {
6262
# Each domain has a separate passwd-file:
63-
passwd_file_path = /etc/auth/%d/passwd
63+
passwd_file_path = /etc/auth/%{domain}/passwd
6464
}
6565
```
6666

@@ -82,16 +82,16 @@ userdb lookup's fields. The available fields are:
8282
```[dovecot.conf]
8383
passdb passwd-file {
8484
default_password_scheme = plain-md5
85-
auth_username_format = %n
85+
auth_username_format = %{username}
8686
passwd_file_path = /etc/imap.passwd
8787
}
8888
userdb passwd-file {
89-
auth_username_format = %n
89+
auth_username_format = %{username}
9090
passwd_file_path = /etc/imap.passwd
9191
fields {
9292
uid:default = vmail
9393
gid:default = vmail
94-
home:default = /home/vmail/%u
94+
home:default = /home/vmail/%{user}
9595
}
9696
}
9797
```
@@ -159,12 +159,12 @@ other `userdb` and `passdb` sections:
159159

160160
```
161161
passdb passwd-file {
162-
auth_username_format = %n
162+
auth_username_format = %{username}
163163
passwd_file_path = /path/to/file-with-encrypted-passwords
164164
}
165165
166166
userdb passwd-file {
167-
auth_username_format = %n
167+
auth_username_format = %{username}
168168
passwd_file_path = /path/to/file-with-encrypted-passwords
169169
}
170170
```

docs/core/config/auth/databases/prefetch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mysql localhost {
7373
passdb sql {
7474
query = SELECT userid AS user, password, home AS userdb_home, uid AS userdb_uid, gid AS userdb_gid \
7575
FROM users \
76-
WHERE userid = '%u'
76+
WHERE userid = '%{user}'
7777
}
7878
}
7979
@@ -82,6 +82,6 @@ userdb prefetch {
8282
8383
# The userdb below is used only by lda.
8484
userdb sql {
85-
query = SELECT home, uid, gid FROM users WHERE userid = '%u'
85+
query = SELECT home, uid, gid FROM users WHERE userid = '%{user}'
8686
}
8787
```

0 commit comments

Comments
 (0)