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
2 changes: 1 addition & 1 deletion data/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -8338,7 +8338,7 @@ This must be set to \`yes\` if you store indexes to shared filesystems

namespace: {
tags: [ 'namespace' ],
values: setting_types.STRING,
values: setting_types.NAMED_LIST_FILTER,
text: `
Creates a new namespace to the list of namespaces. The filter name refers to
the [[setting,namespace_name]] setting.
Expand Down
11 changes: 2 additions & 9 deletions docs/core/config/auth/databases/ldap.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,8 @@ The following variables can be used inside the [[setting,passdb]] / [[setting,us

| Variable | Description |
| -------- | ----------- |
| `%{ldap:attrName:default}` | Fetches a single-valued attribute. If the attribute is not present, the specified default is taken instead. If there are multiple values, all except the first are ignored (with warning). |
| `%{ldap:attrName}` | If the default is omitted, empty string `""` is assumed. |
| `%{ldap_multi:attrName:sep:default}` | [[added,ldap_multi_added]] Fetches a multi-valued attribute. If the attribute is not present, the specified default is taken instead. If there are multiple values, they are concatenated using sep as the separator. |
| `%{ldap_multi:attrName:sep}` | [[added,ldap_multi_added]] If the default is omitted, empty string is assumed `""`. |
| `%{ldap_multi:attrName::default}` | [[added,ldap_multi_added]] The default for the separator is a single space `" "`. |
| `%{ldap_multi:attrName::}` | [[added,ldap_multi_added]] How to specify a column `":"` as separator, default is `""`. |
| `%{ldap_multi:attrName:::default}` | [[added,ldap_multi_added]] How to specify a column `":"` as separator, default explicitly defined. |
| `%{ldap_multi:attrName:,}` | [[added,ldap_multi_added]] How to specify a comma `","` as separator, default is `""`. |
| `%{ldap_multi:attrName:,:default}` | [[added,ldap_multi_added]] How to specify a comma `","` as separator, default explicitly defined. |
| `%{ldap:attrName}` | Fetches a single-valued attribute. Fails if the attribute is not present, unless the `|default` filter is given. If there are multiple values, all except the first are ignored (with warning). |
| `%{ldap_multi:attrName}` | [[added,ldap_multi_added]] Fetches a multi-valued attribute and outputs the values separated by tabs, with each value "tab-escaped". Use the `list` [[link,settings_variables_filters,filter]] to further convert it to a wanted value. For example: `mail_access_groups = %{ldap_multi:userGroups \| list \| default('mail')}` |
| `%{ldap:dn}` | Retrieves the Distinguished Name of the entry. |

### Multiple Queries via userdbs
Expand Down
4 changes: 2 additions & 2 deletions docs/core/config/auth/databases/passwd.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ the fields to be imported need to be explicitly defined.
userdb passwd {
fields_import_all = no
fields {
uid = %{passwd:uid:vmail}
gid = %{passwd:gid:vmail}
uid = %{passwd:uid}
gid = %{passwd:gid}
home = /var/mail/%{user | username}
mail_driver = maildir
mail_path = /var/mail/%{user | username}/Maildir
Expand Down
2 changes: 1 addition & 1 deletion docs/core/config/auth/databases/passwd_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This iteration works with all doveadm mail commands similarly.
### Variables

[[setting,passdb_fields]] and [[setting,userdb_fields]] can use
`%{passwd_file:<field>[:<default>]}` variables to access the current passdb or
`%{passwd_file:<field>}` variables to access the current passdb or
userdb lookup's fields. The available fields are:

* `uid`
Expand Down
79 changes: 41 additions & 38 deletions docs/core/settings/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ layout: doc
title: Settings Variables
dovecotlinks:
settings_variables: Settings Variables
settings_variables_filters:
hash: list-of-filters
text: Variable Filters
settings_variables_distribution_variables:
hash: distribution-variables
text: Distribution Variables
Expand Down Expand Up @@ -97,44 +100,44 @@ Bytes output type indicates that the output will be tagged as binary output. Sub

| Filter | Input | Output | Description |
| ------ | ----- | ------ | ----------- |
| base64(pad=boolean, url=boolean) | Bytes | String | Base64 encode given input, defaults to pad and not url scheme. |
| benumber | Bytes | Number | Convert big-endian encoded input into a number. |
| concat(any, any...) | Bytes | Bytes | Concatenates input with value(s). Numbers are coerced to strings. Input is optional. |
| decrypt(key=bytes,iv=bytes,raw=boolean,algorithm=string) | Any | Any | Decrypts given input, see [cryptography support](#cryptography-support). |
| decrypt(key=string,salt=string,rounds=number,raw=boolean,hash=string,algorithm=string) | Any | Any | Decrypts given input, see [cryptography support](#cryptography-support). |
| default(value) | String | String | Replace empty or missing input with value. Clears missing variable error. If no value is provided, empty string is used. |
| domain | String | String | Provides domain part of user@domain value. |
| encrypt(key=bytes,iv=bytes,raw=boolean,algorithm=string) | Any | Any | Encrypts given input, see [cryptography support](#cryptography-support). |
| encrypt(key=string,salt=string,rounds=number,raw=boolean,hash=string,algorithm=string) | Any | Any | Encrypts given input, see [cryptography support](#cryptography-support). |
| hash(method, rounds=number, salt=string) | Bytes | Bytes | Returns raw hash from input using given hash method. Rounds and salt are optional. |
| hexlify(width) | Bytes | String | Convert bytes into hex with optional width, truncates or pads up to width. |
| hex(width) | Number | Number | Convert base-10 number to base-16 number. If width is specified the result is truncated or padded with 0 to width. Negative width is applied after number. |
| if(left,operator,right,true,false) | String | String | Evaluates given comparison and returns true or false value. See [conditionals](#conditionals). |
| if(operator,right,true,false) | String | String | Evaluates given comparison against input value and retuns true or false value. |
| index(separator, nth) | String | String | Returns nth element from separator separated string. Zero based. Negative values are looked relative to end of list. |
| ldap_dn | String | String | Converts `domain.com` to `dc=domain,dc=com`. |
| lenumber | Bytes | Number| Convert little-endian encoded input into a number. |
| lfill(width, filler) | Any | Any | Pads value from left with filler until length is width. Default filler is `0`. |
| list(separator) | String | String | Converts tab-escaped list into separator separated list. Defaults to `,`. |
| literal(string) | None | String | Expands into literally the value. If variable is used, works like lookup. Input is ignored. |
| lookup(name) | None | String | Lookup var from table. If var is variable, the name is taken from variable's contents. Input is ignored. |
| lower | String | String | Lowercases input. |
| md5(rounds=number, salt=string) | Bytes | Bytes | Alias for hash with method md5. |
| regexp(expression, replacement) | String | String |Performs regular expression replacement using [POSIX Extended Regular Expression syntax](https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html). Supports up to 9 capture groups. |
| reverse | Any | Any | Reverse input bytes. |
| rfill(width, filler) | Any | Any | Pads value to right with filler until length is width. Default filler is `0`. |
| sha1(rounds=number, salt=string) | Bytes | Bytes | Alias for hash with method sha1. |
| sha256(rounds=number, salt=string) | Bytes | Bytes | Alias for hash with method sha256. |
| sha384(rounds=number, salt=string) | Bytes | Bytes | Alias for hash with method sha384. |
| sha512(rounds=number, salt=string) | Bytes | Bytes | Alias for hash with method sha512. |
| substr(offset, length) | Any | Any | Extracts a substring out of input and returns it. First character is at offset zero. If offset is negative, starts that far back from the end of the string. If length is omitted, returns everything through the end of the string. If length is negative, leaves that many characters off the end of the string. |
| text | Bytes | String | Sanitize input into text and clear binary tag. |
| truncate(len, bits=number) | Bytes | Bytes | Truncate to len bytes, or number of bits. The parameters are mutually exclusive. |
| unbase64(pad=boolean, url=boolean) | String | Bytes | Base64 decode given input, defaults to pad and not url scheme. |
| unhex | String | Number | Convert base-16 number to base-10 number. |
| unhexlify | String | Bytes | Convert hex encoded input into bytes. |
| upper | String | String | Uppercases input. |
| username | String | String | Provides user part of user@domain value. |
| `base64(pad=boolean, url=boolean)` | Bytes | String | Base64 encode given input, defaults to pad and not url scheme. |
| `benumber` | Bytes | Number | Convert big-endian encoded input into a number. |
| `concat(any, any...)` | Bytes | Bytes | Concatenates input with value(s). Numbers are coerced to strings. Input is optional. |
| `decrypt(key=bytes, iv=bytes, raw=boolean, algorithm=string)` | Any | Any | Decrypts given input, see [cryptography support](#cryptography-support). |
| `decrypt(key=string, salt=string, rounds=number, raw=boolean, hash=string, algorithm=string)` | Any | Any | Decrypts given input, see [cryptography support](#cryptography-support). |
| `default(value)` | String | String | Replace empty or missing input with value. Clears missing variable error. If no value is provided, empty string is used. |
| `domain` | String | String | Provides domain part of user@domain value. |
| `encrypt(key=bytes, iv=bytes, raw=boolean, algorithm=string)` | Any | Any | Encrypts given input, see [cryptography support](#cryptography-support). |
| `encrypt(key=string, salt=string, rounds=number, raw=boolean, hash=string, algorithm=string)` | Any | Any | Encrypts given input, see [cryptography support](#cryptography-support). |
| `hash(method, rounds=number, salt=string)` | Bytes | Bytes | Returns raw hash from input using given hash method. Rounds and salt are optional. |
| `hexlify(width)` | Bytes | String | Convert bytes into hex with optional width, truncates or pads up to width. |
| `hex(width)` | Number | Number | Convert base-10 number to base-16 number. If width is specified the result is truncated or padded with 0 to width. Negative width is applied after number. |
| `if(left, operator, right, true, false)` | String | String | Evaluates given comparison and returns true or false value. See [conditionals](#conditionals). |
| `if(operator, right, true, false)` | String | String | Evaluates given comparison against input value and retuns true or false value. |
| `index(separator, nth)` | String | String | Returns nth element from separator separated string. Zero based. Negative values are looked relative to end of list. |
| `ldap_dn` | String | String | Converts `domain.com` to `dc=domain,dc=com`. |
| `lenumber` | Bytes | Number | Convert little-endian encoded input into a number. |
| `lfill(width, filler)` | Any | Any | Pads value from left with filler until length is width. Default filler is `0`. |
| `list(separator)` | String | String | Converts tab-escaped list into separator separated list. Defaults to `,`. |
| `literal(string)` | None | String | Expands into literally the value. If variable is used, works like lookup. Input is ignored. |
| `lookup(name)` | None | String | Lookup var from table. If var is variable, the name is taken from variable's contents. Input is ignored. |
| `lower` | String | String | Lowercases input. |
| `md5(rounds=number, salt=string)` | Bytes | Bytes | Alias for hash with method md5. |
| `regexp(expression, replacement)` | String | String |Performs regular expression replacement using [POSIX Extended Regular Expression syntax](https://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html). Supports up to 9 capture groups. |
| `reverse` | Any | Any | Reverse input bytes. |
| `rfill(width, filler)` | Any | Any | Pads value to right with filler until length is width. Default filler is `0`. |
| `sha1(rounds=number, salt=string)` | Bytes | Bytes | Alias for hash with method sha1. |
| `sha256(rounds=number, salt=string)` | Bytes | Bytes | Alias for hash with method sha256. |
| `sha384(rounds=number, salt=string)` | Bytes | Bytes | Alias for hash with method sha384. |
| `sha512(rounds=number, salt=string)` | Bytes | Bytes | Alias for hash with method sha512. |
| `substr(offset, length)` | Any | Any | Extracts a substring out of input and returns it. First character is at offset zero. If offset is negative, starts that far back from the end of the string. If length is omitted, returns everything through the end of the string. If length is negative, leaves that many characters off the end of the string. |
| `text` | Bytes | String | Sanitize input into text and clear binary tag. |
| `truncate(len, bits=number)` | Bytes | Bytes | Truncate to len bytes, or number of bits. The parameters are mutually exclusive. |
| `unbase64(pad=boolean, url=boolean)` | String | Bytes | Base64 decode given input, defaults to pad and not url scheme. |
| `unhex` | String | Number | Convert base-16 number to base-10 number. |
| `unhexlify` | String | Bytes | Convert hex encoded input into bytes. |
| `upper` | String | String | Uppercases input. |
| `username` | String | String | Provides user part of user@domain value. |

## Global providers

Expand Down