Docs: clarify downconversion of internationalized addresses
[exim.git] / doc / doc-docbook / spec.xfpt
index 19888e96d052b06df3f11f9a7b4ad02935cc283a..4069c29dbb5300d0f54e9773185b1dd51a65db72 100644 (file)
@@ -52,7 +52,7 @@
 .set I   "    "
 
 .macro copyyear
-2019
+2020
 .endmacro
 
 . /////////////////////////////////////////////////////////////////////////////
@@ -1399,16 +1399,21 @@ If the &%domains%& option is set, the domain of the address must be in the set
 of domains that it defines.
 .next
 .vindex "&$local_part_prefix$&"
+.vindex "&$local_part_prefix_v$&"
 .vindex "&$local_part$&"
 .vindex "&$local_part_suffix$&"
+.vindex "&$local_part_suffix_v$&"
 .cindex affix "router precondition"
 If the &%local_parts%& option is set, the local part of the address must be in
 the set of local parts that it defines. If &%local_part_prefix%& or
 &%local_part_suffix%& is in use, the prefix or suffix is removed from the local
 part before this check. If you want to do precondition tests on local parts
 that include affixes, you can do so by using a &%condition%& option (see below)
-that uses the variables &$local_part$&, &$local_part_prefix$&, and
-&$local_part_suffix$& as necessary.
+.new
+that uses the variables &$local_part$&, &$local_part_prefix$&,
+&$local_part_prefix_v$&, &$local_part_suffix$&
+and &$local_part_suffix_v$& as necessary.
+.wen
 .next
 .vindex "&$local_user_uid$&"
 .vindex "&$local_user_gid$&"
@@ -3866,6 +3871,14 @@ This option is not intended for use by external callers. It is used internally
 by Exim in conjunction with the &%-MC%& option. It signifies that the
 remote host supports the ESMTP &_DSN_& extension.
 
+.new
+.vitem &%-MCd%&
+.oindex "&%-MCd%&"
+This option is not intended for use by external callers. It is used internally
+by Exim in conjunction with the &%-d%& option
+to pass on an information string on the purpose of the process.
+.wen
+
 .vitem &%-MCG%&&~<&'queue&~name'&>
 .oindex "&%-MCG%&"
 This option is not intended for use by external callers. It is used internally
@@ -3897,7 +3910,7 @@ messages through the same SMTP connection.
 .oindex "&%-MCS%&"
 This option is not intended for use by external callers. It is used internally
 by Exim in conjunction with the &%-MC%& option, and passes on the fact that the
-SMTP SIZE option should be used on messages delivered down the existing
+ESMTP SIZE option should be used on messages delivered down the existing
 connection.
 
 .vitem &%-MCT%&
@@ -3966,7 +3979,7 @@ user.
 .vitem &%-MG%&&~<&'queue&~name'&>&~<&'message&~id'&>&~<&'message&~id'&>&~...
 .oindex "&%-MG%&"
 .cindex queue named
-.cindex "named queues"
+.cindex "named queues" "moving messages"
 .cindex "queue" "moving messages"
 This option requests that each listed message be moved from its current
 queue to the given named queue.
@@ -4185,6 +4198,7 @@ forces queueing.
 .vitem &%-odqs%&
 .oindex "&%-odqs%&"
 .cindex "SMTP" "delaying delivery"
+.cindex "first pass routing"
 This option is a hybrid between &%-odb%&/&%-odi%& and &%-odq%&.
 However, like &%-odb%& and &%-odi%&, this option has no effect if
 &%queue_only_override%& is false and one of the queueing options in the
@@ -4503,11 +4517,16 @@ appear in the correct order. Each flag is described in a separate item below.
 .cindex "queue" "double scanning"
 .cindex "queue" "routing"
 .cindex "routing" "whole queue before delivery"
+.cindex "first pass routing"
 An option starting with &%-qq%& requests a two-stage queue run. In the first
 stage, the queue is scanned as if the &%queue_smtp_domains%& option matched
 every domain. Addresses are routed, local deliveries happen, but no remote
 transports are run.
 
+.new
+Performance will be best if the &%queue_run_in_order%& option is false.
+.wen
+
 .cindex "hints database" "remembering routing"
 The hints database that remembers which messages are waiting for specific hosts
 is updated, as if delivery to those hosts had been deferred. After this is
@@ -4553,7 +4572,7 @@ for later delivery.
 .vitem &%-q[q][i][f[f]][l][G<name>[/<time>]]]%&
 .oindex "&%-qG%&"
 .cindex queue named
-.cindex "named queues"
+.cindex "named queues" "deliver from"
 .cindex "queue" "delivering specific messages"
 If the &'G'& flag and a name is present, the queue runner operates on the
 queue with the given name rather than the default queue.
@@ -6362,7 +6381,7 @@ All other options are defaulted.
 .code
 local_delivery:
   driver = appendfile
-  file = /var/mail/$local_part
+  file = /var/mail/$local_part_data
   delivery_date_add
   envelope_to_add
   return_path_add
@@ -6370,7 +6389,17 @@ local_delivery:
 # mode = 0660
 .endd
 This &(appendfile)& transport is used for local delivery to user mailboxes in
-traditional BSD mailbox format. By default it runs under the uid and gid of the
+traditional BSD mailbox format.
+
+.new
+We prefer to avoid using &$local_part$& directly to define the mailbox filename,
+as it is provided by a potential bad actor.
+Instead we use &$local_part_data$&,
+the result of looking up &$local_part$& in the user database
+(done by using &%check_local_user%& in the the router).
+.wen
+
+By default &(appendfile)& runs under the uid and gid of the
 local user, which requires the sticky bit to be set on the &_/var/mail_&
 directory. Some systems use the alternative approach of running mail deliveries
 under a particular group instead of using the sticky bit. The commented options
@@ -6646,6 +6675,10 @@ Two different types of data lookup are implemented:
 The &'single-key'& type requires the specification of a file in which to look,
 and a single key to search for. The key must be a non-empty string for the
 lookup to succeed. The lookup type determines how the file is searched.
+.new
+.cindex "tainted data" "single-key lookups"
+The file string may not be tainted
+.wen
 .next
 .cindex "query-style lookup" "definition of"
 The &'query-style'& type accepts a generalized database query. No particular
@@ -6737,11 +6770,42 @@ by default, but has an option to omit them (see section &<<SECTdbmbuild>>&).
 .next
 .cindex "lookup" "dsearch"
 .cindex "dsearch lookup type"
-&(dsearch)&: The given file must be a directory; this is searched for an entry
-whose name is the key by calling the &[lstat()]& function. The key may not
-contain any forward slash characters. If &[lstat()]& succeeds, the result of
-the lookup is the name of the entry, which may be a file, directory,
-symbolic link, or any other kind of directory entry. An example of how this
+&(dsearch)&: The given file must be an
+.new
+absolute
+.wen
+directory path; this is searched for an entry
+whose name is the key by calling the &[lstat()]& function.
+The key may not
+contain any forward slash characters.
+If &[lstat()]& succeeds then so does the lookup.
+.new
+.cindex "tainted data" "dsearch result"
+The result is regarded as untainted.
+
+Options for the lookup can be given by appending them after the word "dsearch",
+separated by a comma.  Options, if present, are a comma-separated list having
+each element starting with a tag name and an equals.
+
+Two options are supported, for the return value and for filtering match
+candidates.
+The "ret" option requests an alternate result value of
+the entire path for the entry. Example:
+.code
+${lookup {passwd} dsearch,ret=full {/etc}}
+.endd
+The default result is just the requested entry.
+The "filter" option requests that only directory entries of a given type
+are matched. The match value is one of "file", "dir" or "subdir" (the latter
+not matching "." or ".."). Example:
+.code
+${lookup {passwd} dsearch,filter=file {/etc}}
+.endd
+The default matching is for any entry type, including directories
+and symlinks.
+.wen
+
+An example of how this
 lookup can be used to support virtual domains is given in section
 &<<SECTvirtualdomains>>&.
 .next
@@ -6789,7 +6853,7 @@ If a selector is numeric, it must apply to a JSON array; the (zero-based)
 nunbered array element is selected.
 Otherwise it must apply to a JSON object; the named element is selected.
 The final resulting element can be a simple JSON type or a JSON object
-or array; for the latter two a string-representation os the JSON
+or array; for the latter two a string-representation of the JSON
 is returned.
 For elements of type string, the returned value is de-quoted.
 .next
@@ -6913,9 +6977,10 @@ be followed by optional colons.
 lookup types support only literal keys.
 
 .next
+.cindex "spf lookup type"
 .cindex "lookup" "spf"
-If Exim is built with SPF support, manual lookups can be done
-(as opposed to the standard ACL condition method.
+&(spf)&: If Exim is built with SPF support, manual lookups can be done
+(as opposed to the standard ACL condition method).
 For details see section &<<SECSPF>>&.
 .endlist ilist
 
@@ -6986,7 +7051,11 @@ passed to a Redis database. See section &<<SECTsql>>&.
 .next
 .cindex "sqlite lookup type"
 .cindex "lookup" "sqlite"
-&(sqlite)&: The format of the query is a filename followed by an SQL statement
+&(sqlite)&: The format of the query is
+new
+an optional filename
+.wen
+followed by an SQL statement
 that is passed to an SQLite database. See section &<<SECTsqlite>>&.
 
 .next
@@ -7893,6 +7962,11 @@ If any MySQL, PostgreSQL, Oracle, InterBase or Redis lookups are used, the
 or &%redis_servers%&
 option (as appropriate) must be set to a colon-separated list of server
 information.
+.oindex &%mysql_servers%&
+.oindex &%pgsql_servers%&
+.oindex &%oracle_servers%&
+.oindex &%ibase_servers%&
+.oindex &%redis_servers%&
 (For MySQL and PostgreSQL, the global option need not be set if all
 queries contain their own server information &-- see section
 &<<SECTspeserque>>&.)
@@ -7943,12 +8017,14 @@ The &%quote_redis%& expansion operator
 escapes whitespace and backslash characters with a backslash.
 
 .section "Specifying the server in the query" "SECTspeserque"
+.new
 For MySQL, PostgreSQL and Redis lookups (but not currently for Oracle and InterBase),
 it is possible to specify a list of servers with an individual query. This is
-done by starting the query with
+done by appending a comma-separated option to the query type:
 .display
-&`servers=`&&'server1:server2:server3:...'&&`;`&
 .endd
+&`,servers=`&&'server1:server2:server3:...'&
+.wen
 Each item in the list may take one of two forms:
 .olist
 If it contains no slashes it is assumed to be just a host name. The appropriate
@@ -7973,14 +8049,25 @@ mysql_servers = slave1/db/name/pw:\
 .endd
 In an updating lookup, you could then write:
 .code
-${lookup mysql{servers=master; UPDATE ...} }
+${lookup mysql,servers=master {UPDATE ...} }
 .endd
 That query would then be sent only to the master server. If, on the other hand,
 the master is not to be used for reading, and so is not present in the global
 option, you can still update it by a query of this form:
 .code
-${lookup pgsql{servers=master/db/name/pw; UPDATE ...} }
+${lookup pgsql,servers=master/db/name/pw {UPDATE ...} }
+.endd
+
+.new
+An older syntax places the servers speciification before the qury,
+semicolon separated:
+.code
+${lookup mysql{servers=master; UPDATE ...} }
 .endd
+The new version avoids potential issues with tainted
+arguments in the query, for explicit expansion.
+&*Note*&: server specifications in list-style lookups are still problematic.
+.wen
 
 
 .section "Special MySQL features" "SECID73"
@@ -8030,19 +8117,35 @@ affected.
 .cindex "sqlite lookup type"
 SQLite is different to the other SQL lookups because a filename is required in
 addition to the SQL query. An SQLite database is a single file, and there is no
-daemon as in the other SQL databases. The interface to Exim requires the name
-of the file, as an absolute path, to be given at the start of the query. It is
-separated from the query by white space. This means that the path name cannot
-contain white space. Here is a lookup expansion example:
+daemon as in the other SQL databases.
+
+.new
+.oindex &%sqlite_dbfile%&
+The preferred way of specifying the file is by using the
+&%sqlite_dbfile%& option, set to
+an absolute path.
+.wen
+A deprecated method is available, prefixing the query with the filename
+separated by white space.
+This means that the path name cannot contain white space.
+.cindex "tainted data" "sqlite file"
+It also means that the query cannot use any tainted values, as that taints
+the entire query including the filename - resulting in a refusal to open
+the file.
+
+.new
+Here is a lookup expansion example:
 .code
-${lookup sqlite {/some/thing/sqlitedb \
-  select name from aliases where id='userx';}}
+sqlite_dbfile = /some/thing/sqlitedb
+...
+${lookup sqlite {select name from aliases where id='userx';}}
 .endd
 In a list, the syntax is similar. For example:
 .code
-domainlist relay_to_domains = sqlite;/some/thing/sqlitedb \
+domainlist relay_to_domains = sqlite;\
    select * from relays where ip='$sender_host_address';
 .endd
+.wen
 The only character affected by the &%quote_sqlite%& operator is a single
 quote, which it doubles.
 
@@ -8232,6 +8335,35 @@ in the previous section. You could also use the &(wildlsearch)& or
 
 
 
+.new
+.section "Results of list checking" SECTlistresults
+The primary result of doing a list check is a truth value.
+In some contexts additional information is stored
+about the list element that matched:
+.vlist
+.vitem hosts
+A &%hosts%& ACL condition
+will store a result in the &$host_data$& variable.
+.vitem local_parts
+A &%local_parts%& router option or &%local_parts%& ACL condition
+will store a result in the &$local_part_data$& variable.
+.vitem domains
+A &%domains%& router option or &%domains%& ACL condition
+.vitem senders
+A &%senders%& router option or &%senders%& ACL condition
+will store a result in the &$sender_data$& variable.
+.vitem recipients
+A &%recipients%& ACL condition
+will store a result in the &$recipient_data$& variable.
+.endlist
+
+The detail of the additional information depends on the
+type of match and is given below as the &*value*& information.
+.wen
+
+
+
+
 .section "Named lists" "SECTnamedlists"
 .cindex "named lists"
 .cindex "list" "named"
@@ -8290,6 +8422,19 @@ domainlist  dom2 = !a.b : *.b
 where &'x.y'& does not match. It's best to avoid negation altogether in
 referenced lists if you can.
 
+.new
+.cindex "hiding named list values"
+.cindex "named lists" "hiding value of"
+Some named list definitions may contain sensitive data, for example, passwords for
+accessing databases. To stop non-admin users from using the &%-bP%& command
+line option to read these values, you can precede the definition with the
+word &"hide"&. For example:
+.code
+hide domainlist filter_for_domains = ldap;PASS=secret ldap::/// ...
+.endd
+.wen
+
+
 Named lists may have a performance advantage. When Exim is routing an
 address or checking an incoming message, it caches the result of tests on named
 lists. So, if you have a setting such as
@@ -8381,6 +8526,12 @@ If a pattern consists of a single @ character, it matches the local host name,
 as set by the &%primary_hostname%& option (or defaulted). This makes it
 possible to use the same configuration file on several different hosts that
 differ only in their names.
+
+.new
+The value for a match will be the primary host name.
+.wen
+
+
 .next
 .cindex "@[] in a domain list"
 .cindex "domain list" "matching local IP interfaces"
@@ -8390,7 +8541,14 @@ in square brackets (as in an email address that contains a domain literal), but
 only if that IP address is recognized as local for email routing purposes. The
 &%local_interfaces%& and &%extra_local_interfaces%& options can be used to
 control which of a host's several IP addresses are treated as local.
-In today's Internet, the use of domain literals is controversial.
+In today's Internet, the use of domain literals is controversial;
+see the &%allow_domain_literals%& main option.
+
+.new
+The value for a match will be the string &`@[]`&.
+.wen
+
+
 .next
 .cindex "@mx_any"
 .cindex "@mx_primary"
@@ -8439,6 +8597,11 @@ involved, it is easiest to change the delimiter for the main list as well:
 domains = <? @mx_any/ignore=<;127.0.0.1;::1 ? \
           an.other.domain ? ...
 .endd
+.new
+The value for a match will be the list element string (starting &`@mx_`&).
+.wen
+
+
 .next
 .cindex "asterisk" "in domain list"
 .cindex "domain list" "asterisk in"
@@ -8451,6 +8614,12 @@ matching works only in terms of dot-separated components. For example, a domain
 list item such as &`*key.ex`& matches &'donkey.ex'& as well as
 &'cipher.key.ex'&.
 
+.new
+The value for a match will be the list element string (starting with the asterisk).
+Additionally, &$0$& will be set to the matched string
+and &$1$& to the variable portion which the asterisk matched.
+.wen
+
 .next
 .cindex "regular expressions" "in domain list"
 .cindex "domain list" "matching regular expression"
@@ -8467,6 +8636,15 @@ must escape any backslash and dollar characters in the regular expression, or
 use the special &`\N`& sequence (see chapter &<<CHAPexpand>>&) to specify that
 it is not to be expanded (unless you really do want to build a regular
 expression by expansion, of course).
+
+.new
+The value for a match will be the list element string (starting with the circumflex).
+Additionally, &$0$& will be set to the string matching the regular expression,
+and &$1$& (onwards) to any submatches identified by parentheses.
+.wen
+
+
+
 .next
 .cindex "lookup" "in domain list"
 .cindex "domain list" "matching by lookup"
@@ -8478,12 +8656,15 @@ must be a filename in a suitable format for the lookup type. For example, for
 domains = cdb;/etc/mail/local_domains.cdb
 .endd
 The appropriate type of lookup is done on the file using the domain name as the
-key. In most cases, the data that is looked up is not used; Exim is interested
+key. In most cases, the value resulting from the lookup is not used; Exim is interested
 only in whether or not the key is present in the file. However, when a lookup
 is used for the &%domains%& option on a router
-or a &%domains%& condition in an ACL statement, the data is preserved in the
+or a &%domains%& condition in an ACL statement, the value is preserved in the
 &$domain_data$& variable and can be referred to in other router options or
 other statements in the same ACL.
+.cindex "tainted data" "de-tainting"
+The value will be untainted.
+
 
 .next
 Any of the single-key lookup type names may be preceded by
@@ -8502,6 +8683,7 @@ original lookup fails. This is not a useful feature when using a domain list to
 select particular domains (because any domain would match), but it might have
 value if the result of the lookup is being used via the &$domain_data$&
 expansion variable.
+
 .next
 If the pattern starts with the name of a query-style lookup type followed by a
 semicolon (for example, &"nisplus;"& or &"ldap;"&), the remainder of the
@@ -8511,17 +8693,37 @@ chapter &<<CHAPfdlookup>>&. For example:
 hold_domains = mysql;select domain from holdlist \
   where domain = '${quote_mysql:$domain}';
 .endd
-In most cases, the data that is looked up is not used (so for an SQL query, for
+In most cases, the value resulting from the lookup is not used (so for an SQL query, for
 example, it doesn't matter what field you select). Exim is interested only in
 whether or not the query succeeds. However, when a lookup is used for the
-&%domains%& option on a router, the data is preserved in the &$domain_data$&
+&%domains%& option on a router, the value is preserved in the &$domain_data$&
 variable and can be referred to in other options.
+.cindex "tainted data" "de-tainting"
+The value will be untainted.
+
+.next
+.new
+If the pattern starts with the name of a lookup type
+of either kind (single-key or query-style) it may be
+followed by a comma and options,
+The options are lookup-type specific and consist of a comma-separated list.
+Each item starts with a tag and and equals "=".
+.wen
+
 .next
 .cindex "domain list" "matching literal domain name"
 If none of the above cases apply, a caseless textual comparison is made
 between the pattern and the domain.
+
+The value for a match will be the list element string.
+.cindex "tainted data" "de-tainting"
+Note that this is commonly untainted
+(depending on the way the list was created).
+This is a useful way of obtaining an untainted equivalent to
+the domain, for later operations.
 .endlist
 
+
 Here is an example that uses several different kinds of pattern:
 .code
 domainlist funny_domains = \
@@ -9709,7 +9911,7 @@ letters appear. For example:
        "&*$bheader_*&<&'header&~name'&>&*:*&&~or&~&&&
         &*$bh_*&<&'header&~name'&>&*:*&" &&&
        "&*$lheader_*&<&'header&~name'&>&*:*&&~or&~&&&
-        &*$lh_*&<&'header&~name'&>&*:*&"
+        &*$lh_*&<&'header&~name'&>&*:*&" &&&
        "&*$rheader_*&<&'header&~name'&>&*:*&&~or&~&&&
         &*$rh_*&<&'header&~name'&>&*:*&"
 .cindex "expansion" "header insertion"
@@ -9815,6 +10017,12 @@ newline at the very end. For the &%header%& and &%bheader%& expansion, for
 those headers that contain lists of addresses, a comma is also inserted at the
 junctions between headers. This does not happen for the &%rheader%& expansion.
 
+.new
+.cindex "tainted data"
+When the headers are from an incoming message,
+the result of expanding any of these variables is tainted.
+.wen
+
 
 .vitem &*${hmac{*&<&'hashname'&>&*}{*&<&'secret'&>&*}{*&<&'string'&>&*}}*&
 .cindex "expansion" "hmac hashing"
@@ -10156,21 +10364,37 @@ ${readsocket{/socket/name}{request string}{3s}}
 .endd
 
 The third argument is a list of options, of which the first element is the timeout
-and must be present if the argument is given.
+and must be present if any options are given.
 Further elements are options of form &'name=value'&.
-Two option types is currently recognised: shutdown and tls.
-The first defines whether (the default)
-or not a shutdown is done on the connection after sending the request.
-Example, to not do so (preferred, eg. by some webservers):
+Example:
 .code
 ${readsocket{/socket/name}{request string}{3s:shutdown=no}}
 .endd
-The second, tls, controls the use of TLS on the connection.  Example:
-.code
-${readsocket{/socket/name}{request string}{3s:tls=yes}}
-.endd
-The default is to not use TLS.
+
+.new
+The following option names are recognised:
+.ilist
+&*cache*&
+Defines if the result data can be cached for use by a later identical
+request in the same process.
+Values are &"yes"& or &"no"& (the default).
+If not, all cached results for this connection specification
+will be invalidated.
+
+.next
+&*shutdown*&
+Defines whether or not a write-shutdown is done on the connection after
+sending the request. Values are &"yes"& (the default) or &"no"&
+(preferred, eg. by some webservers).
+
+.next
+&*tls*&
+Controls the use of TLS on the connection.
+Values are &"yes"& or &"no"& (the default).
 If it is enabled, a shutdown as descripbed above is never done.
+.endlist
+.wen
+
 
 A fourth argument allows you to change any newlines that are in the data
 that is read, in the same way as for &%readfile%& (see above). This example
@@ -12192,6 +12416,15 @@ When the &%smtp_etrn_command%& option is being expanded, &$domain$& contains
 the complete argument of the ETRN command (see section &<<SECTETRN>>&).
 .endlist
 
+.new
+.cindex "tainted data"
+If the origin of the data is an incoming message,
+the result of expanding this variable is tainted.
+When un untainted version is needed, one should be obtained from
+looking up the value in a local (therefore trusted) database.
+Often &$domain_data$& is usable in this role.
+.wen
+
 
 .vitem &$domain_data$&
 .vindex "&$domain_data$&"
@@ -12385,13 +12618,25 @@ Global address rewriting happens when a message is received, so the value of
 because a message may have many recipients and the system filter is called just
 once.
 
-.vindex "&$local_part_prefix$&"
-.vindex "&$local_part_suffix$&"
-.cindex affix variables
-If a local part prefix or suffix has been recognized, it is not included in the
-value of &$local_part$& during routing and subsequent delivery. The values of
-any prefix or suffix are in &$local_part_prefix$& and
-&$local_part_suffix$&, respectively.
+.new
+.cindex "tainted data"
+If the origin of the data is an incoming message,
+the result of expanding this variable is tainted.
+
+&*Warning*&: the content of this variable is usually provided by a potential
+attacker.
+Consider carefully the implications of using it unvalidated as a name
+for file access.
+This presents issues for users' &_.forward_& and filter files.
+For traditional full user accounts, use &%check_local_users%& and the
+&$local_part_data$& variable rather than this one.
+For virtual users, store a suitable pathname component in the database
+which is used for account name validation, and use that retrieved value
+rather than this variable.
+Often &$local_part_data$& is usable in this role.
+If needed, use a router &%address_data%& or &%set%& option for
+the retrieved data.
+.wen
 
 When a message is being delivered to a file, pipe, or autoreply transport as a
 result of aliasing or forwarding, &$local_part$& is set to the local part of
@@ -12433,23 +12678,34 @@ router as &$local_part_data$&. In addition, if the driver routes the address
 to a transport, the value is available in that transport. If the transport is
 handling multiple addresses, the value from the first address is used.
 
+.new
+The &%check_local_user%& router option also sets this variable.
+.wen
+
 &$local_part_data$& is also set when the &%local_parts%& condition in an ACL
 matches a local part by means of a lookup. The data read by the lookup is
 available during the rest of the ACL statement. In all other situations, this
 variable expands to nothing.
 
-.vitem &$local_part_prefix$&
-.vindex "&$local_part_prefix$&"
+.vindex &$local_part_prefix$& &&&
+       &$local_part_prefix_v$& &&&
+       &$local_part_suffix$& &&&
+       &$local_part_suffix_v$&
 .cindex affix variables
-When an address is being routed or delivered, and a
-specific prefix for the local part was recognized, it is available in this
-variable, having been removed from &$local_part$&.
-
-.vitem &$local_part_suffix$&
-.vindex "&$local_part_suffix$&"
-When an address is being routed or delivered, and a
-specific suffix for the local part was recognized, it is available in this
-variable, having been removed from &$local_part$&.
+If a local part prefix or suffix has been recognized, it is not included in the
+value of &$local_part$& during routing and subsequent delivery. The values of
+any prefix or suffix are in &$local_part_prefix$& and
+&$local_part_suffix$&, respectively.
+.new
+.cindex "tainted data"
+If the specification did not include a wildcard then
+the affix variable value is not tainted.
+
+If the affix specification included a wildcard then the portion of
+the affix matched by the wildcard is in
+&$local_part_prefix_v$& or &$local_part_suffix_v$& as appropriate,
+and both the whole and varying values are tainted.
+.wen
 
 .vitem &$local_scan_data$&
 .vindex "&$local_scan_data$&"
@@ -12781,10 +13037,17 @@ or if not set, the value of &$qualify_domain$&.
 
 .vitem &$queue_name$&
 .vindex &$queue_name$&
-.cindex "named queues"
+.cindex "named queues" variable
 .cindex queues named
 The name of the spool queue in use; empty for the default queue.
 
+.vitem &$queue_size$&
+.vindex "&$queue_size$&"
+.cindex "queue" "size of"
+.cindex "spool" "number of messages"
+This variable contains the number of messages queued.
+It is evaluated on demand, but no more often than once every minute.
+
 .vitem &$r_...$&
 .vindex &$r_...$&
 .cindex router variables
@@ -13099,6 +13362,18 @@ library, by setting:
 dns_dnssec_ok = 1
 .endd
 
+.new
+In addition, on Linux with glibc 2.31 or newer the resolver library will
+default to stripping out a successful validation status.
+This will break a previously working Exim installation.
+Provided that you do trust the resolver (ie, is on localhost) you can tell
+glibc to pass through any successful validation with a new option in
+&_/etc/resolv.conf_&:
+.code
+options trust-ad
+.endd
+.wen
+
 Exim does not perform DNSSEC validation itself, instead leaving that to a
 validating resolver (e.g. unbound, or bind with suitable configuration).
 
@@ -14207,6 +14482,7 @@ listed in more than one group.
 .row &%daemon_startup_sleep%&        "time to sleep between tries"
 .row &%extra_local_interfaces%&      "not necessarily listened on"
 .row &%local_interfaces%&            "on which to listen, with optional ports"
+.row &%notifier_socket%&             "override compiled-in value"
 .row &%pid_file_path%&               "override compiled-in value"
 .row &%queue_run_max%&               "maximum simultaneous queue runners"
 .endtable
@@ -14370,6 +14646,7 @@ See also the &'Policy controls'& section above.
 .table2
 .row &%dkim_verify_hashes%&          "DKIM hash methods accepted for signatures"
 .row &%dkim_verify_keytypes%&        "DKIM key types accepted for signatures"
+.row &%dkim_verify_min_keysizes%&    "DKIM key sizes accepted for signatures"
 .row &%dkim_verify_signers%&         "DKIM domains for which DKIM ACL is run"
 .row &%host_lookup%&                 "host name looked up for these hosts"
 .row &%host_lookup_order%&           "order of DNS and local name lookups"
@@ -14518,6 +14795,7 @@ Those options that undergo string expansion before use are marked with
 .cindex "8-bit characters"
 .cindex "log" "selectors"
 .cindex "log" "8BITMIME"
+.cindex "ESMTP extensions" 8BITMIME
 This option causes Exim to send 8BITMIME in its response to an SMTP
 EHLO command, and to accept the BODY= parameter on MAIL commands.
 However, though Exim is 8-bit clean, it is not a protocol converter, and it
@@ -14731,6 +15009,7 @@ That is, set the option to an empty string so that no check is done.
 .option auth_advertise_hosts main "host list&!!" *
 .cindex "authentication" "advertising"
 .cindex "AUTH" "advertising"
+.cindex "ESMTP extensions" AUTH
 If any server authentication mechanisms are configured, Exim advertises them in
 response to an EHLO command only if the calling host matches this list.
 Otherwise, Exim does not advertise AUTH.
@@ -14792,12 +15071,18 @@ just the command name, it is not a complete command line. If an argument is
 required, it must come from the &%-oA%& command line option.
 
 
-.option bounce_message_file main string unset
+.option bounce_message_file main string&!! unset
 .cindex "bounce message" "customizing"
 .cindex "customizing" "bounce message"
 This option defines a template file containing paragraphs of text to be used
 for constructing bounce messages.  Details of the file's contents are given in
-chapter &<<CHAPemsgcust>>&. See also &%warn_message_file%&.
+chapter &<<CHAPemsgcust>>&.
+.new
+.cindex bounce_message_file "tainted data"
+The option is expanded to give the file path, which must be
+absolute and untainted.
+.wen
+See also &%warn_message_file%&.
 
 
 .option bounce_message_text main string unset
@@ -14986,6 +15271,7 @@ may wish to deliberately disable them.
 .option chunking_advertise_hosts main "host list&!!" *
 .cindex CHUNKING advertisement
 .cindex "RFC 3030" "CHUNKING"
+.cindex "ESMTP extensions" CHUNKING
 The CHUNKING extension (RFC3030) will be advertised in the EHLO message to
 these hosts.
 Hosts may use the BDAT command as an alternate to DATA.
@@ -15144,6 +15430,16 @@ This option gives a list of key types which are acceptable in signatures,
 and an order of processing.
 Signatures with algorithms not in the list will be ignored.
 
+
+.new
+.option dkim_verify_min_keysizes main "string list" "rsa=1024 ed25519=250"
+This option gives a list of key sizes which are acceptable in signatures.
+The list is keyed by the algorithm type for the key; the values are in bits.
+Signatures with keys smaller than given by this option will fail verification.
+
+The default enforces the RFC 8301 minimum key size for RSA signatures.
+.wen
+
 .option dkim_verify_minimal main boolean false
 If set to true, verification of signatures will terminate after the
 first success.
@@ -15226,6 +15522,18 @@ default. A value of 0 coerces DNSSEC off, a value of 1 coerces DNSSEC on.
 
 If the resolver library does not support DNSSEC then this option has no effect.
 
+.new
+On Linux with glibc 2.31 or newer this is insufficient, the resolver library
+will default to stripping out a successful validation status.
+This will break a previously working Exim installation.
+Provided that you do trust the resolver (ie, is on localhost) you can tell
+glibc to pass through any successful validation with a new option in
+&_/etc/resolv.conf_&:
+.code
+options trust-ad
+.endd
+.wen
+
 
 .option dns_ipv4_lookup main "domain list&!!" unset
 .cindex "IPv6" "DNS lookup for AAAA records"
@@ -15315,6 +15623,7 @@ described in section &<<SECTlineendings>>&.
 .cindex "bounce messages" "success"
 .cindex "DSN" "success"
 .cindex "Delivery Status Notification" "success"
+.cindex "ESMTP extensions" DSN
 DSN extensions (RFC3461) will be advertised in the EHLO message to,
 and accepted from, these hosts.
 Hosts may use the NOTIFY and ENVID options on RCPT TO commands,
@@ -16203,6 +16512,11 @@ to depend on the IP address of the remote host for messages arriving via
 TCP/IP. After expansion, the value must be a sequence of decimal digits,
 optionally followed by K or M.
 
+.cindex "SIZE" "ESMTP extension, advertising"
+.cindex "ESMTP extensions" SIZE
+If nonzero the value will be advertised as a parameter to the ESMTP SIZE
+service extension keyword.
+
 &*Note*&: This limit cannot be made to depend on a message's sender or any
 other properties of an individual message, because it has to be advertised in
 the server's response to EHLO. String expansion failure causes a temporary
@@ -16280,6 +16594,24 @@ harm. This option overrides the &%pipe_as_creator%& option of the &(pipe)&
 transport driver.
 
 
+.new
+.option notifier_socket main string "$spool_directory/exim_daemon_notify"
+This option gives the name for a unix-domain socket on which the daemon
+listens for work and information-requests.
+Only installations running multiple daemons sharing a spool directory
+should need to modify the default.
+
+The option is expanded before use.
+If the platform supports Linux-style abstract socket names, the result
+is used with a nul byte prefixed.
+Otherwise, it should be a full path name and use a directory accessible
+to Exim.
+
+If the Exim command line uses a &%-oX%& option and does not use &%-oP%&
+then a notifier socket is not created.
+.wen
+
+
 .option openssl_options main "string list" "+no_sslv2 +no_sslv3 +single_dh_use +no_ticket +no_renegotiation"
 .cindex "OpenSSL "compatibility options"
 This option allows an administrator to adjust the SSL options applied
@@ -16452,6 +16784,7 @@ of the &%-oX%& option, unless a path is explicitly supplied by &%-oP%&.
 
 .option pipelining_advertise_hosts main "host list&!!" *
 .cindex "PIPELINING" "suppressing advertising"
+.cindex "ESMTP extensions" PIPELINING
 This option can be used to suppress the advertisement of the SMTP
 PIPELINING extension to specific hosts. See also the &*no_pipelining*&
 control in section &<<SECTcontrols>>&. When PIPELINING is not advertised and
@@ -16463,6 +16796,7 @@ not count as protocol errors (see &%smtp_max_synprot_errors%&).
 .option pipelining_connect_advertise_hosts main "host list&!!" *
 .cindex "pipelining" "early connection"
 .cindex "pipelining" PIPE_CONNECT
+.cindex "ESMTP extensions" X_PIPE_CONNECT
 If Exim is built with the SUPPORT_PIPE_CONNECT build option
 this option controls which hosts the facility is advertised to
 and from which pipeline early-connection (before MAIL) SMTP
@@ -16476,6 +16810,7 @@ Currently the option name &"X_PIPE_CONNECT"& is used.
 
 .option prdr_enable main boolean false
 .cindex "PRDR" "enabling on server"
+.cindex "ESMTP extensions" PRDR
 This option can be used to enable the Per-Recipient Data Response extension
 to SMTP, defined by Eric Hall.
 If the option is set, PRDR is advertised by Exim when operating as a server.
@@ -16696,13 +17031,14 @@ run. If you do not want queue runs to occur, omit the &%-q%&&'xx'& setting on
 the daemon's command line.
 
 .cindex queues named
-.cindex "named queues"
+.cindex "named queues" "resource limit"
 To set limits for different named queues use
 an expansion depending on the &$queue_name$& variable.
 
 .option queue_smtp_domains main "domain list&!!" unset
 .cindex "queueing incoming messages"
 .cindex "message" "queueing remote deliveries"
+.cindex "first pass routing"
 When this option is set, a delivery process is started whenever a message is
 received, routing is performed, and local deliveries take place.
 However, if any SMTP deliveries are required for domains that match
@@ -16744,7 +17080,7 @@ received_header_text = Received: \
         ${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
   by $primary_hostname \
   ${if def:received_protocol {with $received_protocol }}\
-  ${if def:tls_ver           { ($tls_ver)}}\
+  ${if def:tls_in_ver        { ($tls_in_ver)}}\
   ${if def:tls_in_cipher_std { tls $tls_in_cipher_std\n\t}}\
   (Exim $version_number)\n\t\
   ${if def:sender_address \
@@ -16753,7 +17089,8 @@ received_header_text = Received: \
   ${if def:received_for {\n\tfor $received_for}}
 .endd
 
-The reference to the TLS cipher is omitted when Exim is built without TLS
+The references to the TLS version and cipher are
+omitted when Exim is built without TLS
 support. The use of conditional expansions ensures that this works for both
 locally generated messages and messages received from remote hosts, giving
 header lines such as the following:
@@ -17193,6 +17530,7 @@ hosts), you can do so by an appropriate use of a &%control%& modifier in an ACL
 
 .option smtp_etrn_command main string&!! unset
 .cindex "ETRN" "command to be run"
+.cindex "ESMTP extensions" ETRN
 .vindex "&$domain$&"
 If this option is set, the given command is run whenever an SMTP ETRN
 command is received from a host that is permitted to issue such commands (see
@@ -17204,6 +17542,13 @@ example:
 smtp_etrn_command = /etc/etrn_command $domain \
                     $sender_host_address
 .endd
+.new
+If the option is not set, the argument for the ETRN command must
+be a &'#'& followed by an address string.
+In this case an &'exim -R <string>'& command is used;
+if the ETRN ACL has set up a named-queue then &'-MCG <queue>'& is appended.
+.wen
+
 A new process is created to run the command, but Exim does not wait for it to
 complete. Consequently, its status cannot be checked. If the command cannot be
 run, a line is written to the panic log, but the ETRN caller still receives
@@ -17366,7 +17711,8 @@ example, instead of &"Administrative prohibition"&, it might give:
 
 
 .option smtputf8_advertise_hosts main "host list&!!" *
-.cindex "SMTPUTF8" "advertising"
+.cindex "SMTPUTF8" "ESMTP extension, advertising"
+.cindex "ESMTP extensions" SMTPUTF8
 When Exim is built with support for internationalised mail names,
 the availability thereof is advertised in
 response to EHLO only to those client hosts that match this option. See
@@ -17657,6 +18003,7 @@ unfortunately not all, operating systems.
 .cindex "TLS" "advertising"
 .cindex "encryption" "on SMTP connection"
 .cindex "SMTP" "encrypted connection"
+.cindex "ESMTP extensions" STARTTLS
 When Exim is built with support for TLS encrypted connections, the availability
 of the STARTTLS command to set up an encrypted session is advertised in
 response to EHLO only to those client hosts that match this option. See
@@ -18094,14 +18441,20 @@ regular expression by a parenthesized subpattern. The default value for
 See &%uucp_from_pattern%& above.
 
 
-.option warn_message_file main string unset
+.option warn_message_file main string&!! unset
 .cindex "warning of delay" "customizing the message"
 .cindex "customizing" "warning message"
 This option defines a template file containing paragraphs of text to be used
 for constructing the warning message which is sent by Exim when a message has
 been in the queue for a specified amount of time, as specified by
 &%delay_warning%&. Details of the file's contents are given in chapter
-&<<CHAPemsgcust>>&. See also &%bounce_message_file%&.
+&<<CHAPemsgcust>>&.
+.new
+.cindex warn_message_file "tainted data"
+The option is expanded to give the file path, which must be
+absolute and untainted.
+.wen
+See also &%bounce_message_file%&.
 
 
 .option write_rejectlog main boolean true
@@ -18584,15 +18937,19 @@ avoided. The &%repeat_use%& option of the &%redirect%& router may be of help.
 This option specifies a list of text headers,
 colon-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&),
 that is associated with any addresses that are accepted by the router.
-Each item is separately expanded, at routing time.  However, this
-option has no effect when an address is just being verified. The way in which
+However, the option has no effect when an address is just being verified.
+Each list item is separately expanded, at transport time.
+.new
+If an item ends in *, it will match any header with the given prefix.
+.wen
+The way in which
 the text is used to remove header lines at transport time is described in
 section &<<SECTheadersaddrem>>&. Header lines are not actually removed until
 the message is in the process of being transported. This means that references
 to header lines in string expansions in the transport's configuration still
 &"see"& the original header lines.
 
-The &%headers_remove%& option is expanded after &%errors_to%& and
+The &%headers_remove%& option is handled after &%errors_to%& and
 &%headers_add%&, but before &%transport%&. If an item expansion is forced to fail,
 the item has no effect. Other expansion failures are treated as configuration
 errors.
@@ -18697,6 +19054,12 @@ command for LMTP, SMTP, and BSMTP deliveries has the prefix removed by default.
 This behaviour can be overridden by setting &%rcpt_include_affixes%& true on
 the relevant transport.
 
+.new
+.vindex &$local_part_prefix_v$&
+If wildcarding (above) was used then the part of the prefix matching the
+wildcard is available in &$local_part_prefix_v$&.
+.wen
+
 When an address is being verified, &%local_part_prefix%& affects only the
 behaviour of the router. If the callout feature of verification is in use, this
 means that the full address, including the prefix, will be used during the
@@ -18902,7 +19265,7 @@ but the user is specified symbolically, the gid associated with the uid is
 used. For example:
 .code
 require_files = mail:/some/file
-require_files = $local_part:$home/.procmailrc
+require_files = $local_part_data:$home/.procmailrc
 .endd
 If a user or group name in a &%require_files%& list does not exist, the
 &%require_files%& condition fails.
@@ -20035,8 +20398,10 @@ semicolon is the default route list separator.
 
 
 .section "Format of one host item" "SECTformatonehostitem"
-Each item in the list of hosts is either a host name or an IP address,
-optionally with an attached port number. When no port is given, an IP address
+Each item in the list of hosts can be either a host name or an IP address,
+optionally with an attached port number, or it can be a single "+"
+(see &%hosts_randomize%&).
+When no port is given, an IP address
 is not enclosed in brackets. When a port is specified, it overrides the port
 specification on the transport. The port is separated from the name or address
 by a colon. This leads to some complications:
@@ -20528,6 +20893,19 @@ is not the case when the file contains syntactically valid items that happen to
 yield empty addresses, for example, items containing only RFC 2822 address
 comments.
 
+.new
+.cindex "tainted data" "in filenames"
+.cindex redirect "tainted data"
+Tainted data may not be used for a filename.
+
+&*Warning*&: It is unwise to use &$local_part$& or &$domain$&
+directly for redirection,
+as they are provided by a potential attacker.
+In the examples above, &$local_part$& is used for looking up data held locally
+on the system, and not used directly (the second example derives &$home$& via
+the passsword file or database, using &$local_part$&).
+.wen
+
 
 
 .section "Forward files and address verification" "SECID125"
@@ -20753,6 +21131,11 @@ It must be given as
 .code
 list1:   :include:/opt/lists/list1
 .endd
+.new
+.cindex "tainted data" "in filenames"
+.cindex redirect "tainted data"
+Tainted data may not be used for a filename.
+.wen
 .next
 .cindex "address redirection" "to black hole"
 .cindex "delivery" "discard"
@@ -21513,7 +21896,7 @@ local_users:
 # This transport overrides the group
 group_delivery:
   driver = appendfile
-  file = /var/spool/mail/$local_part
+  file = /var/spool/mail/$local_part_data
   group = mail
 .endd
 If &%user%& is set for a transport, its value overrides what is set in the
@@ -21753,15 +22136,21 @@ checked, since this option does not automatically suppress them.
 .option headers_remove transports list&!! unset
 .cindex "header lines" "removing"
 .cindex "transport" "header lines; removing"
-This option specifies a list of header names,
-colon-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&);
-these headers are omitted from the message as it is transported, as described
-in section &<<SECTheadersaddrem>>&. Header removal can also be specified by
-routers.
+This option specifies a list of text headers,
+colon-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&),
+to be removed from the message.
+However, the option has no effect when an address is just being verified.
 Each list item is separately expanded.
 If the result of the expansion is an empty string, or if the expansion
 is forced to fail, no action is taken. Other expansion failures are treated as
 errors and cause the delivery to be deferred.
+.new
+If an item ends in *, it will match any header with the given prefix.
+.wen
+
+Matching headers are omitted from the message as it is transported, as described
+in section &<<SECTheadersaddrem>>&. Header removal can also be specified by
+routers.
 
 Unlike most options, &%headers_remove%& can be specified multiple times
 for a transport; all listed headers are removed.
@@ -22022,7 +22411,7 @@ message. For example, a content scan could insert a new header line containing
 a spam score. This could be interpreted by a filter in the user's MUA. It is
 not possible to discard a message at this stage.
 
-.cindex "SMTP" "SIZE"
+.cindex "SIZE" "ESMTP extension"
 A problem might arise if the filter increases the size of a message that is
 being sent down an SMTP connection. If the receiving SMTP server has indicated
 support for the SIZE parameter, Exim will have sent the size of the message
@@ -22312,6 +22701,14 @@ If &%file%& or &%directory%& is set for a delivery from a redirection, it is
 used to determine the file or directory name for the delivery. Normally, the
 contents of &$address_file$& are used in some way in the string expansion.
 .endlist
+.new
+.cindex "tainted data" "in filenames"
+.cindex appendfile "tainted data"
+Tainted data may not be used for a file or directory name.
+This means that, for instance, &$local_part$& cannot be used directly
+as a component of a path.  It can however be used as the key for a lookup
+which returns a path (or component).
+.wen
 
 
 .cindex "Sieve filter" "configuring &(appendfile)&"
@@ -22334,7 +22731,7 @@ is used as a result of a &"keep"& action in the filter. This example shows one
 way of handling this requirement:
 .code
 file = ${if eq{$address_file}{inbox} \
-            {/var/mail/$local_part} \
+            {/var/mail/$local_part_data} \
             {${if eq{${substr_0_1:$address_file}}{/} \
                   {$address_file} \
                   {$home/mail/$address_file} \
@@ -22515,8 +22912,8 @@ The string value is expanded for each delivery, and must yield an absolute
 path. The most common settings of this option are variations on one of these
 examples:
 .code
-file = /var/spool/mail/$local_part
-file = /home/$local_part/inbox
+file = /var/spool/mail/$local_part_data
+file = /home/$local_part_data/inbox
 file = $home/inbox
 .endd
 .cindex "&""sticky""& bit"
@@ -23272,7 +23669,7 @@ and directories in a maildir mailbox, including subdirectories for maildir++
 folders. Consider this example:
 .code
 maildir_format = true
-directory = /var/mail/$local_part\
+directory = /var/mail/$local_part_data\
            ${if eq{$local_part_suffix}{}{}\
            {/.${substr_1:$local_part_suffix}}}
 maildirfolder_create_regex = /\.[^/]+$
@@ -23749,6 +24146,12 @@ directories are also controllable. See chapter &<<CHAPenvironment>>& for
 details of the local delivery environment and chapter &<<CHAPbatching>>&
 for a discussion of local delivery batching.
 
+.new
+.cindex "tainted data" "in pipe command"
+.cindex pipe "tainted data"
+Tainted data may not be used for the command name.
+.wen
+
 
 .section "Concurrent delivery" "SECID140"
 If two messages arrive at almost the same time, and both are routed to a pipe
@@ -24256,14 +24659,14 @@ configuration for &%procmail%&:
 # transport
 procmail_pipe:
   driver = pipe
-  command = /usr/local/bin/procmail -d $local_part
+  command = /usr/local/bin/procmail -d $local_part_data
   return_path_add
   delivery_date_add
   envelope_to_add
   check_string = "From "
   escape_string = ">From "
   umask = 077
-  user = $local_part
+  user = $local_part_data
   group = mail
 
 # router
@@ -24721,7 +25124,8 @@ facilities such as AUTH, PIPELINING, SIZE, and STARTTLS.
 
 .option hosts_avoid_pipelining smtp "host list&!!" unset
 .cindex "PIPELINING" "avoiding the use of"
-Exim will not use the SMTP PIPELINING extension when delivering to any host
+.cindex "ESMTP extensions" PIPELINING
+Exim will not use the ESMTP PIPELINING extension when delivering to any host
 that matches this list, even if the server host advertises PIPELINING support.
 
 .option hosts_pipe_connect smtp "host list&!!" unset
@@ -24925,6 +25329,7 @@ such as DNSBL lookups, will still delay the emission of the SMTP banner.
 
 .option hosts_try_prdr smtp "host list&!!" *
 .cindex "PRDR" "enabling, optional in client"
+.cindex "ESMTP extensions" PRDR
 This option provides a list of servers to which, provided they announce
 PRDR support, Exim will attempt to negotiate PRDR
 for multi-recipient messages.
@@ -25082,7 +25487,7 @@ See also the &%max_parallel%& generic transport option.
 
 
 .option size_addition smtp integer 1024
-.cindex "SMTP" "SIZE"
+.cindex "SIZE" "ESMTP extension"
 .cindex "message" "size issue for transport filter"
 .cindex "size" "of message"
 .cindex "transport" "filter"
@@ -25267,13 +25672,16 @@ The &%tls_verify_certificates%& option must also be set.
 If both this option and &%tls_try_verify_hosts%& are unset
 operation is as if this option selected all hosts.
 
-.option utf8_downconvert smtp integer!! unset
+.option utf8_downconvert smtp integer&!! unset
 .cindex utf8 "address downconversion"
 .cindex i18n "utf8 address downconversion"
 If built with internationalization support,
-this option controls conversion of UTF-8 in message addresses
+this option controls conversion of UTF-8 in message envelope addresses
 to a-label form.
-For details see section &<<SECTi18nMTA>>&.
+If, after expansion, the value is 1, 0, or -1 then this value overrides
+any value previously set for the message.  Otherwise, any previously
+set value is used.
+For details on the values see section &<<SECTi18nMTA>>&.
 
 
 
@@ -26381,6 +26789,7 @@ transfer of mail between servers that have no managerial connection with each
 other.
 
 .cindex "AUTH" "description of"
+.cindex "ESMTP extensions" AUTH
 Very briefly, the way SMTP authentication works is as follows:
 
 .ilist
@@ -26942,7 +27351,7 @@ There are good and bad examples at the end of the next section.
 
 .section "The PLAIN authentication mechanism" "SECID172"
 .cindex "PLAIN authentication mechanism"
-.cindex "authentication" "PLAIN mechanism"
+.cindex authentication PLAIN
 .cindex "binary zero" "in &(plaintext)& authenticator"
 The PLAIN authentication mechanism (RFC 2595) specifies that three strings be
 sent as one item of data (that is, one combined string containing two NUL
@@ -27024,7 +27433,7 @@ writing the test makes the logic clearer.
 
 .section "The LOGIN authentication mechanism" "SECID173"
 .cindex "LOGIN authentication mechanism"
-.cindex "authentication" "LOGIN mechanism"
+.cindex authentication LOGIN
 The LOGIN authentication mechanism is not documented in any RFC, but is in use
 in a number of programs. No data is sent with the AUTH command. Instead, a
 user name and password are supplied separately, in response to prompts. The
@@ -27145,7 +27554,7 @@ prompts.
 .scindex IIDcramauth1 "&(cram_md5)& authenticator"
 .scindex IIDcramauth2 "authenticators" "&(cram_md5)&"
 .cindex "CRAM-MD5 authentication mechanism"
-.cindex "authentication" "CRAM-MD5 mechanism"
+.cindex authentication CRAM-MD5
 The CRAM-MD5 authentication mechanism is described in RFC 2195. The server
 sends a challenge string to the client, and the response consists of a user
 name and the CRAM-MD5 digest of the challenge string combined with a secret
@@ -27434,7 +27843,7 @@ auth_mechanisms = plain login ntlm
 .cindex "authentication" "LOGIN"
 .cindex "authentication" "DIGEST-MD5"
 .cindex "authentication" "CRAM-MD5"
-.cindex "authentication" "SCRAM-SHA-1"
+.cindex "authentication" "SCRAM family"
 The &(gsasl)& authenticator provides integration for the GNU SASL
 library and the mechanisms it provides.  This is new as of the 4.80 release
 and there are a few areas where the library does not let Exim smoothly
@@ -27442,8 +27851,13 @@ scale to handle future authentication mechanisms, so no guarantee can be
 made that any particular new authentication mechanism will be supported
 without code changes in Exim.
 
-
 .new
+The library is expected to add support in an upcoming
+realease for the SCRAM-SHA-256 method.
+The macro _HAVE_AUTH_GSASL_SCRAM_SHA_256 will be defined
+when this happens.
+
+
 .option client_authz gsasl string&!! unset
 This option can be used to supply an &'authorization id'&
 which is different to the &'authentication_id'& provided
@@ -27463,6 +27877,19 @@ This option is exapanded before use, and should result in
 the account name to be used.
 .wen
 
+.new
+.option client_spassword gsasl string&!! unset
+If a SCRAM mechanism is being used and this option is set
+it is used in preference to &%client_password%&.
+The value after expansion should be
+a 40 (for SHA-1) or 64 (for SHA-256) character string
+with the PBKDF2-prepared password, hex-encoded.
+Note that this value will depend on the salt and iteration-count
+supplied by the server.
+.wen
+
+
+
 .option server_channelbinding gsasl boolean false
 Do not set this true and rely on the properties
 without consulting a cryptographic engineer.
@@ -27481,6 +27908,7 @@ server to see different identifiers and authentication will fail.
 This is
 only usable by mechanisms which support "channel binding"; at time of
 writing, that's the SCRAM family.
+When using this feature the "-PLUS" variants of the method names need to be used.
 .wen
 
 This defaults off to ensure smooth upgrade across Exim releases, in case
@@ -27535,16 +27963,60 @@ This specifies the SASL realm that the server claims to be in.
 Some mechanisms will use this data.
 
 
-.option server_scram_iter gsasl string&!! unset
+.option server_scram_iter gsasl string&!! 4096
 This option provides data for the SCRAM family of mechanisms.
-&$auth1$& is not available at evaluation time.
-(This may change, as we receive feedback on use)
-
+.new
+The &$auth1$&, &$auth2$& and &$auth3$& variables are available
+when this option is expanded.
+
+The result of expansion should be a decimal number,
+and represents both a lower-bound on the security, and
+a compute cost factor imposed on the client
+(if it does not cache results, or the server changes
+either the iteration count or the salt).
+A minimum value of 4096 is required by the standards
+for all current SCRAM mechanism variants.
+.wen
 
 .option server_scram_salt gsasl string&!! unset
 This option provides data for the SCRAM family of mechanisms.
-&$auth1$& is not available at evaluation time.
-(This may change, as we receive feedback on use)
+.new
+The &$auth1$&, &$auth2$& and &$auth3$& variables are available
+when this option is expanded.
+The value should be a base64-encoded string,
+of random data typically 4-to-16 bytes long.
+If unset or empty after expansion the library will provides a value for the
+protocol conversation.
+.wen
+
+
+.new
+.option server_key gsasl string&!! unset
+.option server_skey gsasl string&!! unset
+These options can be used for the SCRAM family of mechanisms
+to provide stored information related to a password,
+the storage of which is preferable to plaintext.
+
+&%server_key%& is the value defined in the SCRAM standards as ServerKey;
+&%server_skey%& is StoredKey.
+
+They are only available for version 1.9.0 (or later) of the gsasl library.
+When this is so, the macros
+_OPT_AUTHENTICATOR_GSASL_SERVER_KEY
+and _HAVE_AUTH_GSASL_SCRAM_S_KEY
+will be defined.
+
+The &$authN$& variables are available when these options are expanded.
+
+If set, the results of expansion should for each
+should be a 28 (for SHA-1) or 44 (for SHA-256) character string
+of base64-coded data, and will be used in preference to the
+&%server_password%& option.
+If unset or not of the right length, &%server_password%& will be used.
+
+The libgsasl library release includes a utility &'gsasl'& which can be used
+to generate these values.
+.wen
 
 
 .option server_service gsasl string &`smtp`&
@@ -28349,6 +28821,7 @@ tls_require_ciphers = ${if =={$received_port}{25}\
 
 .section "Configuring an Exim server to use TLS" "SECID182"
 .cindex "TLS" "configuring an Exim server"
+.cindex "ESMTP extensions" STARTTLS
 When Exim has been built with TLS support, it advertises the availability of
 the STARTTLS command to client hosts that match &%tls_advertise_hosts%&,
 but not to any others. The default value of this option is *, which means
@@ -28608,6 +29081,7 @@ deliveries as well as to incoming, the latter one causing logging of the
 server certificate's DN. The remaining client configuration for TLS is all
 within the &(smtp)& transport.
 
+.cindex "ESMTP extensions" STARTTLS
 It is not necessary to set any options to have TLS work in the &(smtp)&
 transport. If Exim is built with TLS support, and TLS is advertised by a
 server, the &(smtp)& transport always tries to start a TLS session. However,
@@ -29976,7 +30450,7 @@ in several different ways. For example:
 It can be at the end of an &%accept%& statement:
 .code
     accept  ...some conditions
-            control = queue_only
+            control = queue
 .endd
 In this case, the control is applied when this statement yields &"accept"&, in
 other words, when the conditions are all true.
@@ -29985,7 +30459,7 @@ other words, when the conditions are all true.
 It can be in the middle of an &%accept%& statement:
 .code
     accept  ...some conditions...
-            control = queue_only
+            control = queue
             ...some more conditions...
 .endd
 If the first set of conditions are true, the control is applied, even if the
@@ -30550,22 +31024,39 @@ calling host. Its effect lasts until the end of the SMTP connection.
 
 .vitem &*control&~=&~no_pipelining*&
 .cindex "PIPELINING" "suppressing advertising"
+.cindex "ESMTP extensions" PIPELINING
 This control turns off the advertising of the PIPELINING extension to SMTP in
 the current session. To be useful, it must be obeyed before Exim sends its
 response to an EHLO command. Therefore, it should normally appear in an ACL
 controlled by &%acl_smtp_connect%& or &%acl_smtp_helo%&. See also
 &%pipelining_advertise_hosts%&.
 
-.vitem &*control&~=&~queue_only*&
+.new
+.vitem &*control&~=&~queue/*&<&'options'&>* &&&
+       &*control&~=&~queue_only*&
+.oindex "&%queue%&"
 .oindex "&%queue_only%&"
 .cindex "queueing incoming messages"
+.cindex queueing "forcing in ACL"
+.cindex "first pass routing"
 This control is permitted only for the MAIL, RCPT, DATA, and non-SMTP ACLs, in
 other words, only when a message is being received. If the message is accepted,
 it is placed on Exim's queue and left there for delivery by a subsequent queue
-runner. No immediate delivery process is started. In other words, it has the
-effect as the &%queue_only%& global option. However, the control applies only
-to the current message, not to any subsequent ones that may be received in the
-same SMTP connection.
+runner.
+If used with no options set,
+no immediate delivery process is started. In other words, it has the
+effect as the &%queue_only%& global option or &'-odq'& command-line option.
+
+If the &'first_pass_route'& option is given then
+the behaviour is like the command-line &'-oqds'& option;
+a delivery process is started which stops short of making
+any SMTP delivery.  The benefit is that the hints database will be updated for
+the message being waiting for a specific host, and a later queue run will be
+able to send all such messages on a single connection.
+
+The control only applies to the current message, not to any subsequent ones that
+ may be received in the same SMTP connection.
+.wen
 
 .vitem &*control&~=&~submission/*&<&'options'&>
 .cindex "message" "submission"
@@ -30609,7 +31100,7 @@ data is read.
 that are being submitted at the same time using &%-bs%& or &%-bS%&.
 
 .vitem &*control&~=&~utf8_downconvert*&
-This control enables conversion of UTF-8 in message addresses
+This control enables conversion of UTF-8 in message envelope addresses
 to a-label form.
 For details see section &<<SECTi18nMTA>>&.
 .endlist vlist
@@ -33467,13 +33958,22 @@ The following list describes all expansion variables that are
 available in the MIME ACL:
 
 .vlist
+.vitem &$mime_anomaly_level$& &&&
+       &$mime_anomaly_text$&
+.vindex &$mime_anomaly_level$&
+.vindex &$mime_anomaly_text$&
+If there are problems decoding, these variables contain information on
+the detected issue.
+
 .vitem &$mime_boundary$&
-If the current part is a multipart (see &$mime_is_multipart$&) below, it should
+.vindex &$mime_boundary$&
+If the current part is a multipart (see &$mime_is_multipart$& below), it should
 have a boundary string, which is stored in this variable. If the current part
 has no boundary parameter in the &'Content-Type:'& header, this variable
 contains the empty string.
 
 .vitem &$mime_charset$&
+.vindex &$mime_charset$&
 This variable contains the character set identifier, if one was found in the
 &'Content-Type:'& header. Examples for charset identifiers are:
 .code
@@ -33485,31 +33985,37 @@ Please note that this value is not normalized, so you should do matches
 case-insensitively.
 
 .vitem &$mime_content_description$&
+.vindex &$mime_content_description$&
 This variable contains the normalized content of the &'Content-Description:'&
 header. It can contain a human-readable description of the parts content. Some
 implementations repeat the filename for attachments here, but they are usually
 only used for display purposes.
 
 .vitem &$mime_content_disposition$&
+.vindex &$mime_content_disposition$&
 This variable contains the normalized content of the &'Content-Disposition:'&
 header. You can expect strings like &"attachment"& or &"inline"& here.
 
 .vitem &$mime_content_id$&
+.vindex &$mime_content_id$&
 This variable contains the normalized content of the &'Content-ID:'& header.
 This is a unique ID that can be used to reference a part from another part.
 
 .vitem &$mime_content_size$&
+.vindex &$mime_content_size$&
 This variable is set only after the &%decode%& modifier (see above) has been
 successfully run. It contains the size of the decoded part in kilobytes. The
 size is always rounded up to full kilobytes, so only a completely empty part
 has a &$mime_content_size$& of zero.
 
 .vitem &$mime_content_transfer_encoding$&
+.vindex &$mime_content_transfer_encoding$&
 This variable contains the normalized content of the
 &'Content-transfer-encoding:'& header. This is a symbolic name for an encoding
 type. Typical values are &"base64"& and &"quoted-printable"&.
 
 .vitem &$mime_content_type$&
+.vindex &$mime_content_type$&
 If the MIME part has a &'Content-Type:'& header, this variable contains its
 value, lowercased, and without any options (like &"name"& or &"charset"&). Here
 are some examples of popular MIME types, as they may appear in this variable:
@@ -33524,6 +34030,7 @@ If the MIME part has no &'Content-Type:'& header, this variable contains the
 empty string.
 
 .vitem &$mime_decoded_filename$&
+.vindex &$mime_decoded_filename$&
 This variable is set only after the &%decode%& modifier (see above) has been
 successfully run. It contains the full path and filename of the file
 containing the decoded data.
@@ -33532,6 +34039,7 @@ containing the decoded data.
 .cindex "RFC 2047"
 .vlist
 .vitem &$mime_filename$&
+.vindex &$mime_filename$&
 This is perhaps the most important of the MIME variables. It contains a
 proposed filename for an attachment, if one was found in either the
 &'Content-Type:'& or &'Content-Disposition:'& headers. The filename will be
@@ -33542,6 +34050,7 @@ decoded, but no additional sanity checks are done.
 found, this variable contains the empty string.
 
 .vitem &$mime_is_coverletter$&
+.vindex &$mime_is_coverletter$&
 This variable attempts to differentiate the &"cover letter"& of an e-mail from
 attached data. It can be used to clamp down on flashy or unnecessarily encoded
 content in the cover letter, while not restricting attachments at all.
@@ -33574,18 +34083,22 @@ deny message = HTML mail is not accepted here
 condition = $mime_is_coverletter
 condition = ${if eq{$mime_content_type}{text/html}{1}{0}}
 .endd
+
 .vitem &$mime_is_multipart$&
+.vindex &$mime_is_multipart$&
 This variable has the value 1 (true) when the current part has the main type
 &"multipart"&, for example, &"multipart/alternative"& or &"multipart/mixed"&.
 Since multipart entities only serve as containers for other parts, you may not
 want to carry out specific actions on them.
 
 .vitem &$mime_is_rfc822$&
+.vindex &$mime_is_rfc822$&
 This variable has the value 1 (true) if the current part is not a part of the
 checked message itself, but part of an attached message. Attached message
 decoding is fully recursive.
 
 .vitem &$mime_part_count$&
+.vindex &$mime_part_count$&
 This variable is a counter that is raised for each processed MIME part. It
 starts at zero for the very first part (which is usually a multipart). The
 counter is per-message, so it is reset when processing RFC822 attachments (see
@@ -33716,13 +34229,14 @@ in &_Local/Makefile_& (see section &<<SECTconoptloc>>& below).
 .cindex &%dlfunc%& "API description"
 You must include this line near the start of your code:
 .code
+#define LOCAL_SCAN
 #include "local_scan.h"
 .endd
 This header file defines a number of variables and other values, and the
 prototype for the function itself. Exim is coded to use unsigned char values
 almost exclusively, and one of the things this header defines is a shorthand
 for &`unsigned char`& called &`uschar`&.
-It also contains the following macro definitions, to simplify casting character
+It also makes available the following macro definitions, to simplify casting character
 strings and pointers to character strings:
 .code
 #define CS   (char *)
@@ -34716,7 +35230,7 @@ central_filter:
   check_local_user
   driver = redirect
   domains = +local_domains
-  file = /central/filters/$local_part
+  file = /central/filters/$local_part_data
   no_verify
   allow_filter
   allow_freeze
@@ -35474,13 +35988,14 @@ used to contain the envelope information.
 .cindex "outgoing LMTP over TCP/IP"
 .cindex "EHLO"
 .cindex "HELO"
-.cindex "SIZE option on MAIL command"
+.cindex "SIZE" "option on MAIL command"
 Outgoing SMTP and LMTP over TCP/IP is implemented by the &(smtp)& transport.
 The &%protocol%& option selects which protocol is to be used, but the actual
 processing is the same in both cases.
 
+.cindex "ESMTP extensions" SIZE
 If, in response to its EHLO command, Exim is told that the SIZE
-parameter is supported, it adds SIZE=<&'n'&> to each subsequent MAIL
+extension is supported, it adds SIZE=<&'n'&> to each subsequent MAIL
 command. The value of <&'n'&> is the message size plus the value of the
 &%size_addition%& option (default 1024) to allow for additions to the message
 such as per-transport header lines, or changes made in a
@@ -35876,7 +36391,8 @@ RCPT failures.
 
 .section "The ETRN command" "SECTETRN"
 .cindex "ETRN" "processing"
-RFC 1985 describes an SMTP command called ETRN that is designed to
+.cindex "ESMTP extensions" ETRN
+RFC 1985 describes an ESMTP command called ETRN that is designed to
 overcome the security problems of the TURN command (which has fallen into
 disuse). When Exim receives an ETRN command on a TCP/IP connection, it runs
 the ACL specified by &%acl_smtp_etrn%& in order to decide whether the command
@@ -36231,10 +36747,10 @@ lists in a separate domain from normal mail. For example:
 lists:
   driver = redirect
   domains = lists.example
-  file = /usr/lists/$local_part
+  file = ${lookup {$local_part} dsearch,ret=full {/usr/lists}}
   forbid_pipe
   forbid_file
-  errors_to = $local_part-request@lists.example
+  errors_to = ${quote_local_part:$local_part-request}@lists.example
   no_more
 .endd
 This router is skipped for domains other than &'lists.example'&. For addresses
@@ -36322,7 +36838,8 @@ lists_request:
   driver = redirect
   domains = lists.example
   local_part_suffix = -request
-  file = /usr/lists/$local_part$local_part_suffix
+  local_parts = ${lookup {$local_part} dsearch,filter=file {/usr/lists}}
+  file = /usr/lists/${local_part_data}-request
   no_more
 
 lists_post:
@@ -36330,10 +36847,10 @@ lists_post:
   domains = lists.example
   senders = ${if exists {/usr/lists/$local_part}\
              {lsearch;/usr/lists/$local_part}{*}}
-  file = /usr/lists/$local_part
+  file = ${lookup {$local_part} dsearch,ret=full {/usr/lists}}
   forbid_pipe
   forbid_file
-  errors_to = $local_part-request@lists.example
+  errors_to = ${quote_local_part:$local_part-request}@lists.example
   no_more
 
 lists_closed:
@@ -36391,7 +36908,7 @@ verp_smtp:
   max_rcpt = 1
   return_path = \
     ${if match {$return_path}{^(.+?)-request@your.dom.example\$}\
-      {$1-request+$local_part=$domain@your.dom.example}fail}
+      {${quote_local_part:$1-request+$local_part=$domain}@your.dom.example}fail}
 .endd
 This has the effect of rewriting the return path (envelope sender) on outgoing
 SMTP messages, if the local part of the original return path ends in
@@ -36442,7 +36959,7 @@ verp_dnslookup:
   transport = remote_smtp
   errors_to = \
     ${if match {$return_path}{^(.+?)-request@your.dom.example\$}}
-     {$1-request+$local_part=$domain@your.dom.example}fail}
+     {${quote_local_part:$1-request+$local_part=$domain}@your.dom.example}fail}
   no_more
 .endd
 Before you start sending out messages with VERPed return paths, you must also
@@ -36490,12 +37007,18 @@ to a router of this form:
 virtual:
   driver = redirect
   domains = dsearch;/etc/mail/virtual
-  data = ${lookup{$local_part}lsearch{/etc/mail/virtual/$domain}}
+  data = ${lookup{$local_part}lsearch{/etc/mail/virtual/$domain_data}}
   no_more
 .endd
+.new
 The &%domains%& option specifies that the router is to be skipped, unless there
 is a file in the &_/etc/mail/virtual_& directory whose name is the same as the
-domain that is being processed. When the router runs, it looks up the local
+domain that is being processed.
+The &(dsearch)& lookup used results in an untainted version of &$domain$&
+being placed into the &$domain_data$& variable.
+.wen
+
+When the router runs, it looks up the local
 part in the file to find a new address (or list of addresses). The &%no_more%&
 setting ensures that if the lookup fails (leading to &%data%& being an empty
 string), Exim gives up on the address without trying any subsequent routers.
@@ -36524,7 +37047,7 @@ follows:
 .code
 my_mailboxes:
   driver = appendfile
-  file = /var/mail/$domain/$local_part
+  file = /var/mail/$domain/$local_part_data
   user = mail
 .endd
 This uses a directory of mailboxes for each domain. The &%user%& setting is
@@ -36579,9 +37102,9 @@ another MTA:
 userforward:
   driver = redirect
   check_local_user
-  file = $home/.forward$local_part_suffix
   local_part_suffix = -*
   local_part_suffix_optional
+  file = ${lookup {.forward$local_part_suffix} dsearch,ret=full {$home} {$value}fail}
   allow_filter
 .endd
 If there is no suffix, &_.forward_& is used; if the suffix is &'-special'&, for
@@ -36698,6 +37221,7 @@ delivered immediately.
 .cindex "SMTP" "passed connection"
 .cindex "SMTP" "multiple deliveries"
 .cindex "multiple SMTP deliveries"
+.cindex "first pass routing"
 Mail waiting to be sent from an intermittently connected host will probably
 not have been routed, because without a connection DNS lookups are not
 possible. This means that if a normal queue run is done at connection time,
@@ -39975,6 +40499,8 @@ To generate keys under OpenSSL:
 openssl genrsa -out dkim_rsa.private 2048
 openssl rsa -in dkim_rsa.private -out /dev/stdout -pubout -outform PEM
 .endd
+The result file from the first command should be retained, and
+this option set to use it.
 Take the base-64 lines from the output of the second command, concatenated,
 for the DNS TXT record.
 See section 3.6 of RFC6376 for the record specification.
@@ -40047,7 +40573,7 @@ only supports signing with the same canonicalization method for both headers and
 .option dkim_strict smtp string&!! unset
 This  option  defines  how  Exim  behaves  when  signing a message that
 should be signed fails for some reason.  When the expansion evaluates to
-either "1" or "true", Exim will defer. Otherwise Exim will send the message
+either &"1"& or &"true"&, Exim will defer. Otherwise Exim will send the message
 unsigned. You can use the &%$dkim_domain%& and &%$dkim_selector%& expansion
 variables here.
 
@@ -40059,16 +40585,19 @@ in the message signature.
 When unspecified, the header names listed in RFC4871 will be used,
 whether or not each header is present in the message.
 The default list is available for the expansion in the macro
-"_DKIM_SIGN_HEADERS".
+&"_DKIM_SIGN_HEADERS"&
+.new
+and an oversigning variant is in &"_DKIM_OVERSIGN_HEADERS"&.
+.wen
 
 If a name is repeated, multiple headers by that name (or the absence thereof)
 will be signed.  The textually later headers in the headers part of the
 message are signed first, if there are multiples.
 
-A name can be prefixed with either an '=' or a '+' character.
-If an '=' prefix is used, all headers that are present with this name
+A name can be prefixed with either an &"="& or a &"+"& character.
+If an &"="& prefix is used, all headers that are present with this name
 will be signed.
-If a '+' prefix if used, all headers that are present with this name
+If a &"+"& prefix if used, all headers that are present with this name
 will be signed, and one signature added for a missing header with the
 name will be appended.
 
@@ -40310,6 +40839,10 @@ Notes from the key record (tag n=).
 
 .vitem &%$dkim_key_length%&
 Number of bits in the key.
+.new
+Valid only once the key is loaded, which is at the time the header signature
+is verified, which is after the body hash is.
+.wen
 
 Note that RFC 8301 says:
 .code
@@ -40317,9 +40850,8 @@ Verifiers MUST NOT consider signatures using RSA keys of
 less than 1024 bits as valid signatures.
 .endd
 
-To enforce this you must have a DKIM ACL which checks this variable
-and overwrites the &$dkim_verify_status$& variable as discussed above.
-As EC keys are much smaller, the check should only do this for RSA keys.
+This is enforced by the default setting for the &%dkim_verify_min_keysizes%&
+option.
 
 .endlist
 
@@ -40571,9 +41103,8 @@ defines the location of a text file of valid
 top level domains the opendmarc library uses
 during domain parsing. Maintained by Mozilla,
 the most current version can be downloaded
-from a link at &url(https://publicsuffix.org/list/, currently pointing
-at https://publicsuffix.org/list/public_suffix_list.dat)
-See also util/renew-opendmarc-tlds.sh script.
+from a link at &url(https://publicsuffix.org/list/public_suffix_list.dat).
+See also the util/renew-opendmarc-tlds.sh script.
 .new
 The default for the option is unset.
 If not set, DMARC processing is disabled.
@@ -40949,6 +41480,7 @@ requirement, upon libidn2.
 
 .section "MTA operations" SECTi18nMTA
 .cindex SMTPUTF8 "ESMTP option"
+.cindex "ESMTP extensions" SMTPUTF8
 The main configuration option &%smtputf8_advertise_hosts%& specifies
 a host list.  If this matches the sending host and
 accept_8bitmime is true (the default) then the ESMTP option
@@ -40995,22 +41527,27 @@ may use the following modifier:
 control = utf8_downconvert
 control = utf8_downconvert/<value>
 .endd
-This sets a flag requiring that addresses are converted to
-a-label form before smtp delivery, for use in a
-Message Submission Agent context.
+This sets a flag requiring that envelope addresses are converted to
+a-label form before smtp delivery.
+This is usually for use in a Message Submission Agent context,
+but could be used for any message.
+
 If a value is appended it may be:
 .display
-&`1  `& (default) mandatory downconversion
+&`1  `& mandatory downconversion
 &`0  `& no downconversion
 &`-1 `& if SMTPUTF8 not supported by destination host
 .endd
+If no value is given, 1 is used.
 
 If mua_wrapper is set, the utf8_downconvert control
 is initially set to -1.
 
 The smtp transport has an option &%utf8_downconvert%&.
 If set it must expand to one of the three values described above,
-and it overrides any previously set value.
+or an empty string.
+If non-empty it overrides value previously set
+(due to mua_wrapper or by an ACL control).
 
 
 There is no explicit support for VRFY and EXPN.