Skip to content

Commit b2d9a80

Browse files
committed
global: Update variable syntax
1 parent 120263c commit b2d9a80

Some content is hidden

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

50 files changed

+221
-216
lines changed

.github/actions/spelling/allow.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,8 @@ spnego
2525
ssh
2626
ubuntu
2727
workarounds
28+
lfill
29+
ond
30+
retuns
31+
rfill
32+
Uppercases

data/settings.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4333,7 +4333,7 @@ If \`no\`, there will be no report for the authentication result.`
43334333
},
43344334

43354335
auth_policy_request_attributes: {
4336-
default: 'login=%{requested_username} pwhash=%{hashed_password} remote=%{rip} device_id=%{client_id} protocol=%{protocol} session_id=%{session} fail_type=%{fail_type}',
4336+
default: 'login=%{requested_username} pwhash=%{hashed_password} remote=%{remote_ip} device_id=%{client_id} protocol=%{protocol} session_id=%{session} fail_type=%{fail_type}',
43374337
changed: {
43384338
settings_auth_policy_request_attributes_changed: `
43394339
Default has changed.`
@@ -7095,8 +7095,8 @@ The details of how this setting works depends on the used protocol:
70957095
: ID command can be used to override:
70967096
70977097
* Session ID
7098-
* Client IP and port (\`%{rip}\`, \`%{rport}\`)
7099-
* Server IP and port (\`%{lip}\`, \`%{lport}\`)
7098+
* Client IP and port (\`%{remote_ip}\`, \`%{remote_port}\`)
7099+
* Server IP and port (\`%{local_ip}\`, \`%{local_port}\`)
71007100
71017101
\`forward_*\` fields can be sent to auth process's passdb lookup
71027102
@@ -7107,7 +7107,7 @@ The details of how this setting works depends on the used protocol:
71077107
: XCLIENT command can be used to override:
71087108
71097109
* Session ID
7110-
* Client IP and port (\`%{rip}\`, \`%{rport}\`)
7110+
* Client IP and port (\`%{remote_ip}\`, \`%{remote_port}\`)
71117111
71127112
\`forward_*\` fields can be sent to auth process's passdb lookup
71137113
@@ -7118,7 +7118,7 @@ The details of how this setting works depends on the used protocol:
71187118
: XCLIENT command can be used to override:
71197119
71207120
* Session ID
7121-
* Client IP and port (\`%{rip}\`, \`%{rport}\`)
7121+
* Client IP and port (\`%{remote_ip}\`, \`%{remote_port}\`)
71227122
71237123
The trust is always checked against the connecting IP address.
71247124
Except if HAProxy is used, then the original client IP address is used.
@@ -7127,7 +7127,7 @@ The details of how this setting works depends on the used protocol:
71277127
: XCLIENT command can be used to override:
71287128
71297129
* Session ID
7130-
* Client IP and port (\`%{rip}\`, \`%{rport}\`)
7130+
* Client IP and port (\`%{remote_ip}\`, \`%{remote_port}\`)
71317131
* HELO - Overrides what the client sent earlier in the EHLO command
71327132
* LOGIN - Currently unused
71337133
* PROTO - Currently unused
@@ -7141,7 +7141,7 @@ The details of how this setting works depends on the used protocol:
71417141
: XCLIENT command can be used to override:
71427142
71437143
* Session ID
7144-
* Client IP and port (\`%{rip}\`, \`%{rport}\`)
7144+
* Client IP and port (\`%{remote_ip}\`, \`%{remote_port}\`)
71457145
* HELO - Overrides what the client sent earlier in the LHLO command
71467146
* LOGIN - Currently unused
71477147
* PROTO - Currently unused
@@ -8700,7 +8700,7 @@ Configures a modifier string for values grouped by the
87008700
\`%{value}\`
87018701
: The original value.
87028702
8703-
\`%{domain}\`
8703+
\`%{user | domain}\`
87048704
: If the value is in \`user@domain\` format, this contains the \`domain\`
87058705
text. Otherwise empty.`
87068706
},

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 `%{user | username}` and `%{user | 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 = %{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. `%{user | 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 `%{user | 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/%{user | domain}/%{user | 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/%{user | domain}/%{user | 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+
`%{user | username}` and `%{user | 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=%{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+
%{user | 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 `%{user | domain}` variables in other parts of the configuration (e.g. quota
623623
file names)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function auth_passdb_lookup(req)
5656
end
5757
5858
function auth_passdb_get_cache_key()
59-
return "%{username}\t%{protocol}"
59+
return "%{user | username}\t%{protocol}"
6060
end
6161
```
6262
:::

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ passdb static {
100100
fields {
101101
nopassword = yes
102102
proxy = yes
103-
proxy_mech = %m
104-
# ...
103+
proxy_mech = %{mechanism}
104+
# ...
105105
}
106106
}
107107
```
@@ -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.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ For example:
3333
```[dovecot.conf]
3434
userdb passwd {
3535
fields {
36-
home = /var/mail/%{username}
36+
home = /var/mail/%{user | username}
3737
mail_driver = maildir
38-
mail_path = /var/mail/%{username}/Maildir
38+
mail_path = /var/mail/%{user | username}/Maildir
3939
}
4040
}
4141
```
@@ -53,9 +53,9 @@ userdb passwd {
5353
fields {
5454
uid = %{passwd:uid:vmail}
5555
gid = %{passwd:gid:vmail}
56-
home = /var/mail/%{username}
56+
home = /var/mail/%{user | username}
5757
mail_driver = maildir
58-
mail_path = /var/mail/%{username}/Maildir
58+
mail_path = /var/mail/%{user | username}/Maildir
5959
}
6060
}
6161
```

0 commit comments

Comments
 (0)