From 1638bcf426a63cbc8dbb1e4ac5435732d6718d6b Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 27 Nov 2024 11:13:10 +0200 Subject: [PATCH 1/3] fixup: global: Update variable syntax --- docs/core/plugins/mail_crypt.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/plugins/mail_crypt.md b/docs/core/plugins/mail_crypt.md index e12b2a4ec..b6da62c7d 100644 --- a/docs/core/plugins/mail_crypt.md +++ b/docs/core/plugins/mail_crypt.md @@ -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}' } From 30550b8509d642f4673fc0c36dda530d4edb0141 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 27 Nov 2024 11:13:30 +0200 Subject: [PATCH 2/3] upgrading: Add information how variables have been replaced --- docs/installation/upgrade/2.3-to-2.4.md | 2 + .../upgrade/include/2.4-var-expand.inc | 57 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 docs/installation/upgrade/include/2.4-var-expand.inc diff --git a/docs/installation/upgrade/2.3-to-2.4.md b/docs/installation/upgrade/2.3-to-2.4.md index e3cdf913c..9ae5b4840 100644 --- a/docs/installation/upgrade/2.3-to-2.4.md +++ b/docs/installation/upgrade/2.3-to-2.4.md @@ -25,6 +25,8 @@ setup. + + diff --git a/docs/installation/upgrade/include/2.4-var-expand.inc b/docs/installation/upgrade/include/2.4-var-expand.inc new file mode 100644 index 000000000..2abed75c5 --- /dev/null +++ b/docs/installation/upgrade/include/2.4-var-expand.inc @@ -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}` | From d08be5650844aec77eecf242dec34f709e417e5d Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Wed, 27 Nov 2024 11:29:25 +0200 Subject: [PATCH 3/3] var_expand: Fix typo `systemt` => `system` --- .github/actions/spelling/expect.txt | 1 - docs/core/design/var_expand.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 6126b1bb5..29dde44a4 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -784,7 +784,6 @@ sysexits syslogd syslogging sysreport -systemt tabindex TABLEGEN Taddressverification diff --git a/docs/core/design/var_expand.md b/docs/core/design/var_expand.md index a3092c0ec..6d11e2fe0 100644 --- a/docs/core/design/var_expand.md +++ b/docs/core/design/var_expand.md @@ -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