Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ sysexits
syslogd
syslogging
sysreport
systemt
tabindex
TABLEGEN
Taddressverification
Expand Down
2 changes: 1 addition & 1 deletion docs/core/design/var_expand.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dovecotlinks:
# Variable expansion design

Dovecot comes with powerful variable expansion system, which allows constructing reusable text templates.
This has been upgraded since v2.3 to a more flexible systemt .
This has been upgraded since v2.3 to a more flexible system.

## Syntax

Expand Down
2 changes: 1 addition & 1 deletion docs/core/plugins/mail_crypt.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ provided via password query:

```[dovecot.conf]
passdb sql {
query = SELECT email as user, password, '%Mw' AS userdb_crypt_user_key_password \
query = SELECT email as user, password, '%{password | sha256}' AS userdb_crypt_user_key_password \
FROM virtual_users \
WHERE email='%{user}'
}
Expand Down
2 changes: 2 additions & 0 deletions docs/installation/upgrade/2.3-to-2.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ setup.

<!-- @include: include/2.4-redesign.inc -->

<!-- @include: include/2.4-var-expand.inc -->

<!-- @include: include/2.4-directory-hashing.inc -->

<!-- @include: include/2.4-unknown-invalid-variables.inc -->
Expand Down
57 changes: 57 additions & 0 deletions docs/installation/upgrade/include/2.4-var-expand.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#### Variable expansion

A new [[link,var_expand]] syntax has been introduced.
All old one-letter %variables have been removed,
and some old variable aliases have been dropped too.

##### List of common short variables and their replacements.

| Old variable | New syntax |
| -------- | ---------- |
| `%a` | `%{local_port}` |
| `%b` | `%{remote_port}` |
| `%c` | `%{certificate}` |
| `%c` | `%{secured}` |
| `%d` | `%{user \| domain }` |
| `%h` | `%{home}` |
| `%l` | `%{local_ip }` |
| `%m` | `%{mechanism}` |
| `%n` | `%{user \| username }` |
| `%p` | `%{client_pid }` |
| `%r` | `%{remote_ip }` |
| `%s` | `%{protocol}` |
| `%u` | `%{user}` |
| `%w` | `%{password}` |

##### Common modifier syntaxes and their replacements.

| Old syntax | New syntax |
| ---------- | ---------- |
| `%1Mu` | `%{user \| md5 \| hexlify(1)}` |
| `%2.1Mu` | `%{user \| md5 \| hexlify \| substr(2,1)}` |
| `%2.256N` | `%{ user \| md5 \| substr(0, 8) % 256 \| hex(2)}` |
| `%256Nu` | `%{ user \| md5 \| substr(0, 8) % 256 \| hex}` |
| `%Hu` | No conversion available, use one of the syntaxes. |
| `%Ln` | `%{user \| username \| lower }` |
| `%Lu` | `%{user \| lower }` |
| `%Mu` | `%{user \| md5}` |

##### Common long variables and their replacements.

| Old variable | New syntax |
| ------------ | ------------ |
| `%{auth_domain}` | `%{auth_user \| domain}` |
| `%{auth_username}` | `%{auth_user \| username}` |
| `%{lip}` | `%{local_ip}` |
| `%{lport}` | `%{local_port}` |
| `%{mech}` | `%{mechanism}` |
| `%{orig_domain }` | `%{original_user \| domain }` |
| `%{orig_username}` | `%{original_user \| username }` |
| `%{orig_user}` | `%{original_user}` |
| `%{real_lip}` | `%{real_local_ip}` |
| `%{real_lport}` | `%{real_local_port }` |
| `%{real_rip}` | `%{real_remote_ip }` |
| `%{real_rport}` | `%{real_remote_port}` |
| `%{rip}` | `%{remote_ip}` |
| `%{rport}` | `%{remote_port }` |
| `%{service}` | `%{protocol}` |