Skip to content

Commit

Permalink
global: Convert %short variables to %{long} variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sirainen committed Dec 13, 2024
1 parent 13ae792 commit 8f786c8
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/core/config/auth/databases/pam.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ account required pam_unix.so

For Solaris you will have to edit `/etc/pam.conf`.

Here is a working Solaris example (using [[setting,service_name,%L{service}]]
Here is a working Solaris example (using [[setting,service_name,%{service}]]
instead of the default `dovecot` service):

```
Expand Down
2 changes: 1 addition & 1 deletion docs/core/config/auth/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ See [[link,auth_master_users]] for more information how to configure this.
## OAuth2 Forwarding

If you want to forward [[link,auth_oauth2]] tokens, return field
`proxy_mech=%m` as extra field.
`proxy_mech=%{mechanism}` as extra field.

## Examples

Expand Down
8 changes: 4 additions & 4 deletions docs/core/config/pop3.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ For new POP3 servers, the easiest way to set up UIDLs is to use IMAP's
UIDVALIDITY and UID values. The default is:

```
pop3_uidl_format = %08Xu%08Xv
pop3_uidl_format = %{uid | hex(8)}%{uidvalidity | hex(8)}
```

Another good default is to use the message's global UID:

```
pop3_uidl_format = %g
pop3_uidl_format = %{guid}
```

However, note that GUIDs may not be unique, as the GUID does not change when a
Expand All @@ -124,7 +124,7 @@ done using IMAP, Sieve, or doveadm.)
### MD5 UIDL format (mbox-only)

```
pop3_uidl_format = %m
pop3_uidl_format = %{md5}
```

This works by getting the MD5 sum of a couple of message headers that uniquely
Expand Down Expand Up @@ -162,7 +162,7 @@ calculation:

* X-Delivery-ID: header

If you use [[link,lda]] or IMAP APPEND and [[setting,pop3_uidl_format,%m]]
If you use [[link,lda]] or IMAP APPEND and [[setting,pop3_uidl_format,%{md5}]]
it always appends the X-Delivery-ID: header to saved mailbox. Any existing
X-Delivery-ID: headers in the saved mails are dropped.

Expand Down
3 changes: 0 additions & 3 deletions docs/core/config/shared_mailboxes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ dovecotlinks:
shared_mailboxes_listing:
hash: shared-mailbox-listing
text: shared mailbox listing
shared_mailboxes_percent:
hash: vs
text: \% vs. \%\%
shared_mailboxes_permissions:
hash: filesystem-permissions
text: shared mailboxes filesystem permissions
Expand Down
6 changes: 5 additions & 1 deletion docs/core/config/statistics.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ metric imap_command {
metric login_domains {
filter = event=auth_request_finished
fields = user
group_by = discrete:%L{domain}
group_by user {
method discrete {
modifier = %{value | domain | lower}
}
}
}
```

Expand Down
2 changes: 0 additions & 2 deletions docs/core/config/users/virtual.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,10 @@ mail_driver = maildir
mail_path = /home/%{user | domain}/%{user | username}/Maildir
passdb passwd-file {
auth_username_format = %Ln
passwd_file_path = /home/%{user | domain}/etc/shadow
}
userdb passwd-file {
auth_username_format = %Ln
passwd_file_path = /home/%{user | domain}/etc/passwd
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/core/design/auth_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ when the passdb lookup validity depends only on the username. With
more complex databases such as SQL and LDAP this is created
dynamically based on the password query in the configuration file. If
there are multiple variables, they should be separated so that their
contents don't get mixed, for example `%{user}<TAB>%r<TAB>%l`.
contents don't get mixed, for example `%{user}<TAB>%{rmote_ip}<TAB>%{local_ip}`.
`auth_cache_parse_key()` can be used to easily create a cache key
from a query string.

Expand Down
14 changes: 7 additions & 7 deletions docs/core/plugins/virtual.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,19 +196,19 @@ namespace real {
list = no
hidden = yes
}
```
```[mysql.ext]
# Note: none of the namespaces have inbox=yes. This is because for IMAP users
# you want the inbox namespace to have 'inbox=yes', but for POP3 users you want
# the virtual namespace to have 'inbox=yes'. This requires setting the
# 'inbox=yes' in userdb extra fields. For example with MySQL you can do
# this like:
ser_query = SELECT ..., \
CASE '%s' WHEN 'pop3' THEN NULL ELSE 'yes' END AS 'namespace/inbox/inbox', \
CASE '%s' WHEN 'pop3' THEN 'yes' ELSE NULL END AS 'namespace/virtual/inbox' \
WHERE ...
userdb sql {
query = SELECT ..., \
CASE '%{protocol}' WHEN 'pop3' THEN NULL ELSE 'yes' END AS 'namespace/inbox/inbox', \
CASE '%{protocol}' WHEN 'pop3' THEN 'yes' ELSE NULL END AS 'namespace/virtual/inbox' \
WHERE ...
}
```

```[/etc/dovecot/virtual/INBOX/dovecot-virtual]
Expand All @@ -229,7 +229,7 @@ Also to avoid accidental POP3 UIDL changes, you shouldn't base the UIDLs on
IMAP UIDs. Instead use GUIDs (with Maildir the same as base filename):

```
pop3_uidl_format = %g
pop3_uidl_format = %{guid}
```

## Configuration Examples
Expand Down
4 changes: 2 additions & 2 deletions docs/core/settings/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ Certain settings require specific variables and thus don't use the default
[[variable]]. For example:

```[dovecot.conf]
imap_logout_format = in=%i out=%o
imap_logout_format = in=%{input} out=%{output}
```

Here the `%i` and `%o` refer to variables specific to the
Here the `%{input}` and `%{output}` refer to variables specific to the
[[setting,imap_logout_format]] setting.

## Unsigned Integer
Expand Down
10 changes: 5 additions & 5 deletions docs/howto/convert_password_schemes.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ https://kaworu.ch/blog/2016/04/20/strong-crypt-scheme-with-dovecot-postfixadmin-
# default_pass_scheme = CRYPT
# update your sql query so it will look at the new field
# AND add a %w field in the query so we have the plain password in our
# Enviroment ($PLAIN_PASS)
query = SELECT id as user, newpassword as password, home as userdb_home, uid as userdb_uid, gid as userdb_gid, '%w' as userdb_plain_pass \
# AND add a %{password} field in the query so we have the plain password in
# our Enviroment ($PLAIN_PASS)
query = SELECT id as user, newpassword as password, home as userdb_home, uid as userdb_uid, gid as userdb_gid, '%{password}' as userdb_plain_pass \
FROM users \
WHERE id = '%{user}'
Expand All @@ -48,7 +48,7 @@ https://kaworu.ch/blog/2016/04/20/strong-crypt-scheme-with-dovecot-postfixadmin-
# driver = mysql
# connect = host=127.0.0.1 user=mailauth password=secret dbname=postfixadmin
# default_pass_scheme = SHA512-CRYPT
# query = SELECT username AS user, password, CONCAT('/var/mail/vdomains/', maildir) as userdb_home, 'vmail' as userdb_uid, 'vmail' as userdb_gid, '%w' as userdb_plain_pass \
# query = SELECT username AS user, password, CONCAT('/var/mail/vdomains/', maildir) as userdb_home, 'vmail' as userdb_uid, 'vmail' as userdb_gid, '%{password}' as userdb_plain_pass \
# FROM mailbox \
# WHERE username = '%{user}'
}
Expand Down Expand Up @@ -273,7 +273,7 @@ passdb passwd-file {
userdb passwd-file {
passwd_file_path = /var/vmail/auth.d/%{user | domain}/passwd
fields {
plain_pass = %w
plain_pass = %{password}
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/howto/imapc_proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This is based on already having Dovecot already compiled and installed.
args = host=10.1.2.3
fields {
userdb_imapc_user = %{user}
userdb_imapc_password = %w
userdb_imapc_password = %{password}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/howto/lmtp/exim.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ this problem by extending the *protocol lmtp* section:
```[dovecot.conf]
protocol lmtp {
...
# use %Ln to strip away the domain part
# strip away the domain part
auth_username_format = %{user|lower}
}
```
Expand Down
2 changes: 1 addition & 1 deletion docs/howto/virtual/simple_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ mail_driver = maildir
mail_path = ~/Maildir
# If you're using POP3, you'll need this:
pop3_uidl_format = %g
pop3_uidl_format = %{guid}
# Authentication configuration:
auth_verbose = yes
Expand Down

0 comments on commit 8f786c8

Please sign in to comment.