Docs: correct spamd port
[exim.git] / doc / doc-docbook / spec.xfpt
index 8e78c7bad6e102c59555b339fa4813f1d2804c77..c53a392a4fb4e6eadc0fe078d18c665598944d6a 100644 (file)
@@ -1,6 +1,6 @@
 . /////////////////////////////////////////////////////////////////////////////
 . This is the primary source of the Exim Manual. It is an xfpt document that is
-. converted into DocBook XML for subsequent conversion into printing and online
+. converted into DocBook XML for subsequent conversion into printable and online
 . formats. The markup used herein is "standard" xfpt markup, with some extras.
 . The markup is summarized in a file called Markup.txt.
 .
@@ -35,7 +35,7 @@
 .literal off
 
 . /////////////////////////////////////////////////////////////////////////////
-. This generate the outermost <book> element that wraps then entire document.
+. This generates the outermost <book> element that wraps the entire document.
 . /////////////////////////////////////////////////////////////////////////////
 
 .book
 . Update the Copyright year (only) when changing content.
 . /////////////////////////////////////////////////////////////////////////////
 
-.set previousversion "4.90"
+.set previousversion "4.91"
 .include ./local_params
 
 .set ACL "access control lists (ACLs)"
 .set I   "&nbsp;&nbsp;&nbsp;&nbsp;"
 
 .macro copyyear
-2017
+2018
 .endmacro
 
 . /////////////////////////////////////////////////////////////////////////////
 . provided in the xfpt library.
 . /////////////////////////////////////////////////////////////////////////////
 
-. --- Override the &$ flag to automatically insert a $ with the variable name
+. --- Override the &$ flag to automatically insert a $ with the variable name.
 
 .flag &$  $&   "<varname>$"  "</varname>"
 
 . --- Short flags for daggers in option headings. They will always be inside
-. --- an italic string, but we want the daggers to be roman.
+. --- an italic string, but we want the daggers to be in Roman.
 
 .flag &!!      "</emphasis>&dagger;<emphasis>"
 .flag &!?      "</emphasis>&Dagger;<emphasis>"
@@ -89,7 +89,7 @@
 
 . --- A macro for the common 2-column tables. The width of the first column
 . --- is suitable for the many tables at the start of the main options chapter;
-. --- the small number of other 2-column tables override it.
+. --- a small number of other 2-column tables override it.
 
 .macro table2 196pt 254pt
 .itable none 0 0 2 $1 left $2 left
 
 
 . ////////////////////////////////////////////////////////////////////////////
-. The <bookinfo> element is removed from the XML before processing for Ascii
+. The <bookinfo> element is removed from the XML before processing for ASCII
 . output formats.
 . ////////////////////////////////////////////////////////////////////////////
 
@@ -337,7 +337,7 @@ Configuration files currently exist for the following operating systems: AIX,
 BSD/OS (aka BSDI), Darwin (Mac OS X), DGUX, Dragonfly, FreeBSD, GNU/Hurd,
 GNU/Linux, HI-OSF (Hitachi), HI-UX, HP-UX, IRIX, MIPS RISCOS, NetBSD, OpenBSD,
 OpenUNIX, QNX, SCO, SCO SVR4.2 (aka UNIX-SV), Solaris (aka SunOS5), SunOS4,
-Tru64-Unix (formerly Digital UNIX, formerly DEC-OSF1), Ultrix, and Unixware.
+Tru64-Unix (formerly Digital UNIX, formerly DEC-OSF1), Ultrix, and UnixWare.
 Some of these operating systems are no longer current and cannot easily be
 tested, so the configuration files may no longer work in practice.
 
@@ -349,8 +349,8 @@ The terms and conditions for the use and distribution of Exim are contained in
 the file &_NOTICE_&. Exim is distributed under the terms of the GNU General
 Public Licence, a copy of which may be found in the file &_LICENCE_&.
 
-The use, supply or promotion of Exim for the purpose of sending bulk,
-unsolicited electronic mail is incompatible with the basic aims of the program,
+The use, supply, or promotion of Exim for the purpose of sending bulk,
+unsolicited electronic mail is incompatible with the basic aims of Exim,
 which revolve around the free provision of a service that enhances the quality
 of personal communications. The author of Exim regards indiscriminate
 mass-mailing as an antisocial, irresponsible abuse of the Internet.
@@ -375,7 +375,7 @@ contributors.
 .cindex "documentation"
 This edition of the Exim specification applies to version &version() of Exim.
 Substantive changes from the &previousversion; edition are marked in some
-renditions of the document; this paragraph is so marked if the rendition is
+renditions of this document; this paragraph is so marked if the rendition is
 capable of showing a change indicator.
 .wen
 
@@ -384,7 +384,7 @@ is expected to have some familiarity with the SMTP mail transfer protocol and
 with general Unix system administration. Although there are some discussions
 and examples in places, the information is mostly organized in a way that makes
 it easy to look up, rather than in a natural order for sequential reading.
-Furthermore, the manual aims to cover every aspect of Exim in detail, including
+Furthermore, this manual aims to cover every aspect of Exim in detail, including
 a number of rarely-used, special-purpose features that are unlikely to be of
 very wide interest.
 
@@ -392,9 +392,9 @@ very wide interest.
 An &"easier"& discussion of Exim which provides more in-depth explanatory,
 introductory, and tutorial material can be found in a book entitled &'The Exim
 SMTP Mail Server'& (second edition, 2007), published by UIT Cambridge
-(&url(http://www.uit.co.uk/exim-book/)).
+(&url(https://www.uit.co.uk/exim-book/)).
 
-This book also contains a chapter that gives a general introduction to SMTP and
+The book also contains a chapter that gives a general introduction to SMTP and
 Internet mail. Inevitably, however, the book is unlikely to be fully up-to-date
 with the latest release of Exim. (Note that the earlier book about Exim,
 published by O'Reilly, covers Exim 3, and many things have changed in Exim 4.)
@@ -409,7 +409,7 @@ information.
 .cindex "&_doc/NewStuff_&"
 .cindex "&_doc/ChangeLog_&"
 .cindex "change log"
-As the program develops, there may be features in newer versions that have not
+As Exim develops, there may be features in newer versions that have not
 yet made it into this document, which is updated only when the most significant
 digit of the fractional part of the version number changes. Specifications of
 new features that are not yet in this manual are placed in the file
@@ -420,7 +420,7 @@ incompatibly while they are developing, or even be withdrawn. For this reason,
 they are not documented in this manual. Information about experimental features
 can be found in the file &_doc/experimental.txt_&.
 
-All changes to the program (whether new features, bug fixes, or other kinds of
+All changes to Exim (whether new features, bug fixes, or other kinds of
 change) are noted briefly in the file called &_doc/ChangeLog_&.
 
 .cindex "&_doc/spec.txt_&"
@@ -445,29 +445,28 @@ available in other formats (HTML, PostScript, PDF, and Texinfo). Section
 
 
 
-.section "FTP and web sites" "SECID2"
-.cindex "web site"
+.section "FTP site and websites" "SECID2"
+.cindex "website"
 .cindex "FTP site"
-The primary site for Exim source distributions is currently the University of
-Cambridge's FTP site, whose contents are described in &'Where to find the Exim
-distribution'& below. In addition, there is a web site and an FTP site at
-&%exim.org%&. These are now also hosted at the University of Cambridge. The
-&%exim.org%& site was previously hosted for a number of years by Energis
-Squared, formerly Planet Online Ltd, whose support I gratefully acknowledge.
+The primary site for Exim source distributions is the &%exim.org%& FTP site,
+available over HTTPS, HTTP and FTP.  These services, and the &%exim.org%&
+website, are hosted at the University of Cambridge.
 
 .cindex "wiki"
 .cindex "FAQ"
-As well as Exim distribution tar files, the Exim web site contains a number of
+As well as Exim distribution tar files, the Exim website contains a number of
 differently formatted versions of the documentation. A recent addition to the
-online information is the Exim wiki (&url(http://wiki.exim.org)),
+online information is the Exim wiki (&url(https://wiki.exim.org)),
 which contains what used to be a separate FAQ, as well as various other
 examples, tips, and know-how that have been contributed by Exim users.
+The wiki site should always redirect to the correct place, which is currently
+provided by GitHub, and is open to editing by anyone with a GitHub account.
 
 .cindex Bugzilla
 An Exim Bugzilla exists at &url(https://bugs.exim.org). You can use
 this to report bugs, and also to add items to the wish list. Please search
 first to check that you are not duplicating a previous entry.
-
+Please do not ask for configuration help in the bug-tracker.
 
 
 .section "Mailing lists" "SECID3"
@@ -488,9 +487,9 @@ If you are using a Debian distribution of Exim, you may wish to subscribe to
 the Debian-specific mailing list &'pkg-exim4-users@lists.alioth.debian.org'&
 via this web page:
 .display
-&url(http://lists.alioth.debian.org/mailman/listinfo/pkg-exim4-users)
+&url(https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-exim4-users)
 .endd
-Please ask Debian-specific questions on this list and not on the general Exim
+Please ask Debian-specific questions on that list and not on the general Exim
 lists.
 
 .section "Bug reports" "SECID5"
@@ -505,26 +504,41 @@ message to the &'exim-dev'& mailing list and have it discussed.
 
 .section "Where to find the Exim distribution" "SECTavail"
 .cindex "FTP site"
-.cindex "distribution" "ftp site"
-The master ftp site for the Exim distribution is
+.cindex "HTTPS download site"
+.cindex "distribution" "FTP site"
+.cindex "distribution" "https site"
+The master distribution site for the Exim distribution is
 .display
-&*ftp://ftp.exim.org/pub/exim*&
+&url(https://downloads.exim.org/)
 .endd
-The file references that follow are relative to the &_exim_& directories at
-these sites. There are now quite a number of independent mirror sites around
+The service is available over HTTPS, HTTP and FTP.
+We encourage people to migrate to HTTPS.
+
+The content served at &url(https://downloads.exim.org/) is identical to the
+content served at &url(https://ftp.exim.org/pub/exim) and
+&url(ftp://ftp.exim.org/pub/exim).
+
+If accessing via a hostname containing &'ftp'&, then the file references that
+follow are relative to the &_exim_& directories at these sites.
+If accessing via the hostname &'downloads'& then the subdirectories described
+here are top-level directories.
+
+There are now quite a number of independent mirror sites around
 the world. Those that I know about are listed in the file called &_Mirrors_&.
 
-Within the &_exim_& directory there are subdirectories called &_exim3_& (for
+Within the top exim directory there are subdirectories called &_exim3_& (for
 previous Exim 3 distributions), &_exim4_& (for the latest Exim 4
 distributions), and &_Testing_& for testing versions. In the &_exim4_&
 subdirectory, the current release can always be found in files called
 .display
+&_exim-n.nn.tar.xz_&
 &_exim-n.nn.tar.gz_&
 &_exim-n.nn.tar.bz2_&
 .endd
-where &'n.nn'& is the highest such version number in the directory. The two
+where &'n.nn'& is the highest such version number in the directory. The three
 files contain identical data; the only difference is the type of compression.
-The &_.bz2_& file is usually a lot smaller than the &_.gz_& file.
+The &_.xz_& file is usually the smallest, while the &_.gz_& file is the
+most portable to old systems.
 
 .cindex "distribution" "signing details"
 .cindex "distribution" "public key"
@@ -533,26 +547,23 @@ The distributions will be PGP signed by an individual key of the Release
 Coordinator.  This key will have a uid containing an email address in the
 &'exim.org'& domain and will have signatures from other people, including
 other Exim maintainers.  We expect that the key will be in the "strong set" of
-PGP keys.  There should be a trust path to that key from Nigel Metheringham's
-PGP key, a version of which can be found in the release directory in the file
-&_nigel-pubkey.asc_&.  All keys used will be available in public keyserver pools,
+PGP keys.  There should be a trust path to that key from the Exim Maintainer's
+PGP keys, a version of which can be found in the release directory in the file
+&_Exim-Maintainers-Keyring.asc_&.  All keys used will be available in public keyserver pools,
 such as &'pool.sks-keyservers.net'&.
 
-At time of last update, releases were being made by Phil Pennock and signed with
-key &'0x403043153903637F'&, although that key is expected to be replaced in 2013.
-A trust path from Nigel's key to Phil's can be observed at
-&url(https://www.security.spodhuis.org/exim-trustpath).
-
-Releases have also been authorized to be performed by Todd Lyons who signs with
-key &'0xC4F4F94804D29EBA'&. A direct trust path exists between previous RE Phil
-Pennock and Todd Lyons through a common associate.
+At the time of the last update, releases were being made by Jeremy Harris and signed
+with key &'0xBCE58C8CE41F32DF'&.  Other recent keys used for signing are those
+of Heiko Schlittermann, &'0x26101B62F69376CE'&,
+and of Phil Pennock, &'0x4D1E900E14C1CC04'&.
 
 The signatures for the tar bundles are in:
 .display
+&_exim-n.nn.tar.xz.asc_&
 &_exim-n.nn.tar.gz.asc_&
 &_exim-n.nn.tar.bz2.asc_&
 .endd
-For each released version, the log of changes is made separately available in a
+For each released version, the log of changes is made available in a
 separate file in the directory &_ChangeLogs_& so that it is possible to
 find out what has changed without having to download the entire distribution.
 
@@ -567,7 +578,7 @@ inside the &_exim4_& directory of the FTP site:
 &_exim-texinfo-n.nn.tar.gz_&
 .endd
 These tar files contain only the &_doc_& directory, not the complete
-distribution, and are also available in &_.bz2_& as well as &_.gz_& forms.
+distribution, and are also available in &_.bz2_& and &_.xz_& forms.
 
 
 .section "Limitations" "SECID6"
@@ -610,8 +621,8 @@ a number of common scanners are provided.
 .endlist
 
 
-.section "Run time configuration" "SECID7"
-Exim's run time configuration is held in a single text file that is divided
+.section "Runtime configuration" "SECID7"
+Exim's runtime configuration is held in a single text file that is divided
 into a number of sections. The entries in this file consist of keywords and
 values, in the style of Smail 3 configuration files. A default configuration
 file which is suitable for simple online installations is provided in the
@@ -625,13 +636,13 @@ can be a straight replacement for &_/usr/lib/sendmail_& or
 &_/usr/sbin/sendmail_& when sending mail, but you do not need to know anything
 about Sendmail in order to run Exim. For actions other than sending messages,
 Sendmail-compatible options also exist, but those that produce output (for
-example, &%-bp%&, which lists the messages on the queue) do so in Exim's own
+example, &%-bp%&, which lists the messages in the queue) do so in Exim's own
 format. There are also some additional options that are compatible with Smail
 3, and some further options that are new to Exim. Chapter &<<CHAPcommandline>>&
 documents all Exim's command line options. This information is automatically
 made into the man page that forms part of the Exim distribution.
 
-Control of messages on the queue can be done via certain privileged command
+Control of messages in the queue can be done via certain privileged command
 line options. There is also an optional monitor program called &'eximon'&,
 which displays current information in an X window, and which contains a menu
 interface to Exim's command line administration options.
@@ -642,7 +653,7 @@ interface to Exim's command line administration options.
 .cindex "terminology definitions"
 .cindex "body of message" "definition of"
 The &'body'& of a message is the actual data that the sender wants to transmit.
-It is the last part of a message, and is separated from the &'header'& (see
+It is the last part of a message and is separated from the &'header'& (see
 below) by a blank line.
 
 .cindex "bounce message" "definition of"
@@ -687,7 +698,7 @@ line.
 
 .cindex "local part" "definition of"
 .cindex "domain" "definition of"
-The term &'local part'&, which is taken from RFC 2822, is used to refer to that
+The term &'local part'&, which is taken from RFC 2822, is used to refer to the
 part of an email address that precedes the @ sign. The part that follows the
 @ sign is called the &'domain'& or &'mail domain'&.
 
@@ -703,20 +714,20 @@ host it is running on are &'remote'&.
 message's envelope.
 
 .cindex "queue" "definition of"
-The term &'queue'& is used to refer to the set of messages awaiting delivery,
+The term &'queue'& is used to refer to the set of messages awaiting delivery
 because this term is in widespread use in the context of MTAs. However, in
-Exim's case the reality is more like a pool than a queue, because there is
+Exim's case, the reality is more like a pool than a queue, because there is
 normally no ordering of waiting messages.
 
 .cindex "queue runner" "definition of"
 The term &'queue runner'& is used to describe a process that scans the queue
 and attempts to deliver those messages whose retry times have come. This term
-is used by other MTAs, and also relates to the command &%runq%&, but in Exim
+is used by other MTAs and also relates to the command &%runq%&, but in Exim
 the waiting messages are normally processed in an unpredictable order.
 
 .cindex "spool directory" "definition of"
 The term &'spool directory'& is used for a directory in which Exim keeps the
-messages on its queue &-- that is, those that it is in the process of
+messages in its queue &-- that is, those that it is in the process of
 delivering. This should not be confused with the directory in which local
 mailboxes are stored, which is called a &"spool directory"& by some people. In
 the Exim documentation, &"spool"& is always used in the first sense.
@@ -760,7 +771,7 @@ Foundation; either version 2 of the License, or (at your option) any later
 version.
 This code implements Dan Bernstein's Constant DataBase (cdb) spec. Information,
 the spec and sample code for cdb can be obtained from
-&url(http://www.pobox.com/~djb/cdb.html). This implementation borrows
+&url(https://cr.yp.to/cdb.html). This implementation borrows
 some code from Dan Bernstein's implementation (which has no license
 restrictions applied to it).
 .endblockquote
@@ -814,7 +825,7 @@ Redistributions of any form whatsoever must retain the following
 acknowledgment:
 
 &"This product includes software developed by Computing Services
-at Carnegie Mellon University (&url(http://www.cmu.edu/computing/)."&
+at Carnegie Mellon University (&url(https://www.cmu.edu/computing/)."&
 
 CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO
 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
@@ -868,7 +879,7 @@ source code.
 
 .next
 Many people have contributed code fragments, some large, some small, that were
-not covered by any specific licence requirements. It is assumed that the
+not covered by any specific license requirements. It is assumed that the
 contributors are happy to see their code incorporated into Exim under the GPL.
 .endlist
 
@@ -896,9 +907,9 @@ has been down, and it also maintains per-host retry information.
 .section "Policy control" "SECID11"
 .cindex "policy control" "overview"
 Policy controls are now an important feature of MTAs that are connected to the
-Internet. Perhaps their most important job is to stop MTAs being abused as
+Internet. Perhaps their most important job is to stop MTAs from being abused as
 &"open relays"& by misguided individuals who send out vast amounts of
-unsolicited junk, and want to disguise its source. Exim provides flexible
+unsolicited junk and want to disguise its source. Exim provides flexible
 facilities for specifying policy controls on incoming mail:
 
 .ilist
@@ -974,7 +985,7 @@ example &`16VDhn-0001bo-D3`&. Each part is a sequence of letters and digits,
 normally encoding numbers in base 62. However, in the Darwin operating
 system (Mac OS X) and when Exim is compiled to run under Cygwin, base 36
 (avoiding the use of lower case letters) is used instead, because the message
-id is used to construct file names, and the names of files in those systems are
+id is used to construct filenames, and the names of files in those systems are
 not always case-sensitive.
 
 .cindex "pid (process id)" "re-use of"
@@ -1031,7 +1042,7 @@ command line, or from the body of the message if &%-t%& is also used.
 If the process runs Exim with the &%-bS%& option, the message is also read
 non-interactively, but in this case the recipients are listed at the start of
 the message in a series of SMTP RCPT commands, terminated by a DATA
-command. This is so-called &"batch SMTP"& format,
+command. This is called &"batch SMTP"& format,
 but it isn't really SMTP. The SMTP commands are just another way of passing
 envelope addresses in a non-interactive submission.
 .next
@@ -1055,7 +1066,7 @@ constructed from the login name of the user that called Exim and a default
 qualification domain (which can be set by the &%qualify_domain%& configuration
 option). For local or batch SMTP, a sender address that is passed using the
 SMTP MAIL command is ignored. However, the system administrator may allow
-certain users (&"trusted users"&) to specify a different sender address
+certain users (&"trusted users"&) to specify a different sender addresses
 unconditionally, or all users to specify certain forms of different sender
 address. The &%-f%& option or the SMTP MAIL command is used to specify these
 different addresses. See section &<<SECTtrustedadmin>>& for details of trusted
@@ -1063,10 +1074,10 @@ users, and the &%untrusted_set_sender%& option for a way of allowing untrusted
 users to change sender addresses.
 
 Messages received by either of the non-interactive mechanisms are subject to
-checking by the non-SMTP ACL, if one is defined. Messages received using SMTP
-(either over TCP/IP, or interacting with a local process) can be checked by a
+checking by the non-SMTP ACL if one is defined. Messages received using SMTP
+(either over TCP/IP or interacting with a local process) can be checked by a
 number of ACLs that operate at different times during the SMTP session. Either
-individual recipients, or the entire message, can be rejected if local policy
+individual recipients or the entire message can be rejected if local policy
 requirements are not met. The &[local_scan()]& function (see chapter
 &<<CHAPlocalscan>>&) is run for all incoming messages.
 
@@ -1091,7 +1102,7 @@ the two spool files consist of the message id, followed by &`-H`& for the
 file containing the envelope and header, and &`-D`& for the data file.
 
 .cindex "spool directory" "&_input_& sub-directory"
-By default all these message files are held in a single directory called
+By default, all these message files are held in a single directory called
 &_input_& inside the general Exim spool directory. Some operating systems do
 not perform very well if the number of files in a directory gets large; to
 improve performance in such cases, the &%split_spool_directory%& option can be
@@ -1128,7 +1139,7 @@ delivered (see chapters &<<CHAProutergeneric>>& and
 A message remains in the spool directory until it is completely delivered to
 its recipients or to an error address, or until it is deleted by an
 administrator or by the user who originally created it. In cases when delivery
-cannot proceed &-- for example, when a message can neither be delivered to its
+cannot proceed &-- for example when a message can neither be delivered to its
 recipients nor returned to its sender, the message is marked &"frozen"& on the
 spool, and no more deliveries are attempted.
 
@@ -1143,7 +1154,7 @@ to be sent.
 .oindex "&%ignore_bounce_errors_after%&"
 There are options called &%ignore_bounce_errors_after%& and
 &%timeout_frozen_after%&, which discard frozen messages after a certain time.
-The first applies only to frozen bounces, the second to any frozen messages.
+The first applies only to frozen bounces, the second to all frozen messages.
 
 .cindex "message" "log file for"
 .cindex "log" "file for each message"
@@ -1151,7 +1162,7 @@ While Exim is working on a message, it writes information about each delivery
 attempt to its main log file. This includes successful, unsuccessful, and
 delayed deliveries for each recipient (see chapter &<<CHAPlog>>&). The log
 lines are also written to a separate &'message log'& file for each message.
-These logs are solely for the benefit of the administrator, and are normally
+These logs are solely for the benefit of the administrator and are normally
 deleted along with the spool files when processing of a message is complete.
 The use of individual message logs can be disabled by setting
 &%no_message_logs%&; this might give an improvement in performance on very busy
@@ -1168,7 +1179,7 @@ is updated to indicate which these are, and the journal file is then deleted.
 Updating the spool file is done by writing a new file and renaming it, to
 minimize the possibility of data loss.
 
-Should the system or the program crash after a successful delivery but before
+Should the system or Exim crash after a successful delivery but before
 the spool file has been updated, the journal is left lying around. The next
 time Exim attempts to deliver the message, it reads the journal file and
 updates the spool file before proceeding. This minimizes the chances of double
@@ -1183,11 +1194,11 @@ deliveries caused by crashes.
 The main delivery processing elements of Exim are called &'routers'& and
 &'transports'&, and collectively these are known as &'drivers'&. Code for a
 number of them is provided in the source distribution, and compile-time options
-specify which ones are included in the binary. Run time options specify which
+specify which ones are included in the binary. Runtime options specify which
 ones are actually used for delivering messages.
 
 .cindex "drivers" "instance definition"
-Each driver that is specified in the run time configuration is an &'instance'&
+Each driver that is specified in the runtime configuration is an &'instance'&
 of that particular driver type. Multiple instances are allowed; for example,
 you can set up several different &(smtp)& transports, each with different
 option values that might specify different ports or different timeouts. Each
@@ -1222,8 +1233,8 @@ routers in many different ways, and there may be any number of routers in a
 configuration.
 
 The first router that is specified in a configuration is often one that handles
-addresses in domains that are not recognized specially by the local host. These
-are typically addresses for arbitrary domains on the Internet. A precondition
+addresses in domains that are not recognized specifically by the local host.
+Typically these are addresses for arbitrary domains on the Internet. A precondition
 is set up which looks for the special domains known to the host (for example,
 its own domain name), and the router is run for addresses that do &'not'&
 match. Typically, this is a router that looks up domains in the DNS in order to
@@ -1260,7 +1271,7 @@ When an address is being verified, the routers are run in &"verify mode"&. This
 does not affect the way the routers work, but it is a state that can be
 detected. By this means, a router can be skipped or made to behave differently
 when verifying. A common example is a configuration in which the first router
-sends all messages to a message-scanning program, unless they have been
+sends all messages to a message-scanning program unless they have been
 previously scanned. Thus, the first router accepts all addresses without any
 checking, making it useless for verifying. Normally, the &%no_verify%& option
 would be set for such a router, causing it to be skipped in verify mode.
@@ -1280,8 +1291,8 @@ the following:
 
 .ilist
 &'accept'&: The router accepts the address, and either assigns it to a
-transport, or generates one or more &"child"& addresses. Processing the
-original address ceases,
+transport or generates one or more &"child"& addresses. Processing the
+original address ceases
 .oindex "&%unseen%&"
 unless the &%unseen%& option is set on the router. This option
 can be used to set up multiple deliveries with different routing (for example,
@@ -1296,7 +1307,7 @@ child addresses. Unlike &%pass_router%& (see below) the router specified by
 &%redirect_router%& may be anywhere in the router configuration.
 .next
 &'pass'&: The router recognizes the address, but cannot handle it itself. It
-requests that the address be passed to another router. By default the address
+requests that the address be passed to another router. By default, the address
 is passed to the next router, but this can be changed by setting the
 &%pass_router%& option. However, (unlike &%redirect_router%&) the named router
 must be below the current router (to avoid loops).
@@ -1338,8 +1349,8 @@ facility for this purpose.
 .cindex "address duplicate, discarding"
 .cindex "duplicate addresses"
 Once routing is complete, Exim scans the addresses that are assigned to local
-and remote transports, and discards any duplicates that it finds. During this
-check, local parts are treated as case-sensitive. This happens only when
+and remote transports and discards any duplicates that it finds. During this
+check, local parts are treated case-sensitively. This happens only when
 actually delivering a message; when testing routers with &%-bt%&, all the
 routed addresses are shown.
 
@@ -1353,6 +1364,7 @@ order in which they are tested. The individual configuration options are
 described in more detail in chapter &<<CHAProutergeneric>>&.
 
 .ilist
+.cindex affix "router precondition"
 The &%local_part_prefix%& and &%local_part_suffix%& options can specify that
 the local parts handled by the router may or must have certain prefixes and/or
 suffixes. If a mandatory affix (prefix or suffix) is not present, the router is
@@ -1389,6 +1401,7 @@ of domains that it defines.
 .vindex "&$local_part_prefix$&"
 .vindex "&$local_part$&"
 .vindex "&$local_part_suffix$&"
+.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
@@ -1457,7 +1470,7 @@ be immediately delivered, the system filter is run each time. The filter
 condition &%first_delivery%& can be used to detect the first run of the system
 filter.
 .next
-Each recipient address is offered to each configured router in turn, subject to
+Each recipient address is offered to each configured router, in turn, subject to
 its preconditions, until one is able to handle it. If no router can handle the
 address, that is, if they all decline, the address is failed. Because routers
 can be targeted at particular domains, several locally handled domains can be
@@ -1534,9 +1547,9 @@ deleted, though the message log can optionally be preserved if required.
 Exim's mechanism for retrying messages that fail to get delivered at the first
 attempt is the queue runner process. You must either run an Exim daemon that
 uses the &%-q%& option with a time interval to start queue runners at regular
-intervals, or use some other means (such as &'cron'&) to start them. If you do
+intervals or use some other means (such as &'cron'&) to start them. If you do
 not arrange for queue runners to be run, messages that fail temporarily at the
-first attempt will remain on your queue for ever. A queue runner process works
+first attempt will remain in your queue forever. A queue runner process works
 its way through the queue, one message at a time, trying each delivery that has
 passed its retry time.
 You can run several queue runners at once.
@@ -1605,7 +1618,7 @@ of the list.
 .section "Failures to deliver bounce messages" "SECID22"
 .cindex "bounce message" "failure to deliver"
 If a bounce message (either locally generated or received from a remote host)
-itself suffers a permanent delivery failure, the message is left on the queue,
+itself suffers a permanent delivery failure, the message is left in the queue,
 but it is frozen, awaiting the attention of an administrator. There are options
 that can be used to make Exim discard such failed messages, or to keep them
 for only a short time (see &%timeout_frozen_after%& and
@@ -1650,7 +1663,7 @@ following subdirectories are created:
 .irow &_util_&            "independent utilities"
 .endtable
 
-The main utility programs are contained in the &_src_& directory, and are built
+The main utility programs are contained in the &_src_& directory and are built
 with the Exim binary. The &_util_& directory contains a few optional scripts
 that may be useful to some sites.
 
@@ -1675,8 +1688,8 @@ A C99-capable compiler will be required for the build.
 .section "PCRE library" "SECTpcre"
 .cindex "PCRE library"
 Exim no longer has an embedded PCRE library as the vast majority of
-modern systems include PCRE as a system library, although you may need
-to install the PCRE or PCRE development package for your operating
+modern systems include PCRE as a system library, although you may need to
+install the PCRE package or the PCRE development package for your operating
 system. If your system has a normal PCRE installation the Exim build
 process will need no further configuration. If the library or the
 headers are in an unusual location you will need to either set the PCRE_LIBS
@@ -1685,7 +1698,7 @@ or set PCRE_CONFIG=yes to use the installed &(pcre-config)& command.
 If your operating system has no
 PCRE support then you will need to obtain and build the current PCRE
 from &url(ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/).
-More information on PCRE is available at &url(http://www.pcre.org/).
+More information on PCRE is available at &url(https://www.pcre.org/).
 
 .section "DBM libraries" "SECTdb"
 .cindex "DBM libraries" "discussion of"
@@ -1725,7 +1738,7 @@ Solaris, operates on two files called &_dbmfile.dir_& and &_dbmfile.pag_&.
 The GNU library, &'gdbm'&, operates on a single file. If used via its &'ndbm'&
 compatibility interface it makes two different hard links to it with names
 &_dbmfile.dir_& and &_dbmfile.pag_&, but if used via its native interface, the
-file name is used unmodified.
+filename is used unmodified.
 .next
 .cindex "Berkeley DB library"
 The Berkeley DB package, if called via its &'ndbm'& compatibility interface,
@@ -1738,14 +1751,18 @@ the traditional &'ndbm'& interface.
 .next
 To complicate things further, there are several very different versions of the
 Berkeley DB package. Version 1.85 was stable for a very long time, releases
-2.&'x'& and 3.&'x'& were current for a while, but the latest versions are now
-numbered 4.&'x'&. Maintenance of some of the earlier releases has ceased. All
-versions of Berkeley DB can be obtained from
-&url(http://www.sleepycat.com/).
+2.&'x'& and 3.&'x'& were current for a while, but the latest versions when Exim last revamped support were numbered 4.&'x'&.
+Maintenance of some of the earlier releases has ceased. All versions of
+Berkeley DB could be obtained from
+&url(http://www.sleepycat.com/), which is now a redirect to their new owner's
+page with far newer versions listed.
+It is probably wise to plan to move your storage configurations away from
+Berkeley DB format, as today there are smaller and simpler alternatives more
+suited to Exim's usage model.
 .next
 .cindex "&'tdb'& DBM library"
 Yet another DBM library, called &'tdb'&, is available from
-&url(http://download.sourceforge.net/tdb). It has its own interface, and also
+&url(https://sourceforge.net/projects/tdb/files/). It has its own interface, and also
 operates on a single file.
 .endlist
 
@@ -1803,17 +1820,17 @@ building Exim for the first time, the simplest thing to do is to copy
 &_src/EDITME_& to &_Local/Makefile_&, then read it and edit it appropriately.
 
 There are three settings that you must supply, because Exim will not build
-without them. They are the location of the run time configuration file
+without them. They are the location of the runtime configuration file
 (CONFIGURE_FILE), the directory in which Exim binaries will be installed
 (BIN_DIRECTORY), and the identity of the Exim user (EXIM_USER and
 maybe EXIM_GROUP as well). The value of CONFIGURE_FILE can in fact be
-a colon-separated list of file names; Exim uses the first of them that exists.
+a colon-separated list of filenames; Exim uses the first of them that exists.
 
 There are a few other parameters that can be specified either at build time or
-at run time, to enable the same binary to be used on a number of different
+at runtime, to enable the same binary to be used on a number of different
 machines. However, if the locations of Exim's spool directory and log file
 directory (if not within the spool directory) are fixed, it is recommended that
-you specify them in &_Local/Makefile_& instead of at run time, so that errors
+you specify them in &_Local/Makefile_& instead of at runtime, so that errors
 detected early in Exim's execution (such as a malformed configuration file) can
 be logged.
 
@@ -1839,7 +1856,7 @@ happy with the default settings described in &_exim_monitor/EDITME_&,
 This is all the configuration that is needed in straightforward cases for known
 operating systems. However, the building process is set up so that it is easy
 to override options that are set by default or by operating-system-specific
-configuration files, for example to change the name of the C compiler, which
+configuration files, for example, to change the C compiler, which
 defaults to &%gcc%&. See section &<<SECToverride>>& below for details of how to
 do this.
 
@@ -1858,7 +1875,7 @@ supports the &[iconv()]& function.
 
 However, some of the operating systems that supply &[iconv()]& do not support
 very many conversions. The GNU &%libiconv%& library (available from
-&url(http://www.gnu.org/software/libiconv/)) can be installed on such
+&url(https://www.gnu.org/software/libiconv/)) can be installed on such
 systems to remedy this deficiency, as well as on systems that do not supply
 &[iconv()]& at all. After installing &%libiconv%&, you should add
 .code
@@ -2146,7 +2163,7 @@ libraries need to be installed before compiling Exim.
 However, there are some optional lookup types (such as cdb) for which
 the code is entirely contained within Exim, and no external include
 files or libraries are required. When a lookup type is not included in the
-binary, attempts to configure Exim to use it cause run time configuration
+binary, attempts to configure Exim to use it cause runtime configuration
 errors.
 
 .cindex "pkg-config" "lookups"
@@ -2249,7 +2266,7 @@ As with Exim itself, the final three files need not exist, and in this case the
 &_OS/eximon.conf-Default_& can be overridden dynamically by setting environment
 variables of the same name, preceded by EXIMON_. For example, setting
 EXIMON_LOG_DEPTH in the environment overrides the value of
-LOG_DEPTH at run time.
+LOG_DEPTH at runtime.
 .ecindex IIDbuex
 
 
@@ -2269,10 +2286,10 @@ it may be possible to run Exim without making the binary setuid root (see
 chapter &<<CHAPsecurity>>& for details).
 
 .cindex "CONFIGURE_FILE"
-Exim's run time configuration file is named by the CONFIGURE_FILE setting
+Exim's runtime configuration file is named by the CONFIGURE_FILE setting
 in &_Local/Makefile_&. If this names a single file, and the file does not
 exist, the default configuration file &_src/configure.default_& is copied there
-by the installation script. If a run time configuration file already exists, it
+by the installation script. If a runtime configuration file already exists, it
 is left alone. If CONFIGURE_FILE is a colon-separated list, naming several
 alternative files, no default is installed.
 
@@ -2320,7 +2337,7 @@ INFO_DIRECTORY, as described in section &<<SECTinsinfdoc>>& below.
 For the utility programs, old versions are renamed by adding the suffix &_.O_&
 to their names. The Exim binary itself, however, is handled differently. It is
 installed under a name that includes the version number and the compile number,
-for example &_exim-&version()-1_&. The script then arranges for a symbolic link
+for example, &_exim-&version()-1_&. The script then arranges for a symbolic link
 called &_exim_& to point to the binary. If you are updating a previous version
 of Exim, the script takes care to ensure that the name &_exim_& is never absent
 from the directory (as seen by other processes).
@@ -2368,7 +2385,7 @@ make INSTALL_ARG='-no_symlink exim' install
 .cindex "installing Exim" "&'info'& documentation"
 Not all systems use the GNU &'info'& system for documentation, and for this
 reason, the Texinfo source of Exim's documentation is not included in the main
-distribution. Instead it is available separately from the ftp site (see section
+distribution. Instead it is available separately from the FTP site (see section
 &<<SECTavail>>&).
 
 If you have defined INFO_DIRECTORY in &_Local/Makefile_& and the Texinfo
@@ -2389,7 +2406,7 @@ necessary.
 
 .section "Testing" "SECID34"
 .cindex "testing" "installation"
-Having installed Exim, you can check that the run time configuration file is
+Having installed Exim, you can check that the runtime configuration file is
 syntactically valid by running the following command, which assumes that the
 Exim binary directory is within your PATH environment variable:
 .code
@@ -2463,7 +2480,7 @@ incoming SMTP mail.
 
 Testing a new version on a system that is already running Exim can most easily
 be done by building a binary with a different CONFIGURE_FILE setting. From
-within the run time configuration, all other file and directory names
+within the runtime configuration, all other file and directory names
 that Exim uses can be altered, in order to keep it entirely clear of the
 production version.
 
@@ -2779,7 +2796,7 @@ function, which provides extensive line-editing facilities, for reading the
 test data. A line history is supported.
 
 Long expansion expressions can be split over several lines by using backslash
-continuations. As in Exim's run time configuration, white space at the start of
+continuations. As in Exim's runtime configuration, white space at the start of
 continuation lines is ignored. Each argument or data line is passed through the
 string expansion mechanism, and the result is output. Variable values from the
 configuration file (for example, &$qualify_domain$&) are available, but no
@@ -2885,12 +2902,14 @@ actually being delivered.
 
 .vitem &%-bfp%&&~<&'prefix'&>
 .oindex "&%-bfp%&"
+.cindex affix "filter testing"
 This sets the prefix of the local part of the recipient address when a filter
 file is being tested by means of the &%-bf%& option. The default is an empty
 prefix.
 
 .vitem &%-bfs%&&~<&'suffix'&>
 .oindex "&%-bfs%&"
+.cindex affix "filter testing"
 This sets the suffix of the local part of the recipient address when a filter
 file is being tested by means of the &%-bf%& option. The default is an empty
 suffix.
@@ -2946,7 +2965,7 @@ acceptable or not. See section &<<SECTcheckaccess>>&.
 Features such as authentication and encryption, where the client input is not
 plain text, cannot easily be tested with &%-bh%&. Instead, you should use a
 specialized SMTP test program such as
-&url(http://jetmore.org/john/code/#swaks,swaks).
+&url(https://www.jetmore.org/john/code/swaks/,swaks).
 
 .vitem &%-bhc%&&~<&'IP&~address'&>
 .oindex "&%-bhc%&"
@@ -3111,7 +3130,7 @@ mysql_servers = <value not displayable>
 If &%config%& is given as an argument, the config is
 output, as it was parsed, any include file resolved, any comment removed.
 
-If &%config_file%& is given as an argument, the name of the run time
+If &%config_file%& is given as an argument, the name of the runtime
 configuration file is output. (&%configure_file%& works too, for
 backward compatibility.)
 If a list of configuration files was supplied, the value that is output here
@@ -3162,22 +3181,20 @@ If invoked by an admin user, then &%macro%&, &%macro_list%& and &%macros%&
 are available, similarly to the drivers.  Because macros are sometimes used
 for storing passwords, this option is restricted.
 The output format is one item per line.
-.new
 For the "-bP macro <name>" form, if no such macro is found
 the exit status will be nonzero.
-.wen
 
 .vitem &%-bp%&
 .oindex "&%-bp%&"
-.cindex "queue" "listing messages on"
-.cindex "listing" "messages on the queue"
+.cindex "queue" "listing messages in"
+.cindex "listing" "messages in the queue"
 This option requests a listing of the contents of the mail queue on the
 standard output. If the &%-bp%& option is followed by a list of message ids,
 just those messages are listed. By default, this option can be used only by an
 admin user. However, the &%queue_list_requires_admin%& option can be set false
 to allow any user to see the queue.
 
-Each message on the queue is displayed as in the following example:
+Each message in the queue is displayed as in the following example:
 .code
 25m  2.9K 0t5C6f-0000c8-00 <alice@wonderland.fict.example>
           red.king@looking-glass.fict.example
@@ -3185,7 +3202,7 @@ Each message on the queue is displayed as in the following example:
 .endd
 .cindex "message" "size in queue listing"
 .cindex "size" "of message"
-The first line contains the length of time the message has been on the queue
+The first line contains the length of time the message has been in the queue
 (in this case 25 minutes), the size of the message (2.9K), the unique local
 identifier for the message, and the message sender, as contained in the
 envelope. For bounce messages, the sender address is empty, and appears as
@@ -3216,7 +3233,7 @@ of just &"D"&.
 .vitem &%-bpc%&
 .oindex "&%-bpc%&"
 .cindex "queue" "count of messages on"
-This option counts the number of messages on the queue, and writes the total
+This option counts the number of messages in the queue, and writes the total
 to the standard output. It is restricted to admin users, unless
 &%queue_list_requires_admin%& is set false.
 
@@ -3225,7 +3242,7 @@ to the standard output. It is restricted to admin users, unless
 .oindex "&%-bpr%&"
 This option operates like &%-bp%&, but the output is not sorted into
 chronological order of message arrival. This can speed it up when there are
-lots of messages on the queue, and is particularly useful if the output is
+lots of messages in the queue, and is particularly useful if the output is
 going to be post-processed in a way that doesn't need the sorting.
 
 .vitem &%-bpra%&
@@ -3396,7 +3413,7 @@ This option causes Exim to write the current version number, compilation
 number, and compilation date of the &'exim'& binary to the standard output.
 It also lists the DBM library that is being used, the optional modules (such as
 specific lookup types), the drivers that are included in the binary, and the
-name of the run time configuration file that is in use.
+name of the runtime configuration file that is in use.
 
 As part of its operation, &%-bV%& causes Exim to read and syntax check its
 configuration file. However, this is a static check only. It cannot check
@@ -3485,10 +3502,10 @@ which the daemon will exit, which should cause inetd to listen once more.
 .cindex "configuration file" "alternate"
 .cindex "CONFIGURE_FILE"
 .cindex "alternate configuration file"
-This option causes Exim to find the run time configuration file from the given
+This option causes Exim to find the runtime configuration file from the given
 list instead of from the list specified by the CONFIGURE_FILE
-compile-time setting. Usually, the list will consist of just a single file
-name, but it can be a colon-separated list of names. In this case, the first
+compile-time setting. Usually, the list will consist of just a single filename,
+but it can be a colon-separated list of names. In this case, the first
 file that exists is used. Failure to open an existing file stops Exim from
 proceeding any further along the list, and an error is generated.
 
@@ -3508,15 +3525,15 @@ even if the caller is root. The reception works, but by that time, Exim is
 running as the Exim user, so when it re-executes to regain privilege for the
 delivery, the use of &%-C%& causes privilege to be lost. However, root can
 test reception and delivery using two separate commands (one to put a message
-on the queue, using &%-odq%&, and another to do the delivery, using &%-M%&).
+in the queue, using &%-odq%&, and another to do the delivery, using &%-M%&).
 
 If ALT_CONFIG_PREFIX is defined &_in Local/Makefile_&, it specifies a
 prefix string with which any file named in a &%-C%& command line option
-must start. In addition, the file name must not contain the sequence &`/../`&.
+must start. In addition, the filename must not contain the sequence &`/../`&.
 However, if the value of the &%-C%& option is identical to the value of
 CONFIGURE_FILE in &_Local/Makefile_&, Exim ignores &%-C%& and proceeds as
 usual. There is no default setting for ALT_CONFIG_PREFIX; when it is
-unset, any file name can be used with &%-C%&.
+unset, any filename can be used with &%-C%&.
 
 ALT_CONFIG_PREFIX can be used to confine alternative configuration files
 to a directory to which only root has access. This prevents someone who has
@@ -3603,7 +3620,8 @@ are:
                     &<<CHAPlocalscan>>&)
 &`lookup         `& general lookup code and all lookups
 &`memory         `& memory handling
-&`pid            `& add pid to debug output lines
+&`noutf8         `& modifier: avoid UTF-8 line-drawing
+&`pid            `& modifier: add pid to debug output lines
 &`process_info   `& setting info for the process log
 &`queue_run      `& queue runs
 &`receive        `& general message reception logic
@@ -3611,7 +3629,7 @@ are:
 &`retry          `& retry handling
 &`rewrite        `& address rewriting
 &`route          `& address routing
-&`timestamp      `& add timestamp to debug output lines
+&`timestamp      `& modifier: add timestamp to debug output lines
 &`tls            `& TLS logic
 &`transport      `& transports
 &`uid            `& changes of uid/gid and looking up uid/gid
@@ -3643,6 +3661,15 @@ The &`timestamp`& selector causes the current time to be inserted at the start
 of all debug output lines. This can be useful when trying to track down delays
 in processing.
 
+.new
+.cindex debugging "UTF-8 in"
+.cindex UTF-8 "in debug output"
+The &`noutf8`& selector disables the use of
+UTF-8 line-drawing characters to group related information.
+When disabled. ascii-art is used instead.
+Using the &`+all`& option does not set this modifier,
+.wen
+
 If the &%debug_print%& option is set in any driver, it produces output whenever
 any debugging is selected, or if &%-v%& is used.
 
@@ -3838,7 +3865,7 @@ alternate queue is used, named by the following argument.
 .vitem &%-MCK%&
 .oindex "&%-MCK%&"
 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 an
+by Exim in conjunction with the &%-MC%& option. It signifies that a
 remote host supports the ESMTP &_CHUNKING_& extension.
 
 .vitem &%-MCP%&
@@ -3880,7 +3907,7 @@ The arguments give the local address and port being proxied, and the TLS cipher.
 .oindex "&%-Mc%&"
 .cindex "hints database" "not overridden by &%-Mc%&"
 .cindex "delivery" "manually started &-- not forced"
-This option requests Exim to run a delivery attempt on each message in turn,
+This option requests Exim to run a delivery attempt on each message, in turn,
 but unlike the &%-M%& option, it does check for retry hints, and respects any
 that are found. This option is not very useful to external callers. It is
 provided mainly for internal use by Exim when it needs to re-invoke itself in
@@ -3955,10 +3982,19 @@ This option requests Exim to remove the given messages from the queue. No
 bounce messages are sent; each message is simply forgotten. However, if any of
 the messages are active, their status is not altered. This option can be used
 only by an admin user or by the user who originally caused the message to be
-placed on the queue.
+placed in the queue.
+
+. .new
+. .vitem &%-MS%&
+. .oindex "&%-MS%&"
+. .cindex REQUIRETLS
+. This option is used to request REQUIRETLS processing on the message.
+. It is used internally by Exim in conjunction with -E when generating
+. a bounce message.
+. .wen
 
 .vitem &%-Mset%&&~<&'message&~id'&>
-.oindex "&%-Mset%&
+.oindex "&%-Mset%&"
 .cindex "testing" "string expansion"
 .cindex "expansion" "testing"
 This option is useful only in conjunction with &%-be%& (that is, when testing
@@ -4051,7 +4087,7 @@ Exim.
 .oindex "&%-oA%&"
 .cindex "Sendmail compatibility" "&%-oA%& option"
 This option is used by Sendmail in conjunction with &%-bi%& to specify an
-alternative alias file name. Exim handles &%-bi%& differently; see the
+alternative alias filename. Exim handles &%-bi%& differently; see the
 description above.
 
 .vitem &%-oB%&&~<&'n'&>
@@ -4100,7 +4136,7 @@ However, like &%-odb%&, this option has no effect if &%queue_only_override%& is
 false and one of the queueing options in the configuration file is in effect.
 
 If there is a temporary delivery error during foreground delivery, the
-message is left on the queue for later delivery, and the original reception
+message is left in the queue for later delivery, and the original reception
 process exits. See chapter &<<CHAPnonqueueing>>& for a way of setting up a
 restricted configuration that never queues messages.
 
@@ -4118,7 +4154,7 @@ Sendmail.
 This option applies to all modes in which Exim accepts incoming messages,
 including the listening daemon. It specifies that the accepting process should
 not automatically start a delivery process for each message received. Messages
-are placed on the queue, and remain there until a subsequent queue runner
+are placed in the queue, and remain there until a subsequent queue runner
 process encounters them. There are several configuration options (such as
 &%queue_only%&) that can be used to queue incoming messages under certain
 conditions. This option overrides all of them and also &%-odqs%&. It always
@@ -4136,7 +4172,7 @@ When &%-odqs%& does operate, a delivery process is started for each incoming
 message, in the background by default, but in the foreground if &%-odi%& is
 also present. The recipient addresses are routed, and local deliveries are done
 in the normal way. However, if any SMTP deliveries are required, they are not
-done at this time, so the message remains on the queue until a subsequent queue
+done at this time, so the message remains in the queue until a subsequent queue
 runner process encounters it. Because routing was done, Exim knows which
 messages are waiting for which hosts, and so a number of messages for the same
 host can be sent in a single SMTP connection. The &%queue_smtp_domains%&
@@ -4355,7 +4391,7 @@ This option is relevant only when the &%-bd%& (start listening daemon) option
 is also given. It controls which ports and interfaces the daemon uses. Details
 of the syntax, and how it interacts with configuration file options, are given
 in chapter &<<CHAPinterfaces>>&. When &%-oX%& is used to start a daemon, no pid
-file is written unless &%-oP%& is also present to specify a pid file name.
+file is written unless &%-oP%& is also present to specify a pid filename.
 
 .vitem &%-pd%&
 .oindex "&%-pd%&"
@@ -4457,7 +4493,7 @@ intermittently.
 .cindex "queue" "initial delivery"
 If the &'i'& flag is present, the queue runner runs delivery processes only for
 those messages that haven't previously been tried. (&'i'& stands for &"initial
-delivery"&.) This can be helpful if you are putting messages on the queue using
+delivery"&.) This can be helpful if you are putting messages in the queue using
 &%-odq%& and want a queue runner just to process the new messages.
 
 .vitem &%-q[q][i]f...%&
@@ -4478,7 +4514,7 @@ frozen or not.
 .oindex "&%-ql%&"
 .cindex "queue" "local deliveries only"
 The &'l'& (the letter &"ell"&) flag specifies that only local deliveries are to
-be done. If a message requires any remote deliveries, it remains on the queue
+be done. If a message requires any remote deliveries, it remains in the queue
 for later delivery.
 
 .vitem &%-q[q][i][f[f]][l][G<name>[/<time>]]]%&
@@ -4730,16 +4766,16 @@ under most shells.
 . ////////////////////////////////////////////////////////////////////////////
 
 
-.chapter "The Exim run time configuration file" "CHAPconf" &&&
+.chapter "The Exim runtime configuration file" "CHAPconf" &&&
          "The runtime configuration file"
 
-.cindex "run time configuration"
+.cindex "runtime configuration"
 .cindex "configuration file" "general description"
 .cindex "CONFIGURE_FILE"
 .cindex "configuration file" "errors in"
 .cindex "error" "in configuration file"
 .cindex "return code" "for bad configuration"
-Exim uses a single run time configuration file that is read whenever an Exim
+Exim uses a single runtime configuration file that is read whenever an Exim
 binary is executed. Note that in normal operation, this happens frequently,
 because Exim is designed to operate in a distributed manner, without central
 control.
@@ -4754,7 +4790,7 @@ actually alter the string.
 The name of the configuration file is compiled into the binary for security
 reasons, and is specified by the CONFIGURE_FILE compilation option. In
 most configurations, this specifies a single file. However, it is permitted to
-give a colon-separated list of file names, in which case Exim uses the first
+give a colon-separated list of filenames, in which case Exim uses the first
 existing file in the list.
 
 .cindex "EXIM_USER"
@@ -4763,26 +4799,26 @@ existing file in the list.
 .cindex "CONFIGURE_GROUP"
 .cindex "configuration file" "ownership"
 .cindex "ownership" "configuration file"
-The run time configuration file must be owned by root or by the user that is
+The runtime configuration file must be owned by root or by the user that is
 specified at compile time by the CONFIGURE_OWNER option (if set). The
 configuration file must not be world-writeable, or group-writeable unless its
 group is the root group or the one specified at compile time by the
 CONFIGURE_GROUP option.
 
 &*Warning*&: In a conventional configuration, where the Exim binary is setuid
-to root, anybody who is able to edit the run time configuration file has an
+to root, anybody who is able to edit the runtime configuration file has an
 easy way to run commands as root. If you specify a user or group in the
 CONFIGURE_OWNER or CONFIGURE_GROUP options, then that user and/or any users
 who are members of that group will trivially be able to obtain root privileges.
 
-Up to Exim version 4.72, the run time configuration file was also permitted to
+Up to Exim version 4.72, the runtime configuration file was also permitted to
 be writeable by the Exim user and/or group. That has been changed in Exim 4.73
 since it offered a simple privilege escalation for any attacker who managed to
 compromise the Exim user account.
 
 A default configuration file, which will work correctly in simple situations,
 is provided in the file &_src/configure.default_&. If CONFIGURE_FILE
-defines just one file name, the installation process copies the default
+defines just one filename, the installation process copies the default
 configuration to a new file of that name if it did not previously exist. If
 CONFIGURE_FILE is a list, no default is automatically installed. Chapter
 &<<CHAPdefconfil>>& is a &"walk-through"& discussion of the default
@@ -4810,14 +4846,14 @@ delivery, even if the caller is root. The reception works, but by that time,
 Exim is running as the Exim user, so when it re-execs to regain privilege for
 the delivery, the use of &%-C%& causes privilege to be lost. However, root
 can test reception and delivery using two separate commands (one to put a
-message on the queue, using &%-odq%&, and another to do the delivery, using
+message in the queue, using &%-odq%&, and another to do the delivery, using
 &%-M%&).
 
 If ALT_CONFIG_PREFIX is defined &_in Local/Makefile_&, it specifies a
 prefix string with which any file named in a &%-C%& command line option must
-start. In addition, the file name must not contain the sequence &"&`/../`&"&.
-There is no default setting for ALT_CONFIG_PREFIX; when it is unset, any file
-name can be used with &%-C%&.
+start. In addition, the filename must not contain the sequence &"&`/../`&"&.
+There is no default setting for ALT_CONFIG_PREFIX; when it is unset, any
+filename can be used with &%-C%&.
 
 One-off changes to a configuration can be specified by the &%-D%& command line
 option, which defines and overrides values for macros used inside the
@@ -4839,10 +4875,10 @@ values for the macros satisfy the regexp: &`^[A-Za-z0-9_/.-]*$`&
 Some sites may wish to use the same Exim binary on different machines that
 share a file system, but to use different configuration files on each machine.
 If CONFIGURE_FILE_USE_NODE is defined in &_Local/Makefile_&, Exim first
-looks for a file whose name is the configuration file name followed by a dot
+looks for a file whose name is the configuration filename followed by a dot
 and the machine's node name, as obtained from the &[uname()]& function. If this
 file does not exist, the standard name is tried. This processing occurs for
-each file name in the list given by CONFIGURE_FILE or &%-C%&.
+each filename in the list given by CONFIGURE_FILE or &%-C%&.
 
 In some esoteric situations different versions of Exim may be run under
 different effective uids and the CONFIGURE_FILE_USE_EUID is defined to
@@ -4928,18 +4964,18 @@ described.
 .cindex "configuration file" "including other files"
 .cindex "&`.include`& in configuration file"
 .cindex "&`.include_if_exists`& in configuration file"
-You can include other files inside Exim's run time configuration file by
+You can include other files inside Exim's runtime configuration file by
 using this syntax:
 .display
-&`.include`& <&'file name'&>
-&`.include_if_exists`& <&'file name'&>
+&`.include`& <&'filename'&>
+&`.include_if_exists`& <&'filename'&>
 .endd
-on a line by itself. Double quotes round the file name are optional. If you use
+on a line by itself. Double quotes round the filename are optional. If you use
 the first form, a configuration error occurs if the file does not exist; the
 second form does nothing for non-existent files.
 The first form allows a relative name. It is resolved relative to
-the directory of the including file. For the second form an absolute file
-name is required.
+the directory of the including file. For the second form an absolute filename
+is required.
 
 Includes may be nested to any depth, but remember that Exim reads its
 configuration file often, so it is a good idea to keep them to a minimum.
@@ -4981,7 +5017,7 @@ ACL, or in the &%local_scan%&, retry, or rewrite sections of the configuration.
 .section "Macro substitution" "SECID42"
 Once a macro is defined, all subsequent lines in the file (and any included
 files) are scanned for the macro name; if there are several macros, the line is
-scanned for each in turn, in the order in which the macros are defined. The
+scanned for each, in turn, in the order in which the macros are defined. The
 replacement text is not re-scanned for the current macro, though it is scanned
 for subsequently defined macros. For this reason, a macro name may not contain
 the name of a previously defined macro as a substring. You could, for example,
@@ -5058,6 +5094,7 @@ The following classes of macros are defined:
 &` _DRIVER_ROUTER_*           `&  router drivers
 &` _DRIVER_TRANSPORT_*        `&  transport drivers
 &` _DRIVER_AUTHENTICATOR_*    `&  authenticator drivers
+&` _LOG_*                     `&  log_selector values
 &` _OPT_MAIN_*                `&  main config options
 &` _OPT_ROUTERS_*             `&  generic router options
 &` _OPT_TRANSPORTS_*          `&  generic transport options
@@ -5485,10 +5522,27 @@ mentioned at all in the default configuration.
 
 
 
+.section "Macros" "SECTdefconfmacros"
+All macros should be defined before any options.
+
+One macro is specified, but commented out, in the default configuration:
+.code
+# ROUTER_SMARTHOST=MAIL.HOSTNAME.FOR.CENTRAL.SERVER.EXAMPLE
+.endd
+If all off-site mail is expected to be delivered to a "smarthost", then set the
+hostname here and uncomment the macro.  This will affect which router is used
+later on.  If this is left commented out, then Exim will perform direct-to-MX
+deliveries using a &(dnslookup)& router.
+
+In addition to macros defined here, Exim includes a number of built-in macros
+to enable configuration to be guarded by a binary built with support for a
+given feature.  See section &<<SECTbuiltinmacros>>& for more details.
+
+
 .section "Main configuration settings" "SECTdefconfmain"
-The main (global) configuration option settings must always come first in the
-file. The first thing you'll see in the file, after some initial comments, is
-the line
+The main (global) configuration option settings section must always come first
+in the file, after the macros.
+The first thing you'll see in the file, after some initial comments, is the line
 .code
 # primary_hostname =
 .endd
@@ -5570,7 +5624,7 @@ Three more commented-out option settings follow:
 These are example settings that can be used when Exim is compiled with
 support for TLS (aka SSL) as described in section &<<SECTinctlsssl>>&. The
 first one specifies the list of clients that are allowed to use TLS when
-connecting to this server; in this case the wildcard means all clients. The
+connecting to this server; in this case, the wildcard means all clients. The
 other options specify where Exim should find its TLS certificate and private
 key, which together prove the server's identity to any clients that connect.
 More details are given in chapter &<<CHAPTLS>>&.
@@ -5716,7 +5770,7 @@ ignore_bounce_errors_after = 2d
 timeout_frozen_after = 7d
 .endd
 The first of these options specifies that failing bounce messages are to be
-discarded after 2 days on the queue. The second specifies that any frozen
+discarded after 2 days in the queue. The second specifies that any frozen
 message (whether a bounce message or not) is to be timed out (and discarded)
 after a week. In this configuration, the first setting ensures that no failing
 bounce message ever lasts a week.
@@ -5840,7 +5894,7 @@ common convention of local parts constructed as
 &"&'first-initial.second-initial.family-name'&"& when applied to someone like
 the author of Exim, who has no second initial.) However, a local part starting
 with a dot or containing &"/../"& can cause trouble if it is used as part of a
-file name (for example, for a mailing list). This is also true for local parts
+filename (for example, for a mailing list). This is also true for local parts
 that contain slashes. A pipe symbol can also be troublesome if the local part
 is incorporated unthinkingly into a shell command line.
 
@@ -5976,7 +6030,7 @@ by the line
 begin routers
 .endd
 Routers are the modules in Exim that make decisions about where to send
-messages. An address is passed to each router in turn, until it is either
+messages. An address is passed to each router, in turn, until it is either
 accepted, or failed. This means that the order in which you define the routers
 matters. Each router is fully described in its own chapter later in this
 manual. Here we give only brief overviews.
@@ -5991,16 +6045,35 @@ This router is commented out because the majority of sites do not want to
 support domain literal addresses (those of the form &'user@[10.9.8.7]'&). If
 you uncomment this router, you also need to uncomment the setting of
 &%allow_domain_literals%& in the main part of the configuration.
+
+Which router is used next depends upon whether or not the ROUTER_SMARTHOST
+macro has been defined, per
 .code
+.ifdef ROUTER_SMARTHOST
+smarthost:
+#...
+.else
 dnslookup:
-  driver = dnslookup
+#...
+.endif
+.endd
+
+If ROUTER_SMARTHOST has been defined, either at the top of the file or on the
+command-line, then we route all non-local mail to that smarthost; otherwise, we'll
+perform DNS lookups for direct-to-MX lookup.  Any mail which is to a local domain will
+skip these routers because of the &%domains%& option.
+
+.code
+smarthost:
+  driver = manualroute
   domains = ! +local_domains
-  transport = remote_smtp
-  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
+  transport = smarthost_smtp
+  route_data = ROUTER_SMARTHOST
+  ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
   no_more
 .endd
-The first uncommented router handles addresses that do not involve any local
-domains. This is specified by the line
+This router only handles mail which is not to any local domains; this is
+specified by the line
 .code
 domains = ! +local_domains
 .endd
@@ -6011,6 +6084,29 @@ the start of the configuration). The plus sign before &'local_domains'&
 indicates that it is referring to a named list. Addresses in other domains are
 passed on to the following routers.
 
+The name of the router driver is &(manualroute)& because we are manually
+specifying how mail should be routed onwards, instead of using DNS MX.
+While the name of this router instance is arbitrary, the &%driver%& option must
+be one of the driver modules that is in the Exim binary.
+
+With no pre-conditions other than &%domains%&, all mail for non-local domains
+will be handled by this router, and the &%no_more%& setting will ensure that no
+other routers will be used for messages matching the pre-conditions.  See
+&<<SECTrouprecon>>& for more on how the pre-conditions apply.  For messages which
+are handled by this router, we provide a hostname to deliver to in &%route_data%&
+and the macro supplies the value; the address is then queued for the
+&(smarthost_smtp)& transport.
+
+.code
+dnslookup:
+  driver = dnslookup
+  domains = ! +local_domains
+  transport = remote_smtp
+  ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
+  no_more
+.endd
+The &%domains%& option behaves as per smarthost, above.
+
 The name of the router driver is &(dnslookup)&,
 and is specified by the &%driver%& option. Do not be confused by the fact that
 the name of this router instance is the same as the name of the driver. The
@@ -6152,17 +6248,89 @@ not matter. The transports section of the configuration starts with
 .code
 begin transports
 .endd
-One remote transport and four local transports are defined.
+Two remote transports and four local transports are defined.
 .code
 remote_smtp:
   driver = smtp
+  message_size_limit = ${if > {$max_received_linelength}{998} {1}{0}}
+.ifdef _HAVE_DANE
+  dnssec_request_domains = *
+  hosts_try_dane = *
+.endif
+.ifdef _HAVE_PRDR
   hosts_try_prdr = *
+.endif
 .endd
 This transport is used for delivering messages over SMTP connections.
 The list of remote hosts comes from the router.
-The &%hosts_try_prdr%& option enables an efficiency SMTP option.
-It is negotiated between client and server
-and not expected to cause problems but can be disabled if needed.
+The &%message_size_limit%& usage is a hack to avoid sending on messages
+with over-long lines.  The built-in macro _HAVE_DANE guards configuration
+to try to use DNSSEC for all queries and to use DANE for delivery;
+see section &<<SECDANE>>& for more details.
+
+The &%hosts_try_prdr%& option enables an efficiency SMTP option.  It is
+negotiated between client and server and not expected to cause problems
+but can be disabled if needed.  The built-in macro _HAVE_PRDR guards the
+use of the &%hosts_try_prdr%& configuration option.
+
+The other remote transport is used when delivering to a specific smarthost
+with whom there must be some kind of existing relationship, instead of the
+usual federated system.
+
+.code
+smarthost_smtp:
+  driver = smtp
+  message_size_limit = ${if > {$max_received_linelength}{998} {1}{0}}
+  multi_domain
+  #
+.ifdef _HAVE_TLS
+  # Comment out any of these which you have to, then file a Support
+  # request with your smarthost provider to get things fixed:
+  hosts_require_tls = *
+  tls_verify_hosts = *
+  # As long as tls_verify_hosts is enabled, this won't matter, but if you
+  # have to comment it out then this will at least log whether you succeed
+  # or not:
+  tls_try_verify_hosts = *
+  #
+  # The SNI name should match the name which we'll expect to verify;
+  # many mail systems don't use SNI and this doesn't matter, but if it does,
+  # we need to send a name which the remote site will recognize.
+  # This _should_ be the name which the smarthost operators specified as
+  # the hostname for sending your mail to.
+  tls_sni = ROUTER_SMARTHOST
+  #
+.ifdef _HAVE_OPENSSL
+  tls_require_ciphers = HIGH:!aNULL:@STRENGTH
+.endif
+.ifdef _HAVE_GNUTLS
+  tls_require_ciphers = SECURE192:-VERS-SSL3.0:-VERS-TLS1.0:-VERS-TLS1.1
+.endif
+.endif
+.ifdef _HAVE_PRDR
+  hosts_try_prdr = *
+.endif
+.endd
+After the same &%message_size_limit%& hack, we then specify that this Transport
+can handle messages to multiple domains in one run.  The assumption here is
+that you're routing all non-local mail to the same place and that place is
+happy to take all messages from you as quickly as possible.
+All other options depend upon built-in macros; if Exim was built without TLS support
+then no other options are defined.
+If TLS is available, then we configure "stronger than default" TLS ciphersuites
+and versions using the &%tls_require_ciphers%& option, where the value to be
+used depends upon the library providing TLS.
+Beyond that, the options adopt the stance that you should have TLS support available
+from your smarthost on today's Internet, so we turn on requiring TLS for the
+mail to be delivered, and requiring that the certificate be valid, and match
+the expected hostname.  The &%tls_sni%& option can be used by service providers
+to select an appropriate certificate to present to you and here we re-use the
+ROUTER_SMARTHOST macro, because that is unaffected by CNAMEs present in DNS.
+You want to specify the hostname which you'll expect to validate for, and that
+should not be subject to insecure tampering via DNS results.
+
+For the &%hosts_try_prdr%& option see the previous transport.
+
 All other options are defaulted.
 .code
 local_delivery:
@@ -6316,6 +6484,9 @@ online Perl manpages, in
 many Perl reference books, and also in
 Jeffrey Friedl's &'Mastering Regular Expressions'&, which is published by
 O'Reilly (see &url(http://www.oreilly.com/catalog/regex2/)).
+. --- the http: URL here redirects to another page with the ISBN in the URL
+. --- where trying to use https: just redirects back to http:, so sticking
+. --- to the old URL for now.  2018-09-07.
 
 The documentation for the syntax and semantics of the regular expressions that
 are supported by PCRE is included in the PCRE distribution, and no further
@@ -6482,13 +6653,15 @@ The following single-key lookup types are implemented:
 string without a terminating binary zero. The cdb format is designed for
 indexed files that are read frequently and never updated, except by total
 re-creation. As such, it is particularly suitable for large files containing
-aliases or other indexed data referenced by an MTA. Information about cdb can
-be found in several places:
+aliases or other indexed data referenced by an MTA. Information about cdb and
+tools for building the files can be found in several places:
 .display
-&url(http://www.pobox.com/~djb/cdb.html)
-&url(ftp://ftp.corpit.ru/pub/tinycdb/)
-&url(http://packages.debian.org/stable/utils/freecdb.html)
+&url(https://cr.yp.to/cdb.html)
+&url(http://www.corpit.ru/mjt/tinycdb.html)
+&url(https://packages.debian.org/stable/utils/freecdb)
+&url(https://github.com/philpennock/cdbtools) (in Go)
 .endd
+. --- 2018-09-07: corpit.ru http:-only
 A cdb distribution is not needed in order to build Exim with cdb support,
 because the code for reading cdb files is included directly in Exim itself.
 However, no means of building or testing cdb files is provided with Exim, so
@@ -6691,6 +6864,12 @@ be followed by optional colons.
 &*Warning*&: Unlike most other single-key lookup types, a file of data for
 &((n)wildlsearch)& can &'not'& be turned into a DBM or cdb file, because those
 lookup types support only literal keys.
+
+.next
+.cindex "lookup" "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
 
 
@@ -6760,7 +6939,7 @@ passed to a Redis database. See section &<<SECTsql>>&.
 .next
 .cindex "sqlite lookup type"
 .cindex "lookup" "sqlite"
-&(sqlite)&: The format of the query is a file name followed by an SQL statement
+&(sqlite)&: The format of the query is a filename followed by an SQL statement
 that is passed to an SQLite database. See section &<<SECTsqlite>>&.
 
 .next
@@ -6769,6 +6948,7 @@ not likely to be useful in normal operation.
 .next
 .cindex "whoson lookup type"
 .cindex "lookup" "whoson"
+. --- still http:-only, 2018-09-07
 &(whoson)&: &'Whoson'& (&url(http://whoson.sourceforge.net)) is a protocol that
 allows a server to check whether a particular (dynamically allocated) IP
 address is currently allocated to a known (trusted) user and, optionally, to
@@ -7801,7 +7981,7 @@ affected.
 .section "More about SQLite" "SECTsqlite"
 .cindex "lookup" "SQLite"
 .cindex "sqlite lookup type"
-SQLite is different to the other SQL lookups because a file name is required in
+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
@@ -7839,6 +8019,17 @@ ${lookup redis{set keyname ${quote_redis:objvalue plus}}}
 ${lookup redis{get keyname}}
 .endd
 
+As of release 4.91, "lightweight" support for Redis Cluster is available.
+Requires &%redis_servers%& list to contain all the servers in the cluster, all
+of which must be reachable from the running exim instance. If the cluster has
+master/slave replication, the list must contain all the master and slave
+servers.
+
+When the Redis Cluster returns a "MOVED" response to a query, Exim does not
+immediately follow the redirection but treats the response as a DEFER, moving on
+to the next server in the &%redis_servers%& list until the correct server is
+reached.
+
 .ecindex IIDfidalo1
 .ecindex IIDfidalo2
 
@@ -7936,11 +8127,11 @@ item.
 
 
 .section "File names in lists" "SECTfilnamlis"
-.cindex "list" "file name in"
-If an item in a domain, host, address, or local part list is an absolute file
-name (beginning with a slash character), each line of the file is read and
+.cindex "list" "filename in"
+If an item in a domain, host, address, or local part list is an absolute
+filename (beginning with a slash character), each line of the file is read and
 processed as if it were an independent item in the list, except that further
-file names are not allowed,
+filenames are not allowed,
 and no expansion of the data from the file takes place.
 Empty lines in the file are ignored, and the file may also contain comment
 lines:
@@ -7957,12 +8148,12 @@ not#comment@x.y.z   # but this is a comment
 .endd
 .endlist
 
-Putting a file name in a list has the same effect as inserting each line of the
+Putting a filename in a list has the same effect as inserting each line of the
 file as an item in the list (blank lines and comments excepted). However, there
 is one important difference: the file is read each time the list is processed,
 so if its contents vary over time, Exim's behaviour changes.
 
-If a file name is preceded by an exclamation mark, the sense of any match
+If a filename is preceded by an exclamation mark, the sense of any match
 within the file is inverted. For example, if
 .code
 hold_domains = !/etc/nohold-domains
@@ -7987,7 +8178,7 @@ non-constant pattern. This is not the case. The keys in an &(lsearch)& file are
 always fixed strings, just as for any other single-key lookup type.
 
 If you want to use a file to contain wild-card patterns that form part of a
-list, just give the file name on its own, without a search type, as described
+list, just give the filename on its own, without a search type, as described
 in the previous section. You could also use the &(wildlsearch)& or
 &(nwildlsearch)&, but there is no advantage in doing this.
 
@@ -8234,7 +8425,7 @@ expression by expansion, of course).
 .cindex "domain list" "matching by lookup"
 If a pattern starts with the name of a single-key lookup type followed by a
 semicolon (for example, &"dbm;"& or &"lsearch;"&), the remainder of the pattern
-must be a file name in a suitable format for the lookup type. For example, for
+must be a filename in a suitable format for the lookup type. For example, for
 &"cdb;"& it must be an absolute path:
 .code
 domains = cdb;/etc/mail/local_domains.cdb
@@ -8931,7 +9122,7 @@ default.
 The domain portion of an address is always lowercased before matching it to an
 address list. The local part is lowercased by default, and any string
 comparisons that take place are done caselessly. This means that the data in
-the address list itself, in files included as plain file names, and in any file
+the address list itself, in files included as plain filenames, and in any file
 that is looked up using the &"@@"& mechanism, can be in any case. However, the
 keys in files that are looked up by a search type other than &(lsearch)& (which
 works caselessly) must be in lower case, because these lookups are not
@@ -8978,7 +9169,7 @@ types.
 
 .chapter "String expansions" "CHAPexpand"
 .scindex IIDstrexp "expansion" "of strings"
-Many strings in Exim's run time configuration are expanded before use. Some of
+Many strings in Exim's runtime configuration are expanded before use. Some of
 them are expanded every time they are used; others are expanded only once.
 
 When a string is being expanded it is copied verbatim from left to right except
@@ -9052,7 +9243,7 @@ using &%-be%& for reading files to which they do not have access.
 .oindex "&%-bem%&"
 If you want to test expansions that include variables whose values are taken
 from a message, there are two other options that can be used. The &%-bem%&
-option is like &%-be%& except that it is followed by a file name. The file is
+option is like &%-be%& except that it is followed by a filename. The file is
 read as a message before doing the test expansions. For example:
 .code
 exim -bem /tmp/test.message '$h_subject:'
@@ -9137,16 +9328,16 @@ the expansion result is an empty string.
 If the ACL returns defer the result is a forced-fail.  Otherwise the expansion fails.
 
 
-.new
 .vitem "&*${authresults{*&<&'authserv-id'&>&*}}*&"
 .cindex authentication "results header"
 .cindex headers "authentication-results:"
+.cindex authentication "expansion item"
 This item returns a string suitable for insertion as an
 &'Authentication-Results"'&
 header line.
 The given <&'authserv-id'&> is included in the result; typically this
-will ba a domain name identifying the system performing the authentications.
-Methods that may be present in the result include:
+will be a domain name identifying the system performing the authentications.
+Methods that might be present in the result include:
 .code
 none
 iprev
@@ -9159,7 +9350,7 @@ Example use (as an ACL modifier):
 .code
       add_header = :at_start:${authresults {$primary_hostname}}
 .endd
-.wen
+This is safe even if no authentication results are available.
 
 
 .vitem "&*${certextract{*&<&'field'&>&*}{*&<&'certificate'&>&*}&&&
@@ -9330,6 +9521,27 @@ ${extract{Z}{A=... B=...}{$value} fail }
 This forces an expansion failure (see section &<<SECTforexpfai>>&);
 {<&'string2'&>} must be present for &"fail"& to be recognized.
 
+.new
+.vitem "&*${extract json{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&&
+       {*&<&'string3'&>&*}}*&"
+.cindex "expansion" "extracting from JSON object"
+.cindex JSON expansions
+The key and <&'string1'&> are first expanded separately. Leading and trailing
+white space is removed from the key (but not from any of the strings). The key
+must not be empty and must not consist entirely of digits.
+The expanded <&'string1'&> must be of the form:
+.display
+{ <&'"key1"'&> : <&'value1'&> ,  <&'"key2"'&> , <&'value2'&> ... }
+.endd
+.vindex "&$value$&"
+The braces, commas and colons, and the quoting of the member name are required;
+the spaces are optional.
+Matching of the key against the member names is done case-sensitively.
+. XXX should be a UTF-8 compare
+
+The results of matching are handled as above.
+.wen
+
 
 .vitem "&*${extract{*&<&'number'&>&*}{*&<&'separators'&>&*}&&&
         {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&"
@@ -9362,12 +9574,26 @@ yields &"99"&. Two successive separators mean that the field between them is
 empty (for example, the fifth field above).
 
 
+.new
+.vitem "&*${extract json{*&<&'number'&>&*}}&&&
+        {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&"
+.cindex "expansion" "extracting from JSON array"
+.cindex JSON expansions
+The <&'number'&> argument must consist entirely of decimal digits,
+apart from leading and trailing white space, which is ignored.
+
+Field selection and result handling is as above;
+there is no choice of field separator.
+.wen
+
+
 .vitem &*${filter{*&<&'string'&>&*}{*&<&'condition'&>&*}}*&
 .cindex "list" "selecting by condition"
 .cindex "expansion" "selecting from list by condition"
 .vindex "&$item$&"
 After expansion, <&'string'&> is interpreted as a list, colon-separated by
-default, but the separator can be changed in the usual way. For each item
+default, but the separator can be changed in the usual way (&<<SECTlistsepchange>>&).
+For each item
 in this list, its value is place in &$item$&, and then the condition is
 evaluated. If the condition is true, &$item$& is added to the output as an
 item in a new list; if the condition is false, the item is discarded. The
@@ -9414,11 +9640,14 @@ letters appear. For example:
         &*$h_*&<&'header&~name'&>&*:*&" &&&
        "&*$bheader_*&<&'header&~name'&>&*:*&&~or&~&&&
         &*$bh_*&<&'header&~name'&>&*:*&" &&&
+       "&*$lheader_*&<&'header&~name'&>&*:*&&~or&~&&&
+        &*$lh_*&<&'header&~name'&>&*:*&"
        "&*$rheader_*&<&'header&~name'&>&*:*&&~or&~&&&
         &*$rh_*&<&'header&~name'&>&*:*&"
 .cindex "expansion" "header insertion"
 .vindex "&$header_$&"
 .vindex "&$bheader_$&"
+.vindex "&$lheader_$&"
 .vindex "&$rheader_$&"
 .cindex "header lines" "in expansion strings"
 .cindex "header lines" "character sets"
@@ -9431,7 +9660,7 @@ The newline that terminates a header line is not included in the expansion, but
 internal newlines (caused by splitting the header line over several physical
 lines) may be present.
 
-The difference between &%rheader%&, &%bheader%&, and &%header%& is in the way
+The difference between the four pairs of expansions is in the way
 the data in the header line is interpreted.
 
 .ilist
@@ -9439,6 +9668,15 @@ the data in the header line is interpreted.
 &%rheader%& gives the original &"raw"& content of the header line, with no
 processing at all, and without the removal of leading and trailing white space.
 
+.next
+.cindex "list" "of header lines"
+&%lheader%& gives a colon-separated list, one element per header when there
+are multiple headers with a given name.
+Any embedded colon characters within an element are doubled, so normal Exim
+list-processing facilities can be used.
+The terminating newline of each element is removed; in other respects
+the content is &"raw"&.
+
 .next
 .cindex "base64 encoding" "in header lines"
 &%bheader%& removes leading and trailing white space, and then decodes base64
@@ -9544,7 +9782,7 @@ Then given a message, you can check where it was scanned by looking at the
 &'X-Spam-Scanned:'& header line. If you know the secret, you can check that
 this header line is authentic by recomputing the authentication code from the
 host name, message ID and the &'Message-id:'& header line. This can be done
-using Exim's &%-be%& option, or by other means, for example by using the
+using Exim's &%-be%& option, or by other means, for example, by using the
 &'hmac_md5_hex()'& function in Perl.
 
 
@@ -9596,9 +9834,10 @@ some of the braces:
 .code
 ${length_<n>:<string>}
 .endd
-The result of this item is either the first <&'n'&> characters or the whole
+The result of this item is either the first <&'n'&> bytes or the whole
 of <&'string2'&>, whichever is the shorter. Do not confuse &%length%& with
 &%strlen%&, which gives the length of a string.
+All measurement is done in bytes and is not UTF-8 aware.
 
 
 .vitem "&*${listextract{*&<&'number'&>&*}&&&
@@ -9611,7 +9850,7 @@ apart from an optional leading minus,
 and leading and trailing white space (which is ignored).
 
 After expansion, <&'string1'&> is interpreted as a list, colon-separated by
-default, but the separator can be changed in the usual way.
+default, but the separator can be changed in the usual way (&<<SECTlistsepchange>>&).
 
 The first field of the list is numbered one.
 If the number is negative, the fields are
@@ -9705,7 +9944,8 @@ ${lookup nisplus {[name=$local_part],passwd.org_dir:gcos} \
 .cindex "expansion" "list creation"
 .vindex "&$item$&"
 After expansion, <&'string1'&> is interpreted as a list, colon-separated by
-default, but the separator can be changed in the usual way. For each item
+default, but the separator can be changed in the usual way (&<<SECTlistsepchange>>&).
+For each item
 in this list, its value is place in &$item$&, and then <&'string2'&> is
 expanded and added to the output as an item in a new list. The separator used
 for the output list is the same as the one used for the input, but a separator
@@ -9802,7 +10042,7 @@ For more discussion and an example, see section &<<SECTverifyPRVS>>&.
 .cindex "expansion" "inserting an entire file"
 .cindex "file" "inserting into expansion"
 .cindex "&%readfile%& expansion item"
-The file name and end-of-line string are first expanded separately. The file is
+The filename and end-of-line string are first expanded separately. The file is
 then read, and its contents replace the entire item. All newline characters in
 the file are replaced by the end-of-line string if it is present. Otherwise,
 newlines are left in the string.
@@ -9846,15 +10086,26 @@ extend what can be done. Firstly, you can vary the timeout. For example:
 .code
 ${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.
 Further elements are options of form &'name=value'&.
-One option type is currently recognised, defining whether (the default)
+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):
 .code
 ${readsocket{/socket/name}{request string}{3s:shutdown=no}}
 .endd
+.new
+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.
+If it is enabled, a shutdown as descripbed above is never done.
+.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
 turns them into spaces:
@@ -9899,9 +10150,10 @@ locks out the use of this expansion item in filter files.
 .vindex "&$item$&"
 This operation reduces a list to a single, scalar string. After expansion,
 <&'string1'&> is interpreted as a list, colon-separated by default, but the
-separator can be changed in the usual way. Then <&'string2'&> is expanded and
+separator can be changed in the usual way (&<<SECTlistsepchange>>&).
+Then <&'string2'&> is expanded and
 assigned to the &$value$& variable. After this, each item in the <&'string1'&>
-list is assigned to &$item$& in turn, and <&'string3'&> is expanded for each of
+list is assigned to &$item$&, in turn, and <&'string3'&> is expanded for each of
 them. The result of that expansion is assigned to &$value$& before the next
 iteration. When the end of the list is reached, the final value of &$value$& is
 added to the expansion output. The &*reduce*& expansion item can be used in a
@@ -9920,7 +10172,7 @@ expansion items.
 
 .vitem &*$rheader_*&<&'header&~name'&>&*:*&&~or&~&*$rh_*&<&'header&~name'&>&*:*&
 This item inserts &"raw"& header lines. It is described with the &%header%&
-expansion item above.
+expansion item in section &<<SECTexpansionitems>>& above.
 
 .vitem "&*${run{*&<&'command'&>&*&~*&<&'args'&>&*}{*&<&'string1'&>&*}&&&
         {*&<&'string2'&>&*}}*&"
@@ -10019,6 +10271,8 @@ ${sg{1=A 4=D 3=C}{\N(\d+)=\N}{K\$1=}}
 yields &"K1=A K4=D K3=C"&. Note the use of &`\N`& to protect the contents of
 the regular expression from string expansion.
 
+The regular expression is compiled in 8-bit mode, working against bytes
+rather than any Unicode-aware character handling.
 
 
 .vitem &*${sort{*&<&'string'&>&*}{*&<&'comparator'&>&*}{*&<&'extractor'&>&*}}*&
@@ -10026,7 +10280,7 @@ the regular expression from string expansion.
 .cindex list sorting
 .cindex expansion "list sorting"
 After expansion, <&'string'&> is interpreted as a list, colon-separated by
-default, but the separator can be changed in the usual way.
+default, but the separator can be changed in the usual way (&<<SECTlistsepchange>>&).
 The <&'comparator'&> argument is interpreted as the operator
 of a two-argument expansion condition.
 The numeric operators plus ge, gt, le, lt (and ~i variants) are supported.
@@ -10075,11 +10329,11 @@ ${substr{3}{2}{$local_part}}
 If the starting offset is greater than the string length the result is the
 null string; if the length plus starting offset is greater than the string
 length, the result is the right-hand part of the string, starting from the
-given offset. The first character in the string has offset zero.
+given offset. The first byte (character) in the string has offset zero.
 
 The &%substr%& expansion item can take negative offset values to count
-from the right-hand end of its operand. The last character is offset -1, the
-second-last is offset -2, and so on. Thus, for example,
+from the right-hand end of its operand. The last byte (character) is offset -1,
+the second-last is offset -2, and so on. Thus, for example,
 .code
 ${substr{-5}{2}{1234567}}
 .endd
@@ -10096,7 +10350,7 @@ ${substr{-3}{2}{12}}
 yields &"1"&.
 
 When the second number is omitted from &%substr%&, the remainder of the string
-is taken if the offset is positive. If it is negative, all characters in the
+is taken if the offset is positive. If it is negative, all bytes (characters) in the
 string preceding the offset point are taken. For example, an offset of -1 and
 no length, as in these semantically identical examples:
 .code
@@ -10105,13 +10359,15 @@ ${substr{-1}{abcde}}
 .endd
 yields all but the last character of the string, that is, &"abcd"&.
 
+All measurement is done in bytes and is not UTF-8 aware.
+
 
 
 .vitem "&*${tr{*&<&'subject'&>&*}{*&<&'characters'&>&*}&&&
         {*&<&'replacements'&>&*}}*&"
 .cindex "expansion" "character translation"
 .cindex "&%tr%& expansion item"
-This item does single-character translation on its subject string. The second
+This item does single-character (in bytes) translation on its subject string. The second
 argument is a list of characters to be translated in the subject string. Each
 matching character is replaced by the corresponding character from the
 replacement list. For example
@@ -10122,6 +10378,9 @@ yields &`1b3de1`&. If there are duplicates in the second character string, the
 last occurrence is used. If the third string is shorter than the second, its
 last character is replicated. However, if it is empty, no translation takes
 place.
+
+All character handling is done in bytes and is not UTF-8 aware.
+
 .endlist
 
 
@@ -10141,6 +10400,8 @@ The string is interpreted as an RFC 2822 address, as it might appear in a
 header line, and the effective address is extracted from it. If the string does
 not parse successfully, the result is empty.
 
+The parsing correctly handles SMTPUTF8 Unicode in the string.
+
 
 .vitem &*${addresses:*&<&'string'&>&*}*&
 .cindex "expansion" "RFC 2822 address handling"
@@ -10184,7 +10445,7 @@ It does not see the comma because it's still encoded as "=2C".  The second
 example below is passed the contents of &`$header_from:`&, meaning it gets
 de-mimed. Exim sees the decoded "," so it treats it as &*two*& email addresses.
 The third example shows that the presence of a comma is skipped when it is
-quoted.
+quoted.  The fourth example shows SMTPUTF8 handling.
 .code
 # exim -be '${addresses:From: \
 =?iso-8859-2?Q?Last=2C_First?= <user@example.com>}'
@@ -10193,6 +10454,8 @@ user@example.com
 Last:user@example.com
 # exim -be '${addresses:From: "Last, First" <user@example.com>}'
 user@example.com
+# exim -be '${addresses:フィル <フィリップ@example.jp>}'
+フィリップ@example.jp
 .endd
 
 .vitem &*${base32:*&<&'digits'&>&*}*&
@@ -10214,9 +10477,9 @@ The number is converted to decimal and output as a string.
 The string must consist entirely of decimal digits. The number is converted to
 base 62 and output as a string of six characters, including leading zeros. In
 the few operating environments where Exim uses base 36 instead of base 62 for
-its message identifiers (because those systems do not have case-sensitive file
-names), base 36 is used by this operator, despite its name. &*Note*&: Just to
-be absolutely clear: this is &'not'& base64 encoding.
+its message identifiers (because those systems do not have case-sensitive
+filenames), base 36 is used by this operator, despite its name. &*Note*&: Just
+to be absolutely clear: this is &'not'& base64 encoding.
 
 .vitem &*${base62d:*&<&'base-62&~digits'&>&*}*&
 .cindex "&%base62d%& expansion item"
@@ -10382,7 +10645,7 @@ abbreviation &%h%& can be used when &%hash%& is used as an operator.
 .cindex "expansion" "hex to base64"
 .cindex "&%hex2b64%& expansion item"
 This operator converts a hex string into one that is base64 encoded. This can
-be useful for processing the output of the MD5 and SHA-1 hashing functions.
+be useful for processing the output of the various hashing functions.
 
 
 
@@ -10391,7 +10654,7 @@ be useful for processing the output of the MD5 and SHA-1 hashing functions.
 .cindex "&%hexquote%& expansion item"
 This operator converts non-printable characters in a string into a hex
 escape form. Byte values between 33 (!) and 126 (~) inclusive are left
-as is, and other byte values are converted to &`\xNN`&, for example a
+as is, and other byte values are converted to &`\xNN`&, for example, a
 byte value 127 is converted to &`\x7f`&.
 
 
@@ -10424,6 +10687,7 @@ This forces the letters in the string into lower-case, for example:
 .code
 ${lc:$local_part}
 .endd
+Case is defined per the system C locale.
 
 .vitem &*${length_*&<&'number'&>&*:*&<&'string'&>&*}*&
 .cindex "expansion" "string truncation"
@@ -10437,6 +10701,7 @@ ${length{<number>}{<string>}}
 See the description of the general &%length%& item above for details. Note that
 &%length%& is not the same as &%strlen%&. The abbreviation &%l%& can be used
 when &%length%& is used as an operator.
+All measurement is done in bytes and is not UTF-8 aware.
 
 
 .vitem &*${listcount:*&<&'string'&>&*}*&
@@ -10464,6 +10729,7 @@ matching list is returned.
 The string is interpreted as an RFC 2822 address and the local part is
 extracted from it. If the string does not parse successfully, the result is
 empty.
+The parsing correctly handles SMTPUTF8 Unicode in the string.
 
 
 .vitem &*${mask:*&<&'IP&~address'&>&*/*&<&'bit&~count'&>&*}*&
@@ -10546,6 +10812,10 @@ example, a plus sign would not cause quoting (but it would for &%quote%&).
 If you are creating a new email address from the contents of &$local_part$&
 (or any other unknown data), you should always use this operator.
 
+This quoting determination is not SMTPUTF8-aware, thus quoting non-ASCII data
+will likely use the quoting form.
+Thus &'${quote_local_part:フィル}'& will always become &'"フィル"'&.
+
 
 .vitem &*${quote_*&<&'lookup-type'&>&*:*&<&'string'&>&*}*&
 .cindex "quoting" "lookup-specific"
@@ -10675,10 +10945,8 @@ with 256 being the default.
 
 The &%sha3%& expansion item is only supported if Exim has been
 compiled with GnuTLS 3.5.0 or later,
-.new
 or OpenSSL 1.1.1 or later.
 The macro "_CRYPTO_HASH_SHA3" will be defined if it is supported.
-.wen
 
 
 .vitem &*${stat:*&<&'string'&>&*}*&
@@ -10711,6 +10979,7 @@ Now deprecated, a synonym for the &%base64%& expansion operator.
 .cindex "&%strlen%& expansion item"
 The item is replace by the length of the expanded string, expressed as a
 decimal number. &*Note*&: Do not confuse &%strlen%& with &%length%&.
+All measurement is done in bytes and is not UTF-8 aware.
 
 
 .vitem &*${substr_*&<&'start'&>&*_*&<&'length'&>&*:*&<&'string'&>&*}*&
@@ -10725,6 +10994,7 @@ ${substr{<start>}{<length>}{<string>}}
 .endd
 See the description of the general &%substr%& item above for details. The
 abbreviation &%s%& can be used when &%substr%& is used as an operator.
+All measurement is done in bytes and is not UTF-8 aware.
 
 .vitem &*${time_eval:*&<&'string'&>&*}*&
 .cindex "&%time_eval%& expansion item"
@@ -10747,6 +11017,7 @@ number of larger units and output in Exim's normal time format, for example,
 .cindex "expansion" "case forcing"
 .cindex "&%uc%& expansion item"
 This forces the letters in the string into upper-case.
+Case is defined per the system C locale.
 
 .vitem &*${utf8clean:*&<&'string'&>&*}*&
 .cindex "correction of invalid utf-8 sequences in strings"
@@ -10755,6 +11026,20 @@ This forces the letters in the string into upper-case.
 .cindex "expansion" "utf-8 forcing"
 .cindex "&%utf8clean%& expansion item"
 This replaces any invalid utf-8 sequence in the string by the character &`?`&.
+.new
+In versions of Exim before 4.92, this did not correctly do so for a truncated
+final codepoint's encoding, and the character would be silently dropped.
+If you must handle detection of this scenario across both sets of Exim behavior,
+the complexity will depend upon the task.
+For instance, to detect if the first character is multibyte and a 1-byte
+extraction can be successfully used as a path component (as is common for
+dividing up delivery folders), you might use:
+.code
+condition = ${if inlist{${utf8clean:${length_1:$local_part}}}{:?}{yes}{no}}
+.endd
+(which will false-positive if the first character of the local part is a
+literal question mark).
+.wen
 
 .vitem "&*${utf8_domain_to_alabel:*&<&'string'&>&*}*&" &&&
        "&*${utf8_domain_from_alabel:*&<&'string'&>&*}*&" &&&
@@ -10977,7 +11262,8 @@ the header name must be terminated by a colon if white space does not follow.
 .cindex "&%eqi%& expansion condition"
 The two substrings are first expanded. The condition is true if the two
 resulting strings are identical. For &%eq%& the comparison includes the case of
-letters, whereas for &%eqi%& the comparison is case-independent.
+letters, whereas for &%eqi%& the comparison is case-independent, where
+case is defined per the system C locale.
 
 .vitem &*exists&~{*&<&'file&~name'&>&*}*&
 .cindex "expansion" "file existence test"
@@ -11005,7 +11291,8 @@ attempt. It is false during any subsequent delivery attempts.
 .vindex "&$item$&"
 These conditions iterate over a list. The first argument is expanded to form
 the list. By default, the list separator is a colon, but it can be changed by
-the normal method. The second argument is interpreted as a condition that is to
+the normal method (&<<SECTlistsepchange>>&).
+The second argument is interpreted as a condition that is to
 be applied to each item in the list in turn. During the interpretation of the
 condition, the current list item is placed in a variable called &$item$&.
 .ilist
@@ -11040,6 +11327,7 @@ The two substrings are first expanded. The condition is true if the first
 string is lexically greater than or equal to the second string. For &%ge%& the
 comparison includes the case of letters, whereas for &%gei%& the comparison is
 case-independent.
+Case and collation order are defined per the system C locale.
 
 .vitem &*gt&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*& &&&
        &*gti&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
@@ -11051,6 +11339,7 @@ The two substrings are first expanded. The condition is true if the first
 string is lexically greater than the second string. For &%gt%& the comparison
 includes the case of letters, whereas for &%gti%& the comparison is
 case-independent.
+Case and collation order are defined per the system C locale.
 
 .vitem &*inlist&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*& &&&
        &*inlisti&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
@@ -11059,6 +11348,7 @@ case-independent.
 Both strings are expanded; the second string is treated as a list of simple
 strings; if the first string is a member of the second, then the condition
 is true.
+For the case-independent &%inlisti%& condition, case is defined per the system C locale.
 
 These are simpler to use versions of the more powerful &*forany*& condition.
 Examples, and the &*forany*& equivalents:
@@ -11125,6 +11415,7 @@ The two substrings are first expanded. The condition is true if the first
 string is lexically less than or equal to the second string. For &%le%& the
 comparison includes the case of letters, whereas for &%lei%& the comparison is
 case-independent.
+Case and collation order are defined per the system C locale.
 
 .vitem &*lt&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*& &&&
        &*lti&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
@@ -11136,6 +11427,7 @@ The two substrings are first expanded. The condition is true if the first
 string is lexically less than the second string. For &%lt%& the comparison
 includes the case of letters, whereas for &%lti%& the comparison is
 case-independent.
+Case and collation order are defined per the system C locale.
 
 
 .vitem &*match&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*&
@@ -11162,6 +11454,8 @@ metacharacter, but if there is no circumflex, the expression is not anchored,
 and it may match anywhere in the subject, not just at the start. If you want
 the pattern to match at the end of the subject, you must include the &`$`&
 metacharacter at an appropriate point.
+All character handling is done in bytes and is not UTF-8 aware,
+but we might change this in a future Exim release.
 
 .cindex "numerical variables (&$1$& &$2$& etc)" "in &%if%& expansion"
 At the start of an &%if%& expansion the values of the numeric variable
@@ -11276,7 +11570,7 @@ matched using &%match_ip%&.
 .cindex "expansion" "PAM authentication test"
 .cindex "&%pam%& expansion condition"
 &'Pluggable Authentication Modules'&
-(&url(http://www.kernel.org/pub/linux/libs/pam/)) are a facility that is
+(&url(https://mirrors.edge.kernel.org/pub/linux/libs/pam/)) are a facility that is
 available in the latest releases of Solaris and in some GNU/Linux
 distributions. The Exim support, which is intended for use in conjunction with
 the SMTP AUTH command, is available only if Exim is compiled with
@@ -11309,11 +11603,7 @@ server_condition = ${if pam{$auth2:${sg{$auth3}{:}{::}}}}
 In some operating systems, PAM authentication can be done only from a process
 running as root. Since Exim is running as the Exim user when receiving
 messages, this means that PAM cannot be used directly in those systems.
-A patched version of the &'pam_unix'& module that comes with the
-Linux PAM package is available from &url(http://www.e-admin.de/pam_exim/).
-The patched module allows one special uid/gid combination, in addition to root,
-to authenticate. If you build the patched module to allow the Exim user and
-group, PAM can then be used from an Exim authenticator.
+. --- 2018-09-07: the pam_exim modified variant has gone, removed claims re using Exim via that
 
 
 .vitem &*pwcheck&~{*&<&'string1'&>&*:*&<&'string2'&>&*}*&
@@ -11580,10 +11870,13 @@ preserve some of the authentication information in the variable
 user/password authenticator configuration might preserve the user name for use
 in the routers. Note that this is not the same information that is saved in
 &$sender_host_authenticated$&.
+
 When a message is submitted locally (that is, not over a TCP connection)
 the value of &$authenticated_id$& is normally the login name of the calling
 process. However, a trusted user can override this by means of the &%-oMai%&
 command line option.
+This second case also sets up information used by the
+&$authresults$& expansion item.
 
 .vitem &$authenticated_fail_id$&
 .cindex "authentication" "fail" "id"
@@ -11687,7 +11980,7 @@ address that was connected to.
 .vindex "&$compile_number$&"
 The building process for Exim keeps a count of the number
 of times it has been compiled. This serves to distinguish different
-compilations of the same version of the program.
+compilations of the same version of Exim.
 
 .vitem &$config_dir$&
 .vindex "&$config_dir$&"
@@ -11839,6 +12132,7 @@ This is not strictly an expansion variable. It is expansion syntax for
 inserting the message header line with the given name. Note that the name must
 be terminated by colon or white space, because it may contain a wide variety of
 characters. Note also that braces must &'not'& be used.
+See the full description in section &<<SECTexpansionitems>>& above.
 
 .vitem &$headers_added$&
 .vindex "&$headers_added$&"
@@ -11923,6 +12217,11 @@ lookup succeeds, but there is a lookup problem such as a timeout when checking
 the result, the name is not accepted, and &$host_lookup_deferred$& is set to
 &"1"&. See also &$sender_host_name$&.
 
+.cindex authentication "expansion item"
+Performing these checks sets up information used by the
+&$authresults$& expansion item.
+
+
 .vitem &$host_lookup_failed$&
 .vindex "&$host_lookup_failed$&"
 See &$host_lookup_deferred$&.
@@ -11988,6 +12287,7 @@ 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
@@ -11995,7 +12295,7 @@ any prefix or suffix are in &$local_part_prefix$& and
 
 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
-the parent address, not to the file name or command (see &$address_file$& and
+the parent address, not to the filename or command (see &$address_file$& and
 &$address_pipe$&).
 
 When an ACL is running for a RCPT command, &$local_part$& contains the
@@ -12040,6 +12340,7 @@ variable expands to nothing.
 
 .vitem &$local_part_prefix$&
 .vindex "&$local_part_prefix$&"
+.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$&.
@@ -12427,7 +12728,7 @@ the port value is -1 unless it has been set using the &%-oMi%& command line
 option.
 
 As well as being useful in ACLs (including the &"connect"& ACL), these variable
-could be used, for example, to make the file name for a TLS certificate depend
+could be used, for example, to make the filename for a TLS certificate depend
 on which interface and/or port is being used for the incoming connection. The
 values of &$received_ip_address$& and &$received_port$& are saved with any
 messages that are received, thus making these variables available at delivery
@@ -12874,14 +13175,13 @@ A number of variables whose names start with &$spam$& are available when Exim
 is compiled with the content-scanning extension. For details, see section
 &<<SECTscanspamass>>&.
 
-.new
 .vitem &$spf_header_comment$& &&&
        &$spf_received$& &&&
        &$spf_result$& &&&
+       &$spf_result_guessed$& &&&
        &$spf_smtp_comment$&
 These variables are only available if Exim is built with SPF support.
 For details see section &<<SECSPF>>&.
-.wen
 
 .vitem &$spool_directory$&
 .vindex "&$spool_directory$&"
@@ -12944,7 +13244,8 @@ It is only useful as the argument of a
 &%certextract%& expansion item, &%md5%&, &%sha1%& or &%sha256%& operator,
 or a &%def%& condition.
 
-&*Note*&: Under current versions of OpenSSL, when a list of more than one
+&*Note*&: Under versions of OpenSSL preceding 1.1.1,
+when a list of more than one
 file is used for &%tls_certificate%&, this variable is not reliable.
 
 .vitem &$tls_in_peercert$&
@@ -13371,7 +13672,7 @@ listen. Each item may optionally also specify a port.
 .endlist
 
 The default list separator in both cases is a colon, but this can be changed as
-described in section &<<SECTlistconstruct>>&. When IPv6 addresses are involved,
+described in section &<<SECTlistsepchange>>&. When IPv6 addresses are involved,
 it is usually best to change the separator to avoid having to double all the
 colons. For example:
 .code
@@ -13438,7 +13739,8 @@ the runtime configuration by &%-D%& is allowed only when the caller is root or
 exim.
 
 The value of &%-oX%& is a list of items. The default colon separator can be
-changed in the usual way if required. If there are any items that do not
+changed in the usual way (&<<SECTlistsepchange>>&) if required.
+If there are any items that do not
 contain dots or colons (that is, are not IP addresses), the value of
 &%daemon_smtp_ports%& is replaced by the list of those items. If there are any
 items that do contain dots or colons, the value of &%local_interfaces%& is
@@ -13630,7 +13932,7 @@ details.
 .chapter "Main configuration" "CHAPmainconfig"
 .scindex IIDconfima "configuration file" "main section"
 .scindex IIDmaiconf "main configuration"
-The first part of the run time configuration file contains three types of item:
+The first part of the runtime configuration file contains three types of item:
 
 .ilist
 Macro definitions: These lines start with an upper case letter. See section
@@ -13835,6 +14137,7 @@ listed in more than one group.
 .row &%av_scanner%&                  "specify virus scanner"
 .row &%check_rfc2047_length%&        "check length of RFC 2047 &""encoded &&&
                                       words""&"
+.row &%dns_cname_loops%&             "follow CNAMEs returned by resolver"
 .row &%dns_csa_search_limit%&        "control CSA parent search depth"
 .row &%dns_csa_use_reverse%&         "en/disable CSA IP reverse search"
 .row &%header_maxsize%&              "total size of message header"
@@ -14093,7 +14396,7 @@ feel that in today's Internet, this causes more problems than it solves.
 It now defaults to true.
 A more detailed analysis of the issues is provided by Dan Bernstein:
 .display
-&url(http://cr.yp.to/smtp/8bitmime.html)
+&url(https://cr.yp.to/smtp/8bitmime.html)
 .endd
 
 To log received 8BITMIME status use
@@ -14587,7 +14890,7 @@ When a message is delayed, Exim sends a warning message to the sender at
 intervals specified by this option. The data is a colon-separated list of times
 after which to send warning messages. If the value of the option is an empty
 string or a zero time, no warnings are sent. Up to 10 times may be given. If a
-message has been on the queue for longer than the last time, the last interval
+message has been in the queue for longer than the last time, the last interval
 between the times is used to compute subsequent warning times. For example,
 with
 .code
@@ -14737,6 +15040,19 @@ This option controls whether or not an IP address, given as a CSA domain, is
 reversed and looked up in the reverse DNS, as described in more detail in
 section &<<SECTverifyCSA>>&.
 
+.new
+.option dns_cname_loops main integer 1
+.cindex DNS "CNAME following"
+This option controls the following of CNAME chains, needed if the resolver does
+not do it internally.
+As of 2018 most should, and the default can be left.
+If you have an ancient one, a value of 10 is likely needed.
+
+The default value of one CNAME-follow is needed
+thanks to the observed return for an MX request,
+given no MX presence but a CNAME to an A, of the CNAME.
+.wen
+
 
 .option dns_dnssec_ok main integer -1
 .cindex "DNS" "resolver options"
@@ -15056,12 +15372,12 @@ server. This reduces security slightly, but improves interworking with older
 implementations of TLS.
 
 
-option gnutls_allow_auto_pkcs11 main boolean unset
+.option gnutls_allow_auto_pkcs11 main boolean unset
 This option will let GnuTLS (2.12.0 or later) autoload PKCS11 modules with
 the p11-kit configuration files in &_/etc/pkcs11/modules/_&.
 
 See
-&url(http://www.gnutls.org/manual/gnutls.html#Smart-cards-and-HSMs)
+&url(https://www.gnutls.org/manual/gnutls.html#Smart-cards-and-HSMs)
 for documentation.
 
 
@@ -15180,7 +15496,7 @@ error.
 .option hold_domains main "domain list&!!" unset
 .cindex "domain" "delaying delivery"
 .cindex "delivery" "delaying certain domains"
-This option allows mail for particular domains to be held on the queue
+This option allows mail for particular domains to be held in the queue
 manually. The option is overridden if a message delivery is forced with the
 &%-M%&, &%-qf%&, &%-Rf%& or &%-Sf%& options, and also while testing or
 verifying addresses using &%-bt%& or &%-bv%&. Otherwise, if a domain matches an
@@ -15310,7 +15626,7 @@ suffer temporary delivery failures are of course retried in the usual way.)
 
 After a permanent delivery failure, bounce messages are frozen,
 because there is no sender to whom they can be returned. When a frozen bounce
-message has been on the queue for more than the given time, it is unfrozen at
+message has been in the queue for more than the given time, it is unfrozen at
 the next queue run, and a further delivery is attempted. If delivery fails
 again, the bounce message is discarded. This makes it possible to keep failed
 bounce messages around for a shorter time than the normal maximum retry time
@@ -15578,8 +15894,8 @@ section &<<SECTmessiden>>&.
 This option sets the path which is used to determine the names of Exim's log
 files, or indicates that logging is to be to syslog, or both. It is expanded
 when Exim is entered, so it can, for example, contain a reference to the host
-name. If no specific path is set for the log files at compile or run time,
-or if the option is unset at run time (i.e.  &`log_file_path = `&)
+name. If no specific path is set for the log files at compile or runtime,
+or if the option is unset at runtime (i.e.  &`log_file_path = `&)
 they are written in a sub-directory called &_log_& in Exim's spool directory.
 Chapter &<<CHAPlog>>& contains further details about Exim's logging, and
 section &<<SECTwhelogwri>>& describes how the contents of &%log_file_path%& are
@@ -16093,7 +16409,7 @@ See also &%prod_requires_admin%& and &%commandline_checks_require_admin%&.
 .cindex "queueing incoming messages"
 .cindex "message" "queueing unconditionally"
 If &%queue_only%& is set, a delivery process is not automatically started
-whenever a message is received. Instead, the message waits on the queue for the
+whenever a message is received. Instead, the message waits in the queue for the
 next queue run. Even if &%queue_only%& is false, incoming messages may not get
 delivered immediately when certain conditions (such as heavy load) occur.
 
@@ -16201,7 +16517,7 @@ 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
 &%queue_smtp_domains%&, they are not immediately delivered, but instead the
-message waits on the queue for the next queue run. Since routing of the message
+message waits in the queue for the next queue run. Since routing of the message
 has taken place, Exim knows to which remote hosts it must be delivered, and so
 when the queue run happens, multiple messages for the same host are delivered
 over a single SMTP connection. The &%-odqs%& command line option causes all
@@ -16214,7 +16530,7 @@ SMTP deliveries to be queued in this way, and is equivalent to setting
 .cindex "timeout" "for non-SMTP input"
 This option sets the timeout for accepting a non-SMTP message, that is, the
 maximum time that Exim waits when reading a message on the standard input. If
-the value is zero, it will wait for ever. This setting is overridden by the
+the value is zero, it will wait forever. This setting is overridden by the
 &%-or%& command line option. The timeout for incoming SMTP messages is
 controlled by &%smtp_receive_timeout%&.
 
@@ -16545,7 +16861,7 @@ doing this processing, it cannot accept any other incoming connections.
 .cindex "message" "queueing by SMTP connection count"
 If the number of simultaneous incoming SMTP connections being handled via the
 listening daemon exceeds this value, messages received by SMTP are just placed
-on the queue; no delivery processes are started automatically. The count is
+in the queue; no delivery processes are started automatically. The count is
 fixed at the start of an SMTP connection. It cannot be updated in the
 subprocess that receives messages, and so the queueing or not queueing applies
 to all messages received in the same connection.
@@ -16566,7 +16882,7 @@ This option limits the number of delivery processes that Exim starts
 automatically when receiving messages via SMTP, whether via the daemon or by
 the use of &%-bs%& or &%-bS%&. If the value of the option is greater than zero,
 and the number of messages received in a single SMTP session exceeds this
-number, subsequent messages are placed on the queue, but no delivery processes
+number, subsequent messages are placed in the queue, but no delivery processes
 are started. This helps to limit the number of Exim processes when a server
 restarts after downtime and there is a lot of mail waiting for it on other
 systems. On large systems, the default should probably be increased, and on
@@ -16878,11 +17194,9 @@ See section &<<SECTscanspamass>>& for more details.
 
 
 
-.new
 .option spf_guess main string "v=spf1 a/24 mx/24 ptr ?all"
 This option is available when Exim is compiled with SPF support.
 See section &<<SECSPF>>& for more details.
-.wen
 
 
 
@@ -16910,11 +17224,11 @@ automatically deleted.
 
 When &%split_spool_directory%& is set, the behaviour of queue runner processes
 changes. Instead of creating a list of all messages in the queue, and then
-trying to deliver each one in turn, it constructs a list of those in one
+trying to deliver each one, in turn, it constructs a list of those in one
 sub-directory and tries to deliver them, before moving on to the next
 sub-directory. The sub-directories are processed in a random order. This
 spreads out the scanning of the input directories, and uses less memory. It is
-particularly beneficial when there are lots of messages on the queue. However,
+particularly beneficial when there are lots of messages in the queue. However,
 if &%queue_run_in_order%& is set, none of this new processing happens. The
 entire queue has to be scanned and sorted before any deliveries can start.
 
@@ -16938,10 +17252,10 @@ tests of Exim without using the standard spool.
 
 .option spool_wireformat main boolean false
 .cindex "spool directory" "file formats"
-If this option is set, Exim may for some messages use an alternate format
+If this option is set, Exim may for some messages use an alternative format
 for data-files in the spool which matches the wire format.
 Doing this permits more efficient message reception and transmission.
-Currently it is only done for messages received using the EMSTP CHUNKING
+Currently it is only done for messages received using the ESMTP CHUNKING
 option.
 
 The following variables will not have useful values:
@@ -16954,7 +17268,7 @@ $body_zerocount
 Users of the local_scan() API (see &<<CHAPlocalscan>>&),
 and any external programs which are passed a reference to a message data file
 (except via the &"regex"&, &"malware"& or &"spam"&) ACL conditions)
-will need to be aware of the potential different format.
+will need to be aware of the different formats potentially available.
 
 Using any of the ACL conditions noted will negate the reception benefit
 (as a Unix-mbox-format file is constructed for them).
@@ -17123,7 +17437,7 @@ TCP_NODELAY.
 .cindex "frozen messages" "timing out"
 .cindex "timeout" "frozen messages"
 If &%timeout_frozen_after%& is set to a time greater than zero, a frozen
-message of any kind that has been on the queue for longer than the given time
+message of any kind that has been in the queue for longer than the given time
 is automatically cancelled at the next queue run. If the frozen message is a
 bounce message, it is just discarded; otherwise, a bounce is sent to the
 sender, in a similar manner to cancellation by the &%-Mg%& command line option.
@@ -17131,7 +17445,7 @@ If you want to timeout frozen bounce messages earlier than other kinds of
 frozen message, see &%ignore_bounce_errors_after%&.
 
 &*Note:*& the default value of zero means no timeouts; with this setting,
-frozen messages remain on the queue forever (except for any frozen bounce
+frozen messages remain in the queue forever (except for any frozen bounce
 messages that are released by &%ignore_bounce_errors_after%&).
 
 
@@ -17182,9 +17496,10 @@ use when sending messages as a client, you must set the &%tls_certificate%&
 option in the relevant &(smtp)& transport.
 
 &*Note*&: If you use filenames based on IP addresses, change the list
-separator in the usual way to avoid confusion under IPv6.
+separator in the usual way (&<<SECTlistsepchange>>&) >to avoid confusion under IPv6.
 
-&*Note*&: Under current versions of OpenSSL, when a list of more than one
+&*Note*&: Under versions of OpenSSL preceding 1.1.1,
+when a list of more than one
 file is used, the &$tls_in_ourcert$& variable is unreliable.
 
 &*Note*&: OCSP stapling is not usable under OpenSSL
@@ -17204,13 +17519,11 @@ generated for every connection.
 This option specifies a certificate revocation list. The expanded value must
 be the name of a file that contains CRLs in PEM format.
 
-.new
 Under OpenSSL the option can specify a directory with CRL files.
 
 &*Note:*& Under OpenSSL the option must, if given, supply a CRL
 for each signing element of the certificate chain (i.e. all but the leaf).
 For the file variant this can be multiple PEM blocks in the one file.
-.wen
 
 See &<<SECTtlssni>>& for discussion of when this option might be re-expanded.
 
@@ -17337,18 +17650,16 @@ Certificate Authority.
 
 Usable for GnuTLS 3.4.4 or 3.3.17 or OpenSSL 1.1.0 (or later).
 
-.new
 For GnuTLS 3.5.6 or later the expanded value of this option can be a list
 of files, to match a list given for the &%tls_certificate%& option.
 The ordering of the two lists must match.
-.wen
 
 
 .option tls_on_connect_ports main "string list" unset
 .cindex SSMTP
 .cindex SMTPS
 This option specifies a list of incoming SSMTP (aka SMTPS) ports that should
-operate the obsolete SSMTP (SMTPS) protocol, where a TLS session is immediately
+operate the SSMTP (SMTPS) protocol, where a TLS session is immediately
 set up without waiting for the client to issue a STARTTLS command. For
 further details, see section &<<SECTsupobssmt>>&.
 
@@ -17580,7 +17891,7 @@ See &%uucp_from_pattern%& above.
 .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 on the queue for a specified amount of time, as specified by
+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%&.
 
@@ -17990,7 +18301,7 @@ verifying a sender, verification fails.
 .cindex "fallback" "hosts specified on router"
 String expansion is not applied to this option. The argument must be a
 colon-separated list of host names or IP addresses. The list separator can be
-changed (see section &<<SECTlistconstruct>>&), and a port can be specified with
+changed (see section &<<SECTlistsepchange>>&), and a port can be specified with
 each name or address. In fact, the format of each item is exactly the same as
 defined for the list of hosts in a &(manualroute)& router (see section
 &<<SECTformatonehostitem>>&).
@@ -18022,7 +18333,7 @@ and the discussion in chapter &<<CHAPenvironment>>&.
 .cindex "header lines" "adding"
 .cindex "router" "adding header lines"
 This option specifies a list of text headers,
-newline-separated (by default, changeable in the usual way),
+newline-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
@@ -18060,7 +18371,7 @@ avoided. The &%repeat_use%& option of the &%redirect%& router may be of help.
 .cindex "header lines" "removing"
 .cindex "router" "removing header lines"
 This option specifies a list of text headers,
-colon-separated (by default, changeable in the usual way),
+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
@@ -18146,6 +18457,7 @@ and &%user%& and the discussion in chapter &<<CHAPenvironment>>&.
 
 
 .option local_part_prefix routers&!? "string list" unset
+.cindex affix "router precondition"
 .cindex "router" "prefix for local part"
 .cindex "prefix" "for local part, used in router"
 If this option is set, the router is skipped unless the local part starts with
@@ -18342,7 +18654,8 @@ Before running a router, as one of its precondition tests, Exim works its way
 through the &%require_files%& list, expanding each item separately.
 
 Because the list is split before expansion, any colons in expansion items must
-be doubled, or the facility for using a different list separator must be used.
+be doubled, or the facility for using a different list separator must be used
+(&<<SECTlistsepchange>>&).
 If any expansion is forced to fail, the item is ignored. Other expansion
 failures cause routing of the address to be deferred.
 
@@ -18364,7 +18677,7 @@ full list of the order in which preconditions are evaluated.) However, as
 these options are all expanded, you can use the &%exists%& expansion condition
 to make such tests. The &%require_files%& option is intended for checking files
 that the router may be going to use internally, or which are needed by a
-transport (for example &_.procmailrc_&).
+transport (e.g., &_.procmailrc_&).
 
 During delivery, the &[stat()]& function is run as root, but there is a
 facility for some checking of the accessibility of a file by another user.
@@ -18404,8 +18717,8 @@ The default action for handling an unresolved EACCES is to consider it to
 be caused by a configuration error, and routing is deferred because the
 existence or non-existence of the file cannot be determined. However, in some
 circumstances it may be desirable to treat this condition as if the file did
-not exist. If the file name (or the exclamation mark that precedes the file
-name for non-existence) is preceded by a plus sign, the EACCES error is treated
+not exist. If the filename (or the exclamation mark that precedes the filename
+for non-existence) is preceded by a plus sign, the EACCES error is treated
 as if the file did not exist. For example:
 .code
 require_files = +/some/file
@@ -18804,9 +19117,7 @@ records.
 MX records of equal priority are sorted by Exim into a random order. Exim then
 looks for address records for the host names obtained from MX or SRV records.
 When a host has more than one IP address, they are sorted into a random order,
-.new
 except that IPv6 addresses are sorted before IPv4 addresses. If all the
-.wen
 IP addresses found are discarded by a setting of the &%ignore_target_hosts%&
 generic option, the router declines.
 
@@ -18939,7 +19250,6 @@ However, it will result in any message with mistyped domains
 also being queued.
 
 
-.new
 .option ipv4_only "string&!!" unset
 .cindex IPv6 disabling
 .cindex DNS "IPv6 disabling"
@@ -18955,7 +19265,6 @@ The string is expanded, and if the result is anything but a forced failure,
 or an empty string, or one of the strings “0” or “no” or “false”
 (checked without regard to the case of the letters),
 A records are sorted before AAAA records (inverting the default).
-.wen
 
 .option mx_domains dnslookup "domain list&!!" unset
 .cindex "MX record" "required to exist"
@@ -19444,9 +19753,11 @@ be enclosed in quotes if it contains white space.
 A list of hosts, whether obtained via &%route_data%& or &%route_list%&, is
 always separately expanded before use. If the expansion fails, the router
 declines. The result of the expansion must be a colon-separated list of names
-and/or IP addresses, optionally also including ports. The format of each item
+and/or IP addresses, optionally also including ports.
+If the list is written with spaces, it must be protected with quotes.
+The format of each item
 in the list is described in the next section. The list separator can be changed
-as described in section &<<SECTlistconstruct>>&.
+as described in section &<<SECTlistsepchange>>&.
 
 If the list of hosts was obtained from a &%route_list%& item, the following
 variables are set during its expansion:
@@ -19582,12 +19893,10 @@ also look in &_/etc/hosts_& or other sources of information.
 &%bydns%&: look up address records for the hosts directly in the DNS; fail if
 no address records are found. If there is a temporary DNS error (such as a
 timeout), delivery is deferred.
-.new
 .next
 &%ipv4_only%&: in direct DNS lookups, look up only A records.
 .next
 &%ipv4_prefer%&: in direct DNS lookups, sort A records before AAAA records.
-.wen
 .endlist
 
 For example:
@@ -20015,7 +20324,7 @@ Otherwise, the data must be a comma-separated list of redirection items, as
 described in the next section.
 .endlist
 
-When a message is redirected to a file (a &"mail folder"&), the file name given
+When a message is redirected to a file (a &"mail folder"&), the filename given
 in a non-filter redirection list must always be an absolute path. A filter may
 generate a relative path &-- how this is handled depends on the transport's
 configuration. See section &<<SECTfildiropt>>& for a discussion of this issue
@@ -20027,7 +20336,7 @@ for the &(appendfile)& transport.
 .cindex "address redirection" "non-filter list items"
 When the redirection data is not an Exim or Sieve filter, for example, if it
 comes from a conventional alias or forward file, it consists of a list of
-addresses, file names, pipe commands, or certain special items (see section
+addresses, filenames, pipe commands, or certain special items (see section
 &<<SECTspecitredli>>& below). The special items can be individually enabled or
 disabled by means of options whose names begin with &%allow_%& or &%forbid_%&,
 depending on their default values. The items in the list are separated by
@@ -20161,14 +20470,14 @@ parse as a valid RFC 2822 address that includes a domain. For example,
 .code
 /home/world/minbari
 .endd
-is treated as a file name, but
+is treated as a filename, but
 .code
 /s=molari/o=babylon/@x400gate.way
 .endd
-is treated as an address. For a file name, a transport must be specified using
+is treated as an address. For a filename, a transport must be specified using
 the &%file_transport%& option. However, if the generated path name ends with a
 forward slash character, it is interpreted as a directory name rather than a
-file name, and &%directory_transport%& is used instead.
+filename, and &%directory_transport%& is used instead.
 
 Normally, either the router or the transport specifies a user and a group under
 which to run the delivery. The default is to use the Exim user and group.
@@ -20272,7 +20581,7 @@ lookup and in &':include:'& files.
 
 During routing for message delivery (as opposed to verification), a redirection
 containing &':fail:'& causes an immediate failure of the incoming address,
-whereas &':defer:'& causes the message to remain on the queue so that a
+whereas &':defer:'& causes the message to remain in the queue so that a
 subsequent delivery attempt can happen at a later time. If an address is
 deferred for too long, it will ultimately fail, because the normal retry
 rules still apply.
@@ -20477,7 +20786,7 @@ A &(redirect)& router sets up a direct delivery to a file when a path name not
 ending in a slash is specified as a new &"address"&. The transport used is
 specified by this option, which, after expansion, must be the name of a
 configured transport. This should normally be an &(appendfile)& transport. When
-it is running, the file name is in &$address_file$&.
+it is running, the filename is in &$address_file$&.
 
 
 .option filter_prepend_home redirect boolean true
@@ -21173,7 +21482,7 @@ value that the router supplies, and also overriding any value associated with
 .cindex "header lines" "adding in transport"
 .cindex "transport" "header lines; adding"
 This option specifies a list of text headers,
-newline-separated (by default, changeable in the usual way),
+newline-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&),
 which are (separately) expanded and added to the header
 portion of a message as it is transported, as described in section
 &<<SECTheadersaddrem>>&. Additional header lines can also be specified by
@@ -21199,7 +21508,7 @@ checked, since this option does not automatically suppress them.
 .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);
+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.
@@ -21772,7 +22081,7 @@ require "fileinto";
 fileinto "folder23";
 .endd
 In this situation, the expansion of &%file%& or &%directory%& in the transport
-must transform the relative path into an appropriate absolute file name. In the
+must transform the relative path into an appropriate absolute filename. In the
 case of Sieve filters, the name &'inbox'& must be handled. It is the name that
 is used as a result of a &"keep"& action in the filter. This example shows one
 way of handling this requirement:
@@ -21899,9 +22208,9 @@ beneath.
 
 The option must be set to one of the words &"anywhere"&, &"inhome"&, or
 &"belowhome"&. In the second and third cases, a home directory must have been
-set for the transport. This option is not useful when an explicit file name is
-given for normal mailbox deliveries. It is intended for the case when file
-names are generated from users' &_.forward_& files. These are usually handled
+set for the transport. This option is not useful when an explicit filename is
+given for normal mailbox deliveries. It is intended for the case when filenames
+are generated from users' &_.forward_& files. These are usually handled
 by an &(appendfile)& transport called &%address_file%&. See also
 &%file_must_exist%&.
 
@@ -22323,14 +22632,14 @@ See &%quota%& above.
 This option applies when one of the delivery modes that writes a separate file
 for each message is being used. When Exim wants to find the size of one of
 these files in order to test the quota, it first checks &%quota_size_regex%&.
-If this is set to a regular expression that matches the file name, and it
+If this is set to a regular expression that matches the filename, and it
 captures one string, that string is interpreted as a representation of the
 file's size. The value of &%quota_size_regex%& is not expanded.
 
 This feature is useful only when users have no shell access to their mailboxes
 &-- otherwise they could defeat the quota simply by renaming the files. This
 facility can be used with maildir deliveries, by setting &%maildir_tag%& to add
-the file length to the file name. For example:
+the file length to the filename. For example:
 .code
 maildir_tag = ,S=$message_size
 quota_size_regex = ,S=(\d+)
@@ -22339,8 +22648,8 @@ An alternative to &$message_size$& is &$message_linecount$&, which contains the
 number of lines in the message.
 
 The regular expression should not assume that the length is at the end of the
-file name (even though &%maildir_tag%& puts it there) because maildir MUAs
-sometimes add other information onto the ends of message file names.
+filename (even though &%maildir_tag%& puts it there) because maildir MUAs
+sometimes add other information onto the ends of message filenames.
 
 Section &<<SECID136>>& contains further information.
 
@@ -22519,7 +22828,7 @@ Create a &"hitching post"& file whose name is that of the lock file with the
 current time, primary host name, and process id added, by opening for writing
 as a new file. If this fails with an access error, delivery is deferred.
 .next
-Close the hitching post file, and hard link it to the lock file name.
+Close the hitching post file, and hard link it to the lock filename.
 .next
 If the call to &[link()]& succeeds, creation of the lock file has succeeded.
 Unlink the hitching post name.
@@ -22686,11 +22995,11 @@ directory that is defined by the &%directory%& option (the &"delivery
 directory"&). If the delivery is successful, the file is renamed into the
 &_new_& subdirectory.
 
-In the file name, <&'stime'&> is the current time of day in seconds, and
+In the filename, <&'stime'&> is the current time of day in seconds, and
 <&'mtime'&> is the microsecond fraction of the time. After a maildir delivery,
 Exim checks that the time-of-day clock has moved on by at least one microsecond
 before terminating the delivery process. This guarantees uniqueness for the
-file name. However, as a precaution, Exim calls &[stat()]& for the file before
+filename. However, as a precaution, Exim calls &[stat()]& for the file before
 opening it. If any response other than ENOENT (does not exist) is given,
 Exim waits 2 seconds and tries again, up to &%maildir_retries%& times.
 
@@ -22991,7 +23300,7 @@ recipient is kept when the message is specified by the transport. &*Note*&:
 This does not apply to &'Cc:'& or &'Bcc:'& recipients.
 
 If &%once%& is unset, or is set to an empty string, the message is always sent.
-By default, if &%once%& is set to a non-empty file name, the message
+By default, if &%once%& is set to a non-empty filename, the message
 is not sent if a potential recipient is already listed in the database.
 However, if the &%once_repeat%& option specifies a time greater than zero, the
 message is sent if that much time has elapsed since a message was last sent to
@@ -23913,7 +24222,6 @@ For testing purposes, this value can be overridden by the &%-oB%& command line
 option.
 
 
-.new
 .option dane_require_tls_ciphers smtp string&!! unset
 .cindex "TLS" "requiring specific ciphers for DANE"
 .cindex "cipher" "requiring specific"
@@ -23928,7 +24236,6 @@ TLS cipherlist configuration stronger will increase security, rather than
 counter-intuitively decreasing it.
 If the option expands to be empty or is forced to fail, then it will
 be treated as unset and &%tls_require_ciphers%& will be used instead.
-.wen
 
 
 .option data_timeout smtp time 5m
@@ -23937,18 +24244,21 @@ the message. As a result, the overall timeout for a message depends on the size
 of the message. Its value must not be zero. See also &%final_timeout%&.
 
 
+.option dkim_canon smtp string&!! unset
 .option dkim_domain smtp string list&!! unset
-.option dkim_selector smtp string&!! unset
+.option dkim_hash smtp string&!! sha256
+.option dkim_identity smtp string&!! unset
 .option dkim_private_key smtp string&!! unset
-.option dkim_canon smtp string&!! unset
+.option dkim_selector smtp string&!! unset
 .option dkim_strict smtp string&!! unset
 .option dkim_sign_headers smtp string&!! "per RFC"
-.option dkim_hash smtp string&!! sha256
-.option dkim_identity smtp string&!! unset
+.option dkim_timestamps smtp string&!! unset
 DKIM signing options.  For details see section &<<SECDKIMSIGN>>&.
 
 
 .option delay_after_cutoff smtp boolean true
+.cindex "final cutoff" "retries, controlling"
+.cindex retry "final cutoff"
 This option controls what happens when all remote IP addresses for a given
 domain have been inaccessible for so long that they have passed their retry
 cutoff times.
@@ -24252,7 +24562,6 @@ Exim will request a Certificate Status on a
 TLS session for any host that matches this list.
 &%tls_verify_certificates%& should also be set for the transport.
 
-.new
 .option hosts_require_dane smtp "host list&!!" unset
 .cindex DANE "transport options"
 .cindex DANE "requiring for certain servers"
@@ -24261,7 +24570,6 @@ TLSA record is present for any host matching the list,
 and that a DANE-verified TLS connection is made.
 There will be no fallback to in-clear communication.
 See section &<<SECDANE>>&.
-.wen
 
 .option hosts_require_ocsp smtp "host list&!!" unset
 .cindex "TLS" "requiring for certain servers"
@@ -24292,7 +24600,6 @@ This option provides a list of servers to which, provided they announce
 CHUNKING support, Exim will attempt to use BDAT commands rather than DATA.
 BDAT will not be used in conjunction with a transport filter.
 
-.new
 .option hosts_try_dane smtp "host list&!!" unset
 .cindex DANE "transport options"
 .cindex DANE "attempting for certain servers"
@@ -24302,7 +24609,6 @@ If found and verified by DNSSEC,
 a DANE-verified TLS connection is made to that host;
 there will be no fallback to in-clear communication.
 See section &<<SECDANE>>&.
-.wen
 
 .option hosts_try_fastopen smtp "host list&!!" unset
 .cindex "fast open, TCP" "enabling, in client"
@@ -24350,7 +24656,8 @@ During the expansion of the &%interface%& option the variables &$host$& and
 during the expansion of the string. Forced expansion failure, or an empty
 string result causes the option to be ignored. Otherwise, after expansion, the
 string must be a list of IP addresses, colon-separated by default, but the
-separator can be changed in the usual way. For example:
+separator can be changed in the usual way (&<<SECTlistsepchange>>&).
+For example:
 .code
 interface = <; 192.168.123.123 ; 3ffe:ffff:836f::fe86:a061
 .endd
@@ -24411,10 +24718,17 @@ variable that contains an outgoing port.
 
 If the value of this option begins with a digit it is taken as a port number;
 otherwise it is looked up using &[getservbyname()]&. The default value is
-normally &"smtp"&, but if &%protocol%& is set to &"lmtp"&, the default is
-&"lmtp"&. If the expansion fails, or if a port number cannot be found, delivery
+normally &"smtp"&,
+but if &%protocol%& is set to &"lmtp"& the default is &"lmtp"&
+and if &%protocol%& is set to &"smtps"& the default is &"smtps"&.
+If the expansion fails, or if a port number cannot be found, delivery
 is deferred.
 
+.new
+Note that at least one Linux distribution has been seen failing
+to put &"smtps"& in its &"/etc/services"& file, resulting is such deferrals.
+.wen
+
 
 
 .option protocol smtp string smtp
@@ -24431,7 +24745,11 @@ over a pipe to a local process &-- see chapter &<<CHAPLMTP>>&.
 If this option is set to &"smtps"&, the default value for the &%port%& option
 changes to &"smtps"&, and the transport initiates TLS immediately after
 connecting, as an outbound SSL-on-connect, instead of using STARTTLS to upgrade.
-The Internet standards bodies strongly discourage use of this mode.
+.new
+The Internet standards bodies used to strongly discourage use of this mode,
+but as of RFC 8314 it is perferred over STARTTLS for message submission
+(as distinct from MTA-MTA communication).
+.wen
 
 
 .option retry_include_ip_address smtp boolean&!! true
@@ -24660,6 +24978,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.
 
+.new
+.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
+to a-label form.
+For details see section &<<SECTi18nMTA>>&.
+.wen
+
 
 
 
@@ -24871,7 +25199,7 @@ transport time.
 .section "Testing the rewriting rules that apply on input" "SECID149"
 .cindex "rewriting" "testing"
 .cindex "testing" "rewriting"
-Exim's input rewriting configuration appears in a part of the run time
+Exim's input rewriting configuration appears in a part of the runtime
 configuration file headed by &"begin rewrite"&. It can be tested by the
 &%-brw%& command line option. This takes an address (which can be a full RFC
 2822 address) as its argument. The output is a list of how the address would be
@@ -25687,10 +26015,13 @@ For local deliveries, one delivery attempt is always made for any subsequent
 messages. If this delivery fails, the address fails immediately. The
 post-cutoff retry time is not used.
 
+.cindex "final cutoff" "retries, controlling"
+.cindex retry "final cutoff"
 If the delivery is remote, there are two possibilities, controlled by the
 .oindex "&%delay_after_cutoff%&"
 &%delay_after_cutoff%& option of the &(smtp)& transport. The option is true by
-default. Until the post-cutoff retry time for one of the IP addresses is
+default. Until the post-cutoff retry time for one of the IP addresses,
+as set by the &%retry_data_expire%& option, is
 reached, the failing email address is bounced immediately, without a delivery
 attempt taking place. After that time, one new delivery attempt is made to
 those IP addresses that are past their retry times, and if that still fails,
@@ -25721,7 +26052,7 @@ intermittently available, or when a message has some attribute that prevents
 its delivery when others to the same address get through. In this situation,
 because some messages are successfully delivered, the &"retry clock"& for the
 host or address keeps getting reset by the successful deliveries, and so
-failing messages remain on the queue for ever because the cutoff time is never
+failing messages remain in the queue for ever because the cutoff time is never
 reached.
 
 Two exceptional actions are applied to prevent this happening. The first
@@ -25753,7 +26084,7 @@ considered immediately.
 .chapter "SMTP authentication" "CHAPSMTPAUTH"
 .scindex IIDauthconf1 "SMTP" "authentication configuration"
 .scindex IIDauthconf2 "authentication"
-The &"authenticators"& section of Exim's run time configuration is concerned
+The &"authenticators"& section of Exim's runtime configuration is concerned
 with SMTP authentication. This facility is an extension to the SMTP protocol,
 described in RFC 2554, which allows a client SMTP host to authenticate itself
 to a server. This is a common way for a server to recognize clients that are
@@ -25965,12 +26296,15 @@ output, and Exim carries on processing.
 
 .option server_set_id authenticators string&!! unset
 .vindex "&$authenticated_id$&"
+.vindex "&$authenticated_fail_id$&"
 When an Exim server successfully authenticates a client, this string is
 expanded using data from the authentication, and preserved for any incoming
 messages in the variable &$authenticated_id$&. It is also included in the log
 lines for incoming messages. For example, a user/password authenticator
 configuration might preserve the user name that was used to authenticate, and
 refer to it subsequently during delivery of the message.
+On a failing authentication the expansion result is instead saved in
+the &$authenticated_fail_id$& variable.
 If expansion fails, the option is ignored.
 
 
@@ -26109,6 +26443,10 @@ public name) of the authenticator driver that successfully authenticated the
 client from which the message was received. This variable is empty if there was
 no successful authentication.
 
+.cindex authentication "expansion item"
+Successful authentication sets up information used by the
+&$authresults$& expansion item.
+
 
 
 
@@ -26201,8 +26539,8 @@ deliver the message unauthenticated.
 
 Note that the hostlist test for whether to do authentication can be
 confused if name-IP lookups change between the time the peer is decided
-on and the transport running.  For example, with a manualroute
-router given a host name, and DNS "round-robin" use by that name: if
+upon and the time that the transport runs.  For example, with a manualroute
+router given a host name, and with DNS "round-robin" used by that name: if
 the local resolver cache times out between the router and the transport
 running, the transport may get an IP for the name for its authentication
 check which does not match the connection peer IP.
@@ -26290,7 +26628,7 @@ to be returned. If the result of a successful expansion is an empty string,
 expansion is &"1"&, &"yes"&, or &"true"&, authentication succeeds and the
 generic &%server_set_id%& option is expanded and saved in &$authenticated_id$&.
 For any other result, a temporary error code is returned, with the expanded
-string as the error text
+string as the error text.
 
 &*Warning*&: If you use a lookup in the expansion to find the user's
 password, be sure to make the authentication fail if the user is unknown.
@@ -26618,8 +26956,8 @@ fixed_cram:
 .scindex IIDcyrauth2 "authenticators" "&(cyrus_sasl)&"
 .cindex "Cyrus" "SASL library"
 .cindex "Kerberos"
-The code for this authenticator was provided by Matthew Byng-Maddick of A L
-Digital Ltd (&url(http://www.aldigital.co.uk)).
+The code for this authenticator was provided by Matthew Byng-Maddick while
+at A L Digital Ltd.
 
 The &(cyrus_sasl)& authenticator provides server support for the Cyrus SASL
 library implementation of the RFC 2222 (&"Simple Authentication and Security
@@ -26632,7 +26970,7 @@ the Cyrus interface, so if your Cyrus library can do, for example, CRAM-MD5,
 then so can the &(cyrus_sasl)& authenticator. By default it uses the public
 name of the driver to determine which mechanism to support.
 
-Where access to some kind of secret file is required, for example in GSSAPI
+Where access to some kind of secret file is required, for example, in GSSAPI
 or CRAM-MD5, it is worth noting that the authenticator runs as the Exim
 user, and that the Cyrus SASL library has no way of escalating privileges
 by default. You may also find you need to set environment variables,
@@ -26729,7 +27067,7 @@ authenticator only. There is only one option:
 
 .option server_socket dovecot string unset
 
-This option must specify the socket that is the interface to Dovecot
+This option must specify the UNIX socket that is the interface to Dovecot
 authentication. The &%public_name%& option must specify an authentication
 mechanism that Dovecot is configured to support. You can have several
 authenticators for different mechanisms. For example:
@@ -26777,17 +27115,22 @@ 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.
 
+Exim's &(gsasl)& authenticator does not have client-side support at this
+time; only the server-side support is implemented.  Patches welcome.
+
 
 .option server_channelbinding gsasl boolean false
+Do not set this true without consulting a cryptographic engineer.
+
 Some authentication mechanisms are able to use external context at both ends
 of the session to bind the authentication to that context, and fail the
 authentication process if that context differs.  Specifically, some TLS
 ciphersuites can provide identifying information about the cryptographic
 context.
 
-This means that certificate identity and verification becomes a non-issue,
-as a man-in-the-middle attack will cause the correct client and server to
-see different identifiers and authentication will fail.
+This should have meant that certificate identity and verification becomes a
+non-issue, as a man-in-the-middle attack will cause the correct client and
+server to see different identifiers and authentication will fail.
 
 This is currently only supported when using the GnuTLS library.  This is
 only usable by mechanisms which support "channel binding"; at time of
@@ -26795,7 +27138,11 @@ writing, that's the SCRAM family.
 
 This defaults off to ensure smooth upgrade across Exim releases, in case
 this option causes some clients to start failing.  Some future release
-of Exim may switch the default to be true.
+of Exim might have switched the default to be true.
+
+However, Channel Binding in TLS has proven to be broken in current versions.
+Do not plan to rely upon this feature for security, ever, without consulting
+with a subject matter expert (a cryptographic engineer).
 
 
 .option server_hostname gsasl string&!! "see below"
@@ -26977,7 +27324,7 @@ The &(spa)& authenticator provides client support for Microsoft's &'Secure
 Password Authentication'& mechanism,
 which is also sometimes known as NTLM (NT LanMan). The code for client side of
 this authenticator was contributed by Marc Prud'hommeaux, and much of it is
-taken from the Samba project (&url(http://www.samba.org)). The code for the
+taken from the Samba project (&url(https://www.samba.org/)). The code for the
 server side was subsequently contributed by Tom Kistner. The mechanism works as
 follows:
 
@@ -27109,20 +27456,25 @@ tls:
   driver = tls
   server_param1 =     ${certextract {subj_altname,mail,>:} \
                                     {$tls_in_peercert}}
-  server_condition =  ${if forany {$auth1} \
+  server_condition =  ${if and { {eq{$tls_in_certificate_verified}{1}} \
+                                 {forany {$auth1} \
                             {!= {0} \
                                 {${lookup ldap{ldap:///\
                          mailname=${quote_ldap_dn:${lc:$item}},\
                          ou=users,LDAP_DC?mailid} {$value}{0} \
-                       }    }   } }
+                       }    }  } }}}
   server_set_id =     ${if = {1}{${listcount:$auth1}} {$auth1}{}}
 .endd
 This accepts a client certificate that is verifiable against any
 of your configured trust-anchors
 (which usually means the full set of public CAs)
 and which has a SAN with a good account name.
-Note that the client cert is on the wire in-clear, including the SAN,
-whereas a plaintext SMTP AUTH done inside TLS is not.
+
+Note that, up to TLS1.2, the client cert is on the wire in-clear, including the SAN,
+The account name is therefore guessable by an opponent.
+TLS 1.3 protects both server and client certificates, and is not vulnerable
+in this way.
+Likewise, a traditional plaintext SMTP AUTH done inside TLS is not.
 
 . An alternative might use
 . .code
@@ -27195,7 +27547,7 @@ The history of port numbers for TLS in SMTP is a little messy and has been
 contentious.  As of RFC 8314, the common practice of using the historically
 allocated port 465 for "email submission but with TLS immediately upon connect
 instead of using STARTTLS" is officially blessed by the IETF, and recommended
-in preference to STARTTLS.
+by them in preference to STARTTLS.
 
 The name originally assigned to the port was &"ssmtp"& or &"smtps"&, but as
 clarity emerged over the dual roles of SMTP, for MX delivery and Email
@@ -27206,8 +27558,8 @@ standardized, but many clients kept using it, even as the TCP port number was
 reassigned for other use.
 Thus you may encounter guidance claiming that you shouldn't enable use of
 this port.
-In practice, a number of mail-clients have only supported submissions, not
-submission with STARTTLS upgrade.
+In practice, a number of mail-clients have only ever supported submissions,
+not submission with STARTTLS upgrade.
 Ideally, offer both submission (587) and submissions (465) service.
 
 Exim supports TLS-on-connect by means of the &%tls_on_connect_ports%&
@@ -27377,7 +27729,10 @@ the size of the generated prime, so it might still be too large.
 .oindex "&%tls_require_ciphers%&" "OpenSSL"
 There is a function in the OpenSSL library that can be passed a list of cipher
 suites before the cipher negotiation takes place. This specifies which ciphers
-are acceptable. The list is colon separated and may contain names like
+.new
+are acceptable for TLS versions prior to 1.3.
+.wen
+The list is colon separated and may contain names like
 DES-CBC3-SHA. Exim passes the expanded value of &%tls_require_ciphers%&
 directly to this function call.
 Many systems will install the OpenSSL manual-pages, so you may have
@@ -27442,6 +27797,18 @@ This example will prefer ECDSA-authenticated ciphers over RSA ones:
 tls_require_ciphers = ECDSA:RSA:!COMPLEMENTOFDEFAULT
 .endd
 
+.new
+For TLS version 1.3 the control available is less fine-grained
+and Exim does not provide access to it at present.
+The value of the &%tls_require_ciphers%& option is ignored when
+TLS version 1.3 is negotiated.
+
+As of writing the library default cipher suite list for TLSv1.3 is
+.code
+TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_128_GCM_SHA256
+.endd
+.wen
+
 
 .section "Requiring specific ciphers or other parameters in GnuTLS" &&&
          "SECTreqciphgnu"
@@ -27468,11 +27835,11 @@ aware of future feature enhancements of GnuTLS.
 
 Documentation of the strings accepted may be found in the GnuTLS manual, under
 "Priority strings".  This is online as
-&url(http://www.gnutls.org/manual/html_node/Priority-Strings.html),
+&url(https://www.gnutls.org/manual/html_node/Priority-Strings.html),
 but beware that this relates to GnuTLS 3, which may be newer than the version
 installed on your system.  If you are using GnuTLS 3,
 then the example code
-&url(http://www.gnutls.org/manual/gnutls.html#Listing-the-ciphersuites-in-a-priority-string)
+&url(https://www.gnutls.org/manual/gnutls.html#Listing-the-ciphersuites-in-a-priority-string)
 on that site can be used to test a given string.
 
 For example:
@@ -27624,7 +27991,7 @@ session with a client, you must set either &%tls_verify_hosts%& or
 apply to all TLS connections. For any host that matches one of these options,
 Exim requests a certificate as part of the setup of the TLS session. The
 contents of the certificate are verified by comparing it with a list of
-expected certificates.
+expected trust-anchors or certificates.
 These may be the system default set (depending on library version),
 an explicit file or,
 depending on library version, a directory, identified by
@@ -27641,6 +28008,9 @@ openssl x509 -hash -noout -in /cert/file
 .endd
 where &_/cert/file_& contains a single certificate.
 
+There is no checking of names of the client against the certificate
+Subject Name or Subject Alternate Names.
+
 The difference between &%tls_verify_hosts%& and &%tls_try_verify_hosts%& is
 what happens if the client does not supply a certificate, or if the certificate
 does not match any of the certificates in the collection named by
@@ -27802,6 +28172,11 @@ The &%tls_verify_hosts%& and &%tls_try_verify_hosts%& options restrict
 certificate verification to the listed servers.  Verification either must
 or need not succeed respectively.
 
+The &%tls_verify_cert_hostnames%& option lists hosts for which additional
+checks are made: that the host name (the one in the DNS A record)
+is valid for the certificate.
+The option defaults to always checking.
+
 The &(smtp)& transport has two OCSP-related options:
 &%hosts_require_ocsp%&; a host-list for which a Certificate Status
 is requested and required for the connection to proceed.  The default
@@ -27968,22 +28343,29 @@ connections to new processes if TLS has been used.
 .section "Certificates and all that" "SECTcerandall"
 .cindex "certificate" "references to discussion"
 In order to understand fully how TLS works, you need to know about
-certificates, certificate signing, and certificate authorities. This is not the
-place to give a tutorial, especially as I do not know very much about it
-myself. Some helpful introduction can be found in the FAQ for the SSL addition
-to Apache, currently at
+certificates, certificate signing, and certificate authorities.
+This is a large topic and an introductory guide is unsuitable for the Exim
+reference manual, so instead we provide pointers to existing documentation.
+
+The Apache web-server was for a long time the canonical guide, so their
+documentation is a good place to start; their SSL module's Introduction
+document is currently at
 .display
-&url(http://www.modssl.org/docs/2.7/ssl_faq.html#ToC24)
+&url(https://httpd.apache.org/docs/current/ssl/ssl_intro.html)
 .endd
-Other parts of the &'modssl'& documentation are also helpful, and have
-links to further files.
-Eric Rescorla's book, &'SSL and TLS'&, published by Addison-Wesley (ISBN
-0-201-61598-3), contains both introductory and more in-depth descriptions.
-Some sample programs taken from the book are available from
+and their FAQ is at
 .display
-&url(http://www.rtfm.com/openssl-examples/)
+&url(https://httpd.apache.org/docs/current/ssl/ssl_faq.html)
 .endd
 
+Eric Rescorla's book, &'SSL and TLS'&, published by Addison-Wesley (ISBN
+0-201-61598-3) in 2001, contains both introductory and more in-depth
+descriptions.
+More recently Ivan Ristić's book &'Bulletproof SSL and TLS'&,
+published by Feisty Duck (ISBN 978-1907117046) in 2013 is good.
+Ivan is the author of the popular TLS testing tools at
+&url(https://www.ssllabs.com/).
+
 
 .section "Certificate chains" "SECID186"
 The file named by &%tls_certificate%& may contain more than one
@@ -28054,13 +28436,12 @@ signed with that self-signed certificate.
 For information on creating self-signed CA certificates and using them to sign
 user certificates, see the &'General implementation overview'& chapter of the
 Open-source PKI book, available online at
-&url(http://ospkibook.sourceforge.net/).
+&url(https://sourceforge.net/projects/ospkibook/).
 .ecindex IIDencsmtp1
 .ecindex IIDencsmtp2
 
 
 
-.new
 .section DANE "SECDANE"
 .cindex DANE
 DNS-based Authentication of Named Entities, as applied to SMTP over TLS, provides assurance to a client that
@@ -28093,17 +28474,48 @@ Support for client-side operation of DANE can be included at compile time by def
 in &_Local/Makefile_&.
 If it has been included, the macro "_HAVE_DANE" will be defined.
 
-The TLSA record for the server may have "certificate usage" of DANE-TA(2) or DANE-EE(3).  The latter specifies
-the End Entity directly, i.e. the certificate involved is that of the server (and should be the sole one transmitted
-during the TLS handshake); this is appropriate for a single system, using a self-signed certificate.
+The TLSA record for the server may have "certificate usage" of DANE-TA(2) or DANE-EE(3).
+These are the "Trust Anchor" and "End Entity" variants.
+The latter specifies the End Entity directly, i.e. the certificate involved is that of the server
+(and if only DANE-EE is used then it should be the sole one transmitted during the TLS handshake);
+this is appropriate for a single system, using a self-signed certificate.
 DANE-TA usage is effectively declaring a specific CA to be used; this might be a private CA or a public,
-well-known one.  A private CA at simplest is just a self-signed certificate which is used to sign
-cerver certificates, but running one securely does require careful arrangement.  If a private CA is used
-then either all clients must be primed with it, or (probably simpler) the server TLS handshake must transmit
-the entire certificate chain from CA to server-certificate.  If a public CA is used then all clients must be primed with it
-(losing one advantage of DANE) - but the attack surface is reduced from all public CAs to that single CA.
+well-known one.
+A private CA at simplest is just a self-signed certificate (with certain
+attributes) which is used to sign server certificates, but running one securely
+does require careful arrangement.
+With DANE-TA, as implemented in Exim and commonly in other MTAs,
+the server TLS handshake must transmit the entire certificate chain from CA to server-certificate.
 DANE-TA is commonly used for several services and/or servers, each having a TLSA query-domain CNAME record,
 all of which point to a single TLSA record.
+DANE-TA and DANE-EE can both be used together.
+
+.new
+Our recommendation is to use DANE with a certificate from a public CA,
+because this enables a variety of strategies for remote clients to verify
+your certificate.
+You can then publish information both via DANE and another technology,
+"MTA-STS", described below.
+
+When you use DANE-TA to publish trust anchor information, you ask entities
+outside your administrative control to trust the Certificate Authority for
+connections to you.
+If using a private CA then you should expect others to still apply the
+technical criteria they'd use for a public CA to your certificates.
+In particular, you should probably try to follow current best practices for CA
+operation around hash algorithms and key sizes.
+Do not expect other organizations to lower their security expectations just
+because a particular profile might be reasonable for your own internal use.
+
+When this text was last updated, this in practice means to avoid use of SHA-1
+and MD5; if using RSA to use key sizes of at least 2048 bits (and no larger
+than 4096, for interoperability); to use keyUsage fields correctly; to use
+random serial numbers.
+The list of requirements is subject to change as best practices evolve.
+If you're not already using a private CA, or it doesn't meet these
+requirements, then we encourage you to avoid all these issues and use a public
+CA such as &url(https://letsencrypt.org/,Let's Encrypt) instead.
+.wen
 
 The TLSA record should have a Selector field of SPKI(1) and a Matching Type field of SHA2-512(2).
 
@@ -28121,6 +28533,16 @@ are workable for 4th-field hashes.
 
 For use with the DANE-TA model, server certificates must have a correct name (SubjectName or SubjectAltName).
 
+.new
+The Certificate issued by the CA published in the DANE-TA model should be
+issued using a strong hash algorithm.
+Exim, and importantly various other MTAs sending to you, will not
+re-enable hash algorithms which have been disabled by default in TLS
+libraries.
+This means no MD5 and no SHA-1.  SHA2-256 is the minimum for reliable
+interoperability (and probably the maximum too, in 2018).
+.wen
+
 The use of OCSP-stapling should be considered, allowing for fast revocation of certificates (which would otherwise
 be limited by the DNS TTL on the TLSA records).  However, this is likely to only be usable with DANE-TA.  NOTE: the
 default of requesting OCSP for all hosts is modified iff DANE is in use, to:
@@ -28191,7 +28613,28 @@ The &$event_data$& will be one of the Result Types defined in
 Section 4.3 of that document.
 
 Under GnuTLS, DANE is only supported from version 3.0.0 onwards.
-.wen
+
+DANE is specified in published RFCs and decouples certificate authority trust
+selection from a "race to the bottom" of "you must trust everything for mail
+to get through".  There is an alternative technology called MTA-STS, which
+instead publishes MX trust anchor information on an HTTPS website.  At the
+time this text was last updated, MTA-STS was still a draft, not yet an RFC.
+Exim has no support for MTA-STS as a client, but Exim mail server operators
+can choose to publish information describing their TLS configuration using
+MTA-STS to let those clients who do use that protocol derive trust
+information.
+
+The MTA-STS design requires a certificate from a public Certificate Authority
+which is recognized by clients sending to you.
+That selection of which CAs are trusted by others is outside your control.
+
+The most interoperable course of action is probably to use
+&url(https://letsencrypt.org/,Let's Encrypt), with automated certificate
+renewal; to publish the anchor information in DNSSEC-secured DNS via TLSA
+records for DANE clients (such as Exim and Postfix) and to publish anchor
+information for MTA-STS as well.  This is what is done for the &'exim.org'&
+domain itself (with caveats around occasionally broken MTA-STS because of
+incompatible specification changes prior to reaching RFC status).
 
 
 
@@ -28203,7 +28646,7 @@ Under GnuTLS, DANE is only supported from version 3.0.0 onwards.
 .cindex "control of incoming mail"
 .cindex "message" "controlling incoming"
 .cindex "policy control" "access control lists"
-Access Control Lists (ACLs) are defined in a separate section of the run time
+Access Control Lists (ACLs) are defined in a separate section of the runtime
 configuration file, headed by &"begin acl"&. Each ACL definition starts with a
 name, terminated by a colon. Here is a complete ACL section that contains just
 one very small ACL:
@@ -28437,7 +28880,7 @@ for this can be disabled when the variable &$prdr_requested$&
 is &"yes"&.
 Any required difference in behaviour of the main DATA-time
 ACL should however depend on the PRDR-time ACL having run, as Exim
-will avoid doing so in some situations (e.g.  single-recipient mails).
+will avoid doing so in some situations (e.g. single-recipient mails).
 
 See also the &%prdr_enable%& global option
 and the &%hosts_try_prdr%& smtp transport option.
@@ -28529,7 +28972,7 @@ configuration file; there are other possibilities. Having expanded the
 string, Exim searches for an ACL as follows:
 
 .ilist
-If the string begins with a slash, Exim uses it as a file name, and reads its
+If the string begins with a slash, Exim uses it as a filename, and reads its
 contents as an ACL. The lines are processed in the same way as lines in the
 Exim configuration file. In particular, continuation lines are supported, blank
 lines are ignored, as are lines whose first non-whitespace character is &"#"&.
@@ -29405,7 +29848,7 @@ and cannot depend on content of received headers.
 Note also that headers cannot be
 modified by any of the post-data ACLs (DATA, MIME and DKIM).
 Headers may be modified by routers (subject to the above) and transports.
-The Received-By: header is generated as soon as the body reception starts,
+The &'Received-By:'& header is generated as soon as the body reception starts,
 rather than the traditional time after the full message is received;
 this will affect the timestamp.
 
@@ -29814,9 +30257,10 @@ warn   hosts           = +internal_hosts
 warn   message         = Remove internal headers
        remove_header   = $acl_c_ihdrs
 .endd
-Removed header lines are accumulated during the MAIL, RCPT, and predata ACLs.
-They are removed from the message before processing the DATA and MIME ACLs.
-There is no harm in attempting to remove the same header twice nor is removing
+Header names for removal are accumulated during the MAIL, RCPT, and predata ACLs.
+Matching header lines are removed from the message before processing the DATA and MIME ACLs.
+If multiple header lines match, all are removed.
+There is no harm in attempting to remove the same header twice nor in removing
 a non-existent header. Further header lines to be removed may be accumulated
 during the DATA and MIME ACLs, after which they are removed from the message,
 if present. In the case of non-SMTP messages, headers to be removed are
@@ -30348,6 +30792,10 @@ connection (assuming long-enough TTL).
 Exim does not share information between multiple incoming
 connections (but your local name server cache should be active).
 
+There are a number of DNS lists to choose from, some commercial, some free,
+or free for small deployments.  An overview can be found at
+&url(https://en.wikipedia.org/wiki/Comparison_of_DNS_blacklists).
+
 
 
 .section "Specifying the IP address for a DNS list lookup" "SECID201"
@@ -30369,7 +30817,7 @@ MX hosts or nameservers of an email sender address. For an example, see section
 .section "DNS lists keyed on domain names" "SECID202"
 .cindex "DNS list" "keyed by domain name"
 There are some lists that are keyed on domain names rather than inverted IP
-addresses (see for example the &'domain based zones'& link at
+addresses (see, e.g., the &'domain based zones'& link at
 &url(http://www.rfc-ignorant.org/)). No reversing of components is used
 with these lists. You can change the name that is looked up in a DNS list by
 listing it after the domain name, introduced by a slash. For example,
@@ -30704,7 +31152,7 @@ restrictions, to get the TXT record. As a byproduct of this, there is also
 a check that the IP being tested is indeed on the first list. The first
 domain is the one that is put in &$dnslist_domain$&. For example:
 .code
-reject message  = \
+deny message  = \
          rejected because $sender_host_address is blacklisted \
          at $dnslist_domain\n$dnslist_text
        dnslists = \
@@ -30722,7 +31170,7 @@ If you are interested in more than one merged list, the same list must be
 given several times, but because the results of the DNS lookups are cached,
 the DNS calls themselves are not repeated. For example:
 .code
-reject dnslists = \
+deny dnslists = \
          http.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.2 : \
          socks.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.3 : \
          misc.dnsbl.sorbs.net,dnsbl.sorbs.net=127.0.0.4 : \
@@ -30820,7 +31268,7 @@ rate at which a recipient receives messages, you can use the key
 ACL.
 
 Each &%ratelimit%& condition can have up to four options. A &%per_*%& option
-specifies what Exim measures the rate of, for example messages or recipients
+specifies what Exim measures the rate of, for example, messages or recipients
 or bytes. You can adjust the measurement using the &%unique=%& and/or
 &%count=%& options. You can also control when Exim updates the recorded rate
 using a &%strict%&, &%leaky%&, or &%readonly%& option. The options are
@@ -30933,13 +31381,15 @@ rest of the ACL.
 
 The &%leaky%& (default) option means that the client's recorded rate is not
 updated if it is above the limit. The effect of this is that Exim measures the
-client's average rate of successfully sent email, which cannot be greater than
-the maximum allowed. If the client is over the limit it may suffer some
-counter-measures (as specified in the ACL), but it will still be able to send
-email at the configured maximum rate, whatever the rate of its attempts. This
+client's average rate of successfully sent email,
+.new
+up to the given limit.
+This is appropriate if the countermeasure when the condition is true
+consists of refusing the message, and
 is generally the better choice if you have clients that retry automatically.
-For example, it does not prevent a sender with an over-aggressive retry rate
-from getting any email through.
+If the action when true is anything more complex then this option is
+likely not what is wanted.
+.wen
 
 The &%strict%& option means that the client's recorded rate is always
 updated. The effect of this is that Exim measures the client's average rate
@@ -31110,6 +31560,15 @@ connection, HELO, or MAIL).
 The main use of these variables is expected to be to distinguish between
 rejections of MAIL and rejections of RCPT in callouts.
 
+.new
+The above variables may also be set after a &*successful*&
+address verification to:
+
+.ilist
+&%random%&: A random local-part callout succeeded
+.endlist
+.wen
+
 
 
 
@@ -31824,9 +32283,7 @@ If the value of &%av_scanner%& starts with a dollar character, it is expanded
 before use.
 The usual list-parsing of the content (see &<<SECTlistconstruct>>&) applies.
 The following scanner types are supported in this release,
-.new
 though individual ones can be included or not at build time:
-.wen
 
 .vlist
 .vitem &%avast%&
@@ -31840,11 +32297,20 @@ which can be either a full path to a UNIX socket,
 or host and port specifiers separated by white space.
 The host may be a name or an IP address; the port is either a
 single number or a pair of numbers with a dash between.
-Any further options are given, on separate lines,
-to the daemon as options before the main scan command.
+A list of options may follow. These options are interpreted on the
+Exim's side of the malware scanner, or are given on separate lines to
+the daemon as options before the main scan command.
+
+.cindex &`pass_unscanned`& "avast"
+If &`pass_unscanned`&
+is set, any files the Avast scanner can't scan (e.g.
+decompression bombs, or invalid archives) are considered clean. Use with
+care.
+
 For example:
 .code
 av_scanner = avast:/var/run/avast/scan.sock:FLAGS -fullfiles:SENSITIVITY -pup
+av_scanner = avast:/var/run/avast/scan.sock:pass_unscanned:FLAGS -fullfiles:SENSITIVITY -pup
 av_scanner = avast:192.168.2.22 5036
 .endd
 If you omit the argument, the default path
@@ -31861,13 +32327,14 @@ $ socat UNIX:/var/run/avast/scan.sock STDIO:
     PACK
 .endd
 
-Only the first virus detected will be reported.
-
+If the scanner returns a temporary failure (e.g. license issues, or
+permission problems), the message is deferred and a paniclog entry is
+written.  The usual &`defer_ok`& option is available.
 
 .vitem &%aveserver%&
 .cindex "virus scanners" "Kaspersky"
 This is the scanner daemon of Kaspersky Version 5. You can get a trial version
-at &url(http://www.kaspersky.com). This scanner type takes one option,
+at &url(https://www.kaspersky.com/). This scanner type takes one option,
 which is the path to the daemon's UNIX socket. The default is shown in this
 example:
 .code
@@ -31878,7 +32345,7 @@ av_scanner = aveserver:/var/run/aveserver
 .vitem &%clamd%&
 .cindex "virus scanners" "clamd"
 This daemon-type scanner is GPL and free. You can get it at
-&url(http://www.clamav.net/). Some older versions of clamd do not seem to
+&url(https://www.clamav.net/). Some older versions of clamd do not seem to
 unpack MIME containers, so it used to be recommended to unpack MIME attachments
 in the MIME ACL. This is no longer believed to be necessary.
 
@@ -31913,7 +32380,7 @@ av_scanner = clamd:192.0.2.3 1234 : 192.0.2.4 1234
 If the value of av_scanner points to a UNIX socket file or contains the
 &`local`&
 option, then the ClamAV interface will pass a filename containing the data
-to be scanned, which will should normally result in less I/O happening and be
+to be scanned, which should normally result in less I/O happening and be
 more efficient.  Normally in the TCP case, the data is streamed to ClamAV as
 Exim does not assume that there is a common filesystem with the remote host.
 
@@ -31972,7 +32439,7 @@ av_scanner = cmdline:\
 .endd
 .vitem &%drweb%&
 .cindex "virus scanners" "DrWeb"
-The DrWeb daemon scanner (&url(http://www.sald.com/)) interface
+The DrWeb daemon scanner (&url(https://www.sald.ru/)) interface
 takes one option,
 either a full path to a UNIX socket,
 or host and port specifiers separated by white space.
@@ -31995,7 +32462,7 @@ For example:
 .code
 av_scanner = f-protd:localhost 10200-10204
 .endd
-If you omit the argument, the default values show above are used.
+If you omit the argument, the default values shown above are used.
 
 .vitem &%f-prot6d%&
 .cindex "virus scanners" "f-prot6d"
@@ -32009,7 +32476,7 @@ If you omit the argument, the default values show above are used.
 
 .vitem &%fsecure%&
 .cindex "virus scanners" "F-Secure"
-The F-Secure daemon scanner (&url(http://www.f-secure.com)) takes one
+The F-Secure daemon scanner (&url(https://www.f-secure.com/)) takes one
 argument which is the path to a UNIX socket. For example:
 .code
 av_scanner = fsecure:/path/to/.fsav
@@ -32030,9 +32497,13 @@ The default path is &_/var/run/AvpCtl_&.
 
 .vitem &%mksd%&
 .cindex "virus scanners" "mksd"
-This is a daemon type scanner that is aimed mainly at Polish users, though some
-parts of documentation are now available in English. You can get it at
-&url(http://linux.mks.com.pl/). The only option for this scanner type is
+This was a daemon type scanner that is aimed mainly at Polish users,
+though some documentation was available in English.
+The history can be shown at &url(https://en.wikipedia.org/wiki/Mks_vir)
+and this appears to be a candidate for removal from Exim, unless
+we are informed of other virus scanners which use the same protocol
+to integrate.
+The only option for this scanner type is
 the maximum number of processes used simultaneously to scan the attachments,
 provided that mksd has
 been run with at least the same number of child processes. For example:
@@ -32064,7 +32535,7 @@ specify an empty element to get this.
 .vitem &%sophie%&
 .cindex "virus scanners" "Sophos and Sophie"
 Sophie is a daemon that uses Sophos' &%libsavi%& library to scan for viruses.
-You can get Sophie at &url(http://www.clanfield.info/sophie/). The only option
+You can get Sophie at &url(http://sophie.sourceforge.net/). The only option
 for this scanner type is the path to the UNIX socket that Sophie uses for
 client communication. For example:
 .code
@@ -32102,7 +32573,7 @@ A regular expression, in which case the message is scanned for viruses. The
 condition succeeds if a virus is found and its name matches the regular
 expression. This allows you to take special actions on certain types of virus.
 Note that &"/"& characters in the RE must be doubled due to the list-processing,
-unless the separator is changed (in the usual way).
+unless the separator is changed (in the usual way &<<SECTlistsepchange>>&).
 .endlist
 
 You can append a &`defer_ok`& element to the &%malware%& argument list to accept
@@ -32168,7 +32639,7 @@ Support is also provided for Rspamd.
 
 For more information about installation and configuration of SpamAssassin or
 Rspamd refer to their respective websites at
-&url(http://spamassassin.apache.org) and &url(http://www.rspamd.com)
+&url(https://spamassassin.apache.org/) and &url(https://www.rspamd.com/)
 
 SpamAssassin can be installed with CPAN by running:
 .code
@@ -32185,7 +32656,7 @@ intend to use an instance running on the local host you do not need to set
 you must set the &%spamd_address%& option in the global part of the Exim
 configuration as follows (example):
 .code
-spamd_address = 192.168.99.45 387
+spamd_address = 192.168.99.45 783
 .endd
 The SpamAssassin protocol relies on a TCP half-close from the client.
 If your SpamAssassin client side is running a Linux system with an
@@ -32206,14 +32677,14 @@ spamd_address = 127.0.0.1 11333 variant=rspamd
 
 As of version 2.60, &%SpamAssassin%& also supports communication over UNIX
 sockets. If you want to us these, supply &%spamd_address%& with an absolute
-file name instead of an address/port pair:
+filename instead of an address/port pair:
 .code
 spamd_address = /var/run/spamd_socket
 .endd
 You can have multiple &%spamd%& servers to improve scalability. These can
 reside on other hardware reachable over the network. To specify multiple
 &%spamd%& servers, put multiple address/port pairs in the &%spamd_address%&
-option, separated with colons (the separator can be changed in the usual way):
+option, separated with colons (the separator can be changed in the usual way &<<SECTlistsepchange>>&):
 .code
 spamd_address = 192.168.2.10 783 : \
                 192.168.2.11 783 : \
@@ -32226,7 +32697,8 @@ condition defers.
 
 Unix and TCP socket specifications may be mixed in any order.
 Each element of the list is a list itself, space-separated by default
-and changeable in the usual way; take care to not double the separator.
+and changeable in the usual way (&<<SECTlistsepchange>>&);
+take care to not double the separator.
 
 For TCP socket specifications a host name or IP (v4 or v6, but
 subject to list-separator quoting rules) address can be used,
@@ -32333,7 +32805,7 @@ available for use at delivery time.
 
 .vlist
 .vitem &$spam_score$&
-The spam score of the message, for example &"3.4"& or &"30.5"&. This is useful
+The spam score of the message, for example, &"3.4"& or &"30.5"&. This is useful
 for inclusion in log or reject messages.
 
 .vitem &$spam_score_int$&
@@ -32443,13 +32915,13 @@ the value can be:
 .next
 The string &"default"&. In that case, the file is put in the temporary
 &"default"& directory <&'spool_directory'&>&_/scan/_&<&'message_id'&>&_/_& with
-a sequential file name consisting of the message id and a sequence number. The
+a sequential filename consisting of the message id and a sequence number. The
 full path and name is available in &$mime_decoded_filename$& after decoding.
 .next
 A full path name starting with a slash. If the full name is an existing
 directory, it is used as a replacement for the default directory. The filename
 is then sequentially assigned. If the path does not exist, it is used as
-the full path and file name.
+the full path and filename.
 .next
 If the string does not start with a slash, it is used as the
 filename, and the default path is then used.
@@ -32537,7 +33009,7 @@ empty string.
 
 .vitem &$mime_decoded_filename$&
 This variable is set only after the &%decode%& modifier (see above) has been
-successfully run. It contains the full path and file name of the file
+successfully run. It contains the full path and filename of the file
 containing the decoded data.
 .endlist
 
@@ -32588,7 +33060,7 @@ condition = ${if eq{$mime_content_type}{text/html}{1}{0}}
 .endd
 .vitem &$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"&.
+&"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.
 
@@ -32692,10 +33164,15 @@ code. The incident is logged on the main and reject logs.
 .section "Building Exim to use a local scan function" "SECID207"
 .cindex "&[local_scan()]& function" "building Exim to use"
 To make use of the local scan function feature, you must tell Exim where your
-function is before building Exim, by setting LOCAL_SCAN_SOURCE in your
+function is before building Exim, by setting
+.new
+both HAVE_LOCAL_SCAN and
+.wen
+LOCAL_SCAN_SOURCE in your
 &_Local/Makefile_&. A recommended place to put it is in the &_Local_&
 directory, so you might set
 .code
+HAVE_LOCAL_SCAN=yes
 LOCAL_SCAN_SOURCE=Local/local_scan.c
 .endd
 for example. The function must be called &[local_scan()]&. It is called by
@@ -32705,7 +33182,7 @@ function controls whether the message is actually accepted or not. There is a
 commented template function (that just accepts the message) in the file
 _src/local_scan.c_.
 
-If you want to make use of Exim's run time configuration file to set options
+If you want to make use of Exim's runtime configuration file to set options
 for your &[local_scan()]& function, you must also set
 .code
 LOCAL_SCAN_HAS_OPTIONS=yes
@@ -32717,6 +33194,7 @@ in &_Local/Makefile_& (see section &<<SECTconoptloc>>& below).
 
 .section "API for local_scan()" "SECTapiforloc"
 .cindex "&[local_scan()]& function" "API description"
+.cindex &%dlfunc%& "API description"
 You must include this line near the start of your code:
 .code
 #include "local_scan.h"
@@ -35032,7 +35510,7 @@ accepted.
 
 .chapter "Customizing bounce and warning messages" "CHAPemsgcust" &&&
          "Customizing messages"
-When a message fails to be delivered, or remains on the queue for more than a
+When a message fails to be delivered, or remains in the queue for more than a
 configured amount of time, Exim sends a message to the original sender, or
 to an alternative configured address. The text of these messages is built into
 the code of Exim, but it is possible to change it, either by adding a single
@@ -35145,7 +35623,7 @@ A message ${if eq{$sender_address}{$warn_message_recipients}
 <$sender_address>
 
 }}has not been delivered to all of its recipients after
-more than $warn_message_delay on the queue on $primary_hostname.
+more than $warn_message_delay in the queue on $primary_hostname.
 
 The message identifier is:     $message_exim_id
 The subject of the message is: $h_subject
@@ -35227,7 +35705,7 @@ such file, the router declines, but because &%no_more%& is set, no subsequent
 routers are tried, and so the whole delivery fails.
 
 The &%forbid_pipe%& and &%forbid_file%& options prevent a local part from being
-expanded into a file name or a pipe delivery, which is usually inappropriate in
+expanded into a filename or a pipe delivery, which is usually inappropriate in
 a mailing list.
 
 .oindex "&%errors_to%&"
@@ -35352,7 +35830,7 @@ the address, giving a suitable error message.
 .cindex "VERP"
 .cindex "Variable Envelope Return Paths"
 .cindex "envelope sender"
-Variable Envelope Return Paths &-- see &url(http://cr.yp.to/proto/verp.txt) &--
+Variable Envelope Return Paths &-- see &url(https://cr.yp.to/proto/verp.txt) &--
 are a way of helping mailing list administrators discover which subscription
 address is the cause of a particular delivery failure. The idea is to encode
 the original recipient address in the outgoing envelope sender address, so that
@@ -35483,7 +35961,7 @@ 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.
 
-This one router can handle all the virtual domains because the alias file names
+This one router can handle all the virtual domains because the alias filenames
 follow a fixed pattern. Permissions can be arranged so that appropriate people
 can edit the different alias files. A successful aliasing operation results in
 a new envelope recipient address, which is then routed from scratch.
@@ -35633,7 +36111,7 @@ Nevertheless there are some features that can be used.
 
 .section "Exim on the upstream server host" "SECID247"
 It is tempting to arrange for incoming mail for the intermittently connected
-host to remain on Exim's queue until the client connects. However, this
+host to remain in Exim's queue until the client connects. However, this
 approach does not scale very well. Two different kinds of waiting message are
 being mixed up in the same queue &-- those that cannot be delivered because of
 some temporary problem, and those that are waiting for their destination host
@@ -35890,14 +36368,14 @@ need to tweak syslog to prevent it syncing the file with each write &-- on
 Linux this has been seen to make syslog take 90% plus of CPU time.
 
 The destination for Exim's logs is configured by setting LOG_FILE_PATH in
-&_Local/Makefile_& or by setting &%log_file_path%& in the run time
+&_Local/Makefile_& or by setting &%log_file_path%& in the runtime
 configuration. This latter string is expanded, so it can contain, for example,
 references to the host name:
 .code
 log_file_path = /var/log/$primary_hostname/exim_%slog
 .endd
 It is generally advisable, however, to set the string in &_Local/Makefile_&
-rather than at run time, because then the setting is available right from the
+rather than at runtime, because then the setting is available right from the
 start of Exim's execution. Otherwise, if there's something it wants to log
 before it has read the configuration file (for example, an error in the
 configuration file) it will not use the path you want, and may not be able to
@@ -35920,11 +36398,11 @@ equivalent to the setting:
 .code
 log_file_path = $spool_directory/log/%slog
 .endd
-If you do not specify anything at build time or run time,
-or if you unset the option at run time (i.e. &`log_file_path = `&),
+If you do not specify anything at build time or runtime,
+or if you unset the option at runtime (i.e. &`log_file_path = `&),
 that is where the logs are written.
 
-A log file path may also contain &`%D`& or &`%M`& if datestamped log file names
+A log file path may also contain &`%D`& or &`%M`& if datestamped log filenames
 are in use &-- see section &<<SECTdatlogfil>>& below.
 
 Here are some examples of possible settings:
@@ -36342,8 +36820,9 @@ the following table:
 &`F   `&        sender address (on delivery lines)
 &`H   `&        host name and IP address
 &`I   `&        local interface used
-&`K   `&        CHUNKING extension used
 &`id  `&        message id for incoming message
+&`K   `&        CHUNKING extension used
+&`L   `&        on &`<=`& and &`=>`& lines: PIPELINING extension used
 &`M8S `&        8BITMIME status for incoming message
 &`P   `&        on &`<=`& lines: protocol used
 &`    `&        on &`=>`& and &`**`& lines: return path
@@ -36407,11 +36886,9 @@ A delivery set up by a router configured with
 failed. The delivery was discarded.
 .endlist olist
 .next
-.new
 .cindex DKIM "log line"
 &'DKIM: d='&&~&~Verbose results of a DKIM verification attempt, if enabled for
 logging and the message has a DKIM signature header.
-.wen
 .endlist ilist
 
 
@@ -36456,7 +36933,9 @@ selection marked by asterisks:
 &` queue_time                 `&  time on queue for one recipient
 &` queue_time_overall         `&  time on queue for whole message
 &` pid                        `&  Exim process id
+&` pipelining                 `&  PIPELINING use, on <= and => lines
 &` proxy                      `&  proxy address on <= and => lines
+&` receive_time               `&  time taken to receive message
 &` received_recipients        `&  recipients on <= lines
 &` received_sender            `&  sender on <= lines
 &`*rejected_header            `&  header contents on reject log
@@ -36547,7 +37026,6 @@ precision, eg. &`DT=0.304s`&.
 &%delivery_size%&: For each delivery, the size of message delivered is added to
 the &"=>"& line, tagged with S=.
 .next
-.new
 .cindex log "DKIM verification"
 .cindex DKIM "verification logging"
 &%dkim%&: For message acceptance log lines, when an DKIM signature in the header
@@ -36556,7 +37034,6 @@ verifies successfully a tag of DKIM is added, with one of the verified domains.
 .cindex log "DKIM verification"
 .cindex DKIM "verification logging"
 &%dkim_verbose%&: A log entry is written for each attempted DKIM verification.
-.wen
 .next
 .cindex "log" "dnslist defer"
 .cindex "DNS list" "logging defer"
@@ -36598,7 +37075,7 @@ client's ident port times out.
 &%incoming_interface%&: The interface on which a message was received is added
 to the &"<="& line as an IP address in square brackets, tagged by I= and
 followed by a colon and the port number. The local interface and port are also
-added to other SMTP log lines, for example &"SMTP connection from"&, to
+added to other SMTP log lines, for example, &"SMTP connection from"&, to
 rejection lines, and (despite the name) to outgoing &"=>"& and &"->"& lines.
 The latter can be disabled by turning off the &%outgoing_interface%& option.
 .next
@@ -36659,6 +37136,16 @@ local port is a random ephemeral port.
 &%pid%&: The current process id is added to every log line, in square brackets,
 immediately after the time and date.
 .next
+.new
+.cindex log pipelining
+.cindex pipelining "logging outgoing"
+&%pipelining%&: A field is added to delivery and accept
+log lines when the ESMTP PIPELINING extension was used.
+The field is a single "L".
+
+On accept lines, where PIPELINING was offered but not used by the client,
+the field has a minus appended.
+.next
 .cindex "log" "queue run"
 .cindex "queue runner" "logging"
 &%queue_run%&: The start and end of every queue run are logged.
@@ -36678,14 +37165,12 @@ precision, eg. &`QT=1.578s`&.
 the local host is logged as QT=<&'time'&> on &"Completed"& lines, for
 example, &`QT=3m45s`&. The clock starts when Exim starts to receive the
 message, so it includes reception time as well as the total delivery time.
-.new
 .next
 .cindex "log" "receive duration"
 &%receive_time%&: For each message, the amount of real time it has taken to
 perform the reception is logged as RT=<&'time'&>, for example, &`RT=1s`&.
 If millisecond logging is enabled, short times will be shown with greater
 precision, eg. &`RT=0.204s`&.
-.wen
 .next
 .cindex "log" "recipients"
 &%received_recipients%&: The recipients of a message are listed in the main log
@@ -36843,10 +37328,8 @@ unchanged, or whether they should be rendered as escape sequences.
 &%tls_certificate_verified%&: An extra item is added to <= and => log lines
 when TLS is in use. The item is &`CV=yes`& if the peer's certificate was
 verified
-.new
 using a CA trust anchor,
 &`CA=dane`& if using a DNS trust anchor,
-.wen
 and &`CV=no`& if not.
 .next
 .cindex "log" "TLS cipher"
@@ -36926,7 +37409,7 @@ the next chapter. The utilities described here are:
 
 Another utility that might be of use to sites with many MTAs is Tom Kistner's
 &'exilog'&. It provides log visualizations across multiple Exim servers. See
-&url(http://duncanthrax.net/exilog/) for details.
+&url(https://duncanthrax.net/exilog/) for details.
 
 
 
@@ -37050,7 +37533,7 @@ There is one more option, &%-h%&, which outputs a list of options.
 .cindex "&'exiqsumm'&"
 .cindex "queue" "summary"
 The &'exiqsumm'& utility is a Perl script which reads the output of &`exim
--bp`& and produces a summary of the messages on the queue. Thus, you use it by
+-bp`& and produces a summary of the messages in the queue. Thus, you use it by
 running a command such as
 .code
 exim -bp | exiqsumm
@@ -37097,11 +37580,11 @@ included in &'exigrep'&'s output without any additional lines. The usage is:
 .display
 &`exigrep [-t<`&&'n'&&`>] [-I] [-l] [-M] [-v] <`&&'pattern'&&`> [<`&&'log file'&&`>] ...`&
 .endd
-If no log file names are given on the command line, the standard input is read.
+If no log filenames are given on the command line, the standard input is read.
 
 The &%-t%& argument specifies a number of seconds. It adds an additional
 condition for message selection. Messages that are complete are shown only if
-they spent more than <&'n'&> seconds on the queue.
+they spent more than <&'n'&> seconds in the queue.
 
 By default, &'exigrep'& does case-insensitive matching. The &%-I%& option
 makes it case-sensitive. This may give a performance improvement when searching
@@ -37164,8 +37647,8 @@ overriding the script's default, which is to find the setting from Exim's
 configuration.
 .endlist
 
-Each time &'exicyclog'& is run the file names get &"shuffled down"& by one. If
-the main log file name is &_mainlog_& (the default) then when &'exicyclog'& is
+Each time &'exicyclog'& is run the filenames get &"shuffled down"& by one. If
+the main log filename is &_mainlog_& (the default) then when &'exicyclog'& is
 run &_mainlog_& becomes &_mainlog.01_&, the previous &_mainlog.01_& becomes
 &_mainlog.02_& and so on, up to the limit that is set in the script or by the
 &%-k%& option. Log files whose numbers exceed the limit are discarded. Reject
@@ -37194,8 +37677,8 @@ assuming you have used the name &"exim"& for the Exim user. You can run
 .cindex "&'eximstats'&"
 A Perl script called &'eximstats'& is provided for extracting statistical
 information from log files. The output is either plain text, or HTML.
-Exim log files are also supported by the &'Lire'& system produced by the
-LogReport Foundation &url(http://www.logreport.org).
+. --- 2018-09-07: LogReport's Lire appears to be dead; website is a Yahoo Japan
+. --- 404 error and everything else points to that.
 
 The &'eximstats'& script has been hacked about quite a bit over time. The
 latest version is the result of some extensive revision by Steve Campbell. A
@@ -37235,7 +37718,7 @@ least one address that failed.
 The remainder of the output is in sections that can be independently disabled
 or modified by various options. It consists of a summary of deliveries by
 transport, histograms of messages received and delivered per time interval
-(default per hour), information about the time messages spent on the queue,
+(default per hour), information about the time messages spent in the queue,
 a list of relayed messages, lists of the top fifty sending hosts, local
 senders, destination hosts, and destination local users by count and by volume,
 and a list of delivery errors that occurred.
@@ -37318,9 +37801,9 @@ well.
 
 .cindex "USE_DB"
 If the native DB interface is in use (USE_DB is set in a compile-time
-configuration file &-- this is common in free versions of Unix) the two file
-names must be different, because in this mode the Berkeley DB functions create
-a single output file using exactly the name given. For example,
+configuration file &-- this is common in free versions of Unix) the two
+filenames must be different, because in this mode the Berkeley DB functions
+create a single output file using exactly the name given. For example,
 .code
 exim_dbmbuild /etc/aliases /etc/aliases.db
 .endd
@@ -37332,7 +37815,7 @@ Unix), two files are used, with the suffixes &_.dir_& and &_.pag_&. In this
 environment, the suffixes are added to the second argument of
 &'exim_dbmbuild'&, so it can be the same as the first. This is also the case
 when the Berkeley functions are used in compatibility mode (though this is not
-recommended), because in that case it adds a &_.db_& suffix to the file name.
+recommended), because in that case it adds a &_.db_& suffix to the filename.
 
 If a duplicate key is encountered, the program outputs a warning, and when it
 finishes, its return code is 1 rather than zero, unless the &%-noduperr%&
@@ -37588,7 +38071,7 @@ default is to create a lock file and also to use &[fcntl()]& locking on the
 mailbox, which is the same as Exim's default. The use of &%-flock%& or
 &%-fcntl%& requires that the file be writeable; the use of &%-lockfile%&
 requires that the directory containing the file be writeable. Locking by lock
-file does not last for ever; Exim assumes that a lock file is expired if it is
+file does not last forever; Exim assumes that a lock file is expired if it is
 more than 30 minutes old.
 
 The &%-mbx%& option can be used with either or both of &%-fcntl%& or
@@ -37679,7 +38162,7 @@ Eximon*highlight: gray
 End
 .endd
 .cindex "admin user"
-In order to see the contents of messages on the queue, and to operate on them,
+In order to see the contents of messages in the queue, and to operate on them,
 &'eximon'& must either be run as root or by an admin user.
 
 The command-line parameters of &'eximon'& are passed to &_eximon.bin_& and may
@@ -37699,7 +38182,7 @@ different parts of the display.
 
 .section "The stripcharts" "SECID265"
 .cindex "stripchart"
-The first stripchart is always a count of messages on the queue. Its name can
+The first stripchart is always a count of messages in the queue. Its name can
 be configured by setting QUEUE_STRIPCHART_NAME in the
 &_Local/eximon.conf_& file. The remaining stripcharts are defined in the
 configuration script by regular expression matches on log file entries, making
@@ -37815,7 +38298,7 @@ window.
 .section "The queue display" "SECID268"
 .cindex "queue" "display in monitor"
 The bottom section of the monitor window contains a list of all messages that
-are on the queue, which includes those currently being received or delivered,
+are in the queue, which includes those currently being received or delivered,
 as well as those awaiting delivery. The size of this subwindow is controlled by
 parameters in the configuration file &_Local/eximon.conf_&, and the frequency
 at which it is updated is controlled by another parameter in the same file &--
@@ -37824,7 +38307,7 @@ there is an &"Update"& action button just above the display which can be used
 to force an update of the queue display at any time.
 
 When a host is down for some time, a lot of pending mail can build up for it,
-and this can make it hard to deal with other messages on the queue. To help
+and this can make it hard to deal with other messages in the queue. To help
 with this situation there is a button next to &"Update"& called &"Hide"&. If
 pressed, a dialogue box called &"Hide addresses ending with"& is put up. If you
 type anything in here and press &"Return"&, the text is added to a chain of
@@ -37845,7 +38328,7 @@ queue display to use in the dialogue box, you have to do the cutting before
 pressing the &"Hide"& button.
 
 The queue display contains, for each unhidden queued message, the length of
-time it has been on the queue, the size of the message, the message id, the
+time it has been in the queue, the size of the message, the message id, the
 message sender, and the first undelivered recipient, all on one line. If it is
 a bounce message, the sender is shown as &"<>"&. If there is more than one
 recipient to which the message has not yet been delivered, subsequent ones are
@@ -37893,7 +38376,7 @@ information and headers is displayed in a new text window. See chapter
 &'body'&: The contents of the spool file containing the body of the message are
 displayed in a new text window. There is a default limit of 20,000 bytes to the
 amount of data displayed. This can be changed by setting the BODY_MAX
-option at compile time, or the EXIMON_BODY_MAX option at run time.
+option at compile time, or the EXIMON_BODY_MAX option at runtime.
 .next
 &'deliver message'&: A call to Exim is made using the &%-M%& option to request
 delivery of the message. This causes an automatic thaw if the message is
@@ -37999,9 +38482,9 @@ penetrated the Exim (but not the root) account. These options are as follows:
 
 .ilist
 ALT_CONFIG_PREFIX can be set to a string that is required to match the
-start of any file names used with the &%-C%& option. When it is set, these file
-names are also not allowed to contain the sequence &"/../"&. (However, if the
-value of the &%-C%& option is identical to the value of CONFIGURE_FILE in
+start of any filenames used with the &%-C%& option. When it is set, these
+filenames are also not allowed to contain the sequence &"/../"&. (However, if
+the value of the &%-C%& option is identical to the value of CONFIGURE_FILE in
 &_Local/Makefile_&, Exim ignores &%-C%& and proceeds as usual.) There is no
 default setting for &%ALT_CONFIG_PREFIX%&.
 
@@ -38068,7 +38551,7 @@ receiving messages and delivering them externally over SMTP, and it is
 obviously more secure if Exim does not run as root except when necessary.
 For this reason, a user and group for Exim to use must be defined in
 &_Local/Makefile_&. These are known as &"the Exim user"& and &"the Exim
-group"&. Their values can be changed by the run time configuration, though this
+group"&. Their values can be changed by the runtime configuration, though this
 is not recommended. Often a user called &'exim'& is used, but some sites use
 &'mail'& or another user name altogether.
 
@@ -38482,6 +38965,12 @@ two files contains the final component of its own name as its first line. This
 is insurance against disk crashes where the directory is lost but the files
 themselves are recoverable.
 
+.new
+The file formats may be changed, or new formats added, at any release.
+Spool files are not intended as an interface to other programs
+and should not be used as such.
+.wen
+
 Some people are tempted into editing -D files in order to modify messages. You
 need to be extremely careful if you do this; it is not recommended and you are
 on your own if you do it. Here are some of the pitfalls:
@@ -38819,11 +39308,9 @@ linked to a domain which that entity controls.  It permits reputation to
 be tracked on a per-domain basis, rather than merely upon source IP address.
 DKIM is documented in RFC 6376.
 
-.new
 As DKIM relies on the message being unchanged in transit, messages handled
 by a mailing-list (which traditionally adds to the message) will not match
 any original DKIM signature.
-.wen
 
 DKIM support is compiled into Exim by default if TLS support is present.
 It can be disabled by setting DISABLE_DKIM=yes in &_Local/Makefile_&.
@@ -38844,7 +39331,6 @@ In typical Exim style, the verification implementation does not include any
 default "policy". Instead it enables you to build your own policy using
 Exim's standard controls.
 
-.new
 Please note that verification of DKIM signatures in incoming mail is turned
 on by default for logging (in the <= line) purposes.
 
@@ -38858,7 +39344,6 @@ signature status. Here is an example (with line-breaks added for clarity):
     c=relaxed/relaxed a=rsa-sha1
     i=@facebookmail.com t=1252484542 [verification succeeded]
 .endd
-.wen
 
 You might want to turn off DKIM verification processing entirely for internal
 or relay mail sources. To do that, set the &%dkim_disable_verify%& ACL
@@ -38870,7 +39355,6 @@ senders).
 .section "Signing outgoing messages" "SECDKIMSIGN"
 .cindex "DKIM" "signing"
 
-.new
 For signing to be usable you must have published a DKIM record in DNS.
 Note that RFC 8301 says:
 .code
@@ -38885,7 +39369,6 @@ in the DNS record is different between RSA and EC keys;
 for the former it is the base64 of the ASN.1 for the RSA public key
 (equivalent to the private-key .pem with the header/trailer stripped)
 but for EC keys it is the base64 of the pure key; no ASN.1 wrapping.
-.wen
 
 Signing is enabled by setting private options on the SMTP transport.
 These options take (expandable) strings as arguments.
@@ -38914,10 +39397,9 @@ You can use the &%$dkim_domain%& and
 The result can either
 .ilist
 be a valid RSA private key in ASCII armor (.pem file), including line breaks
-.new
 .next
-with GnuTLS 3.6.0 or later, be a valid Ed25519 private key (same format as above)
-.wen
+with GnuTLS 3.6.0 or OpenSSL 1.1.1 or later,
+be a valid Ed25519 private key (same format as above)
 .next
 start with a slash, in which case it is treated as a file that contains
 the private key
@@ -38927,7 +39409,21 @@ be signed. This case will not result in an error, even if &%dkim_strict%&
 is set.
 .endlist
 
-.new
+To generate keys under OpenSSL:
+.code
+openssl genrsa -out dkim_rsa.private 2048
+openssl rsa -in dkim_rsa.private -out /dev/stdout -pubout -outform PEM
+.endd
+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.
+
+Under GnuTLS:
+.code
+certtool --generate-privkey --rsa --bits=2048 --password='' -8 --outfile=dkim_rsa.private
+certtool --load-privkey=dkim_rsa.private --pubkey-info
+.endd
+
 Note that RFC 8301 says:
 .code
 Signers MUST use RSA keys of at least 1024 bits for all keys.
@@ -38942,18 +39438,38 @@ As they are a recent development, users should consider dual-signing
 for some transition period.
 The "_CRYPTO_SIGN_ED25519" macro will be defined if support is present
 for EC keys.
-.wen
+
+OpenSSL 1.1.1 and GnuTLS 3.6.0 can create Ed25519 private keys:
+.code
+openssl genpkey -algorithm ed25519 -out dkim_ed25519.private
+certtool --generate-privkey --key-type=ed25519 --outfile=dkim_ed25519.private
+.endd
+
+To produce the required public key value for a DNS record:
+.code
+openssl pkey -outform DER -pubout -in dkim_ed25519.private | tail -c +13 | base64
+certtool --load_privkey=dkim_ed25519.private --pubkey_info --outder | tail -c +13 | base64
+.endd
+
+Note that the format
+of Ed25519 keys in DNS has not yet been decided; this release supports
+both of the leading candidates at this time, a future release will
+probably drop support for whichever proposal loses.
 
 .option dkim_hash smtp string&!! sha256
-Can be set alternatively to &"sha1"& to use an alternate hash
-method.
+Can be set to any one of the supported hash methods, which are:
+.ilist
+&`sha1`& &-- should not be used, is old and insecure
+.next
+&`sha256`& &-- the default
+.next
+&`sha512`& &-- possibly more secure but less well supported
+.endlist
 
-.new
 Note that RFC 8301 says:
 .code
 rsa-sha1 MUST NOT be used for signing or verifying.
 .endd
-.wen
 
 .option dkim_identity smtp string&!! unset
 If set after expansion, the value is used to set an "i=" tag in
@@ -38966,7 +39482,7 @@ tag value.  Note that Exim does not check the value.
 This option sets the canonicalization method used when signing a message.
 The DKIM RFC currently supports two methods: "simple" and "relaxed".
 The option defaults to "relaxed" when unset. Note: the current implementation
-only supports using the same canonicalization method for both headers and body.
+only supports signing with the same canonicalization method for both headers and body.
 
 .option dkim_strict smtp string&!! unset
 This  option  defines  how  Exim  behaves  when  signing a message that
@@ -38996,19 +39512,41 @@ 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.
 
+.new
+.option dkim_timestamps smtp integer&!! unset
+This option controls the inclusion of timestamp information in the signature.
+If not set, no such information will be included.
+Otherwise, must be an unsigned number giving an offset in seconds from the current time
+for the expiry tag
+(eg. 1209600 for two weeks);
+both creation (t=) and expiry (x=) tags will be included.
+
+RFC 6376 lists these tags as RECOMMENDED.
+.wen
+
 
 .section "Verifying DKIM signatures in incoming mail" "SECDKIMVFY"
 .cindex "DKIM" "verification"
 
-Verification of DKIM signatures in SMTP incoming email is implemented via the
-&%acl_smtp_dkim%& ACL. By default, this ACL is called once for each
+.new
+Verification of DKIM signatures in SMTP incoming email is done for all
+messages for which an ACL control &%dkim_disable_verify%& has not been set.
+.cindex authentication "expansion item"
+Performing verification sets up information used by the
+&$authresults$& expansion item.
+.wen
+
+.new The results of that verification are then made available to the
+&%acl_smtp_dkim%& ACL, &new(which can examine and modify them).
+By default, this ACL is called once for each
 syntactically(!) correct signature in the incoming message.
 A missing ACL definition defaults to accept.
 If any ACL call does not accept, the message is not accepted.
 If a cutthrough delivery was in progress for the message, that is
 summarily dropped (having wasted the transmission effort).
 
-To evaluate the signature in the ACL a large number of expansion variables
+To evaluate the &new(verification result) in the ACL
+a large number of expansion variables
 containing the signature status and its details are set up during the
 runtime of the ACL.
 
@@ -39077,17 +39615,19 @@ This variable can be overwritten using an ACL 'set' modifier.
 This might, for instance, be done to enforce a policy restriction on
 hash-method or key-size:
 .code
-  warn condition =     ${if eq {$dkim_verify_status}{pass}}
-       condition =     ${if eq {$len_3:$dkim_algo}{rsa}}
-       condition =     ${if or {eq {$dkim_algo}{rsa-sha1}} \
-                               {< {$dkim_key_length}{1024}} }
-       logwrite =      NOTE: forcing dkim verify fail (was pass)
-       set dkim_verify_status = fail
-       set dkim_verify_reason = hash too weak or key too short
+  warn condition       = ${if eq {$dkim_verify_status}{pass}}
+       condition       = ${if eq {${length_3:$dkim_algo}}{rsa}}
+       condition       = ${if or {{eq {$dkim_algo}{rsa-sha1}} \
+                                  {< {$dkim_key_length}{1024}}}}
+       logwrite        = NOTE: forcing DKIM verify fail (was pass)
+       set dkim_verify_status = fail
+       set dkim_verify_reason = hash too weak or key too short
 .endd
 
-After all the DKIM ACL runs have completed, the value becomes a
+So long as a DKIM ACL is defined (it need do no more than accept),
+after all the DKIM ACL runs have completed, the value becomes a
 colon-separated list of the values after each run.
+This is maintained for the mime, prdr and data ACLs.
 
 .vitem &%$dkim_verify_reason%&
 A string giving a little bit more detail when &%$dkim_verify_status%& is either
@@ -39126,13 +39666,11 @@ The key record selector string.
 
 .vitem &%$dkim_algo%&
 The algorithm used. One of 'rsa-sha1' or 'rsa-sha256'.
-.new
-If running under GnuTLS 3.6.0 or later, may also be 'ed25519-sha256'.
+If running under GnuTLS 3.6.0 or OpenSSL 1.1.1 or later,
+may also be 'ed25519-sha256'.
 The "_CRYPTO_SIGN_ED25519" macro will be defined if support is present
 for EC keys.
-.wen
 
-.new
 Note that RFC 8301 says:
 .code
 rsa-sha1 MUST NOT be used for signing or verifying.
@@ -39143,7 +39681,6 @@ algorithms (currently, rsa-sha1) have permanently failed evaluation
 
 To enforce this you must have a DKIM ACL which checks this variable
 and overwrites the &$dkim_verify_status$& variable as discussed above.
-.wen
 
 .vitem &%$dkim_canon_body%&
 The body canonicalization method. One of 'relaxed' or 'simple'.
@@ -39162,6 +39699,12 @@ strict enforcement should code the check explicitly.
 The number of signed body bytes. If zero ("0"), the body is unsigned. If no
 limit was set by the signer, "9999999999999" is returned. This makes sure
 that this variable always expands to an integer value.
+.new
+&*Note:*& The presence of the signature tag specifying a signing body length
+is one possible route to spoofing of valid DKIM signatures.
+A paranoid implementation might wish to regard signature where this variable
+shows less than the "no limit" return as being invalid.
+.wen
 
 .vitem &%$dkim_created%&
 UNIX timestamp reflecting the date and time when the signature was created.
@@ -39172,9 +39715,7 @@ UNIX timestamp reflecting the date and time when the signer wants the
 signature to be treated as "expired". When this was not specified by the
 signer, "9999999999999" is returned. This makes it possible to do useful
 integer size comparisons against this value.
-.new
 Note that Exim does not check this value.
-.wen
 
 .vitem &%$dkim_headernames%&
 A colon-separated list of names of headers included in the signature.
@@ -39199,7 +39740,6 @@ Notes from the key record (tag n=).
 .vitem &%$dkim_key_length%&
 Number of bits in the key.
 
-.new
 Note that RFC 8301 says:
 .code
 Verifiers MUST NOT consider signatures using RSA keys of
@@ -39209,7 +39749,6 @@ less than 1024 bits as valid signatures.
 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.
-.wen
 
 .endlist
 
@@ -39253,24 +39792,28 @@ for more information of what they mean.
 
 
 
-.new
 .section "SPF (Sender Policy Framework)" SECSPF
 .cindex SPF verification
 
 SPF is a mechanism whereby a domain may assert which IP addresses may transmit
 messages with its domain in the envelope from, documented by RFC 7208.
 For more information on SPF see &url(http://www.openspf.org).
+. --- 2018-09-07: still not https
 
 Messages sent by a system not authorised will fail checking of such assertions.
 This includes retransmissions done by traditional forwarders.
 
 SPF verification support is built into Exim if SUPPORT_SPF=yes is set in
 &_Local/Makefile_&.  The support uses the &_libspf2_& library
-&url(http://www.libspf2.org/).
-There is no Exim involvement on the trasmission of messages; publishing certain
-DNS records is all that is required.
+&url(https://www.libspf2.org/).
+There is no Exim involvement in the transmission of messages;
+publishing certain DNS records is all that is required.
 
 For verification, an ACL condition and an expansion lookup are provided.
+.cindex authentication "expansion item"
+Performing verification sets up information used by the
+&$authresults$& expansion item.
+
 
 .cindex SPF "ACL condition"
 .cindex ACL "spf condition"
@@ -39300,18 +39843,11 @@ its domain as well.  This should be treated like "none".
 
 .vitem &%permerror%&
 This indicates a syntax error in the SPF record of the queried domain.
-You may deny messages when this occurs. (Changed in 4.83)
+You may deny messages when this occurs.
 
 .vitem &%temperror%&
 This indicates a temporary error during all processing, including Exim's
 SPF processing.  You may defer messages when this occurs.
-(Changed in 4.83)
-
-.vitem &%err_temp%&
-Same as permerror, deprecated in 4.83, will be removed in a future release.
-
-.vitem &%err_perm%&
-Same as temperror, deprecated in 4.83, will be removed in a future release.
 .endlist
 
 You can prefix each string with an exclamation mark to  invert
@@ -39359,6 +39895,11 @@ variables:
   one of pass, fail, softfail, none, neutral, permerror or
   temperror.
 
+.vitem &$spf_result_guessed$&
+.vindex &$spf_result_guessed$&
+  This boolean is true only if a best-guess operation was used
+  and required in order to obtain a result.
+
 .vitem &$spf_smtp_comment$&
 .vindex &$spf_smtp_comment$&
   This contains a string that can be used in a SMTP response
@@ -39375,6 +39916,7 @@ SPF, but it is supported by the same framework that enables SPF
 capability.
 Refer to &url(http://www.openspf.org/FAQ/Best_guess_record)
 for a description of what it means.
+. --- 2018-09-07: still not https:
 
 To access this feature, simply use the spf_guess condition in place
 of the spf one.  For example:
@@ -39413,13 +39955,11 @@ address as the key and an IP address as the database:
   ${lookup {username@domain} spf {ip.ip.ip.ip}}
 .endd
 
-The lookup will return the same result strings as they can appear in
+The lookup will return the same result strings as can appear in
 &$spf_result$& (pass,fail,softfail,neutral,none,err_perm,err_temp).
 Currently, only IPv4 addresses are supported.
 
 
-. wen-for SPF section
-.wen
 
 
 . ////////////////////////////////////////////////////////////////////////////
@@ -39445,10 +39985,8 @@ that uses &"Proxy Protocol"& to speak to it.
 To include this support, include &"SUPPORT_PROXY=yes"&
 in Local/Makefile.
 
-It was built on specifications from:
-(&url(http://haproxy.1wt.eu/download/1.5/doc/proxy-protocol.txt)).
-That URL was revised in May 2014 to version 2 spec:
-(&url(http://git.1wt.eu/web?p=haproxy.git;a=commitdiff;h=afb768340c9d7e50d8e)).
+It was built on the HAProxy specification, found at
+&url(https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt).
 
 The purpose of this facility is so that an application load balancer,
 such as HAProxy, can sit in front of several Exim servers
@@ -39635,9 +40173,7 @@ ${utf8_localpart_from_alabel:str}
 
 .cindex utf8 "address downconversion"
 .cindex i18n "utf8 address downconversion"
-.new
 The RCPT ACL
-.wen
 may use the following modifier:
 .display
 control = utf8_downconvert
@@ -39656,6 +40192,12 @@ If a value is appended it may be:
 If mua_wrapper is set, the utf8_downconvert control
 is initially set to -1.
 
+.new
+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.
+.wen
+
 
 There is no explicit support for VRFY and EXPN.
 Configurations supporting these should inspect
@@ -39777,6 +40319,8 @@ with the event type:
 .display
 &`dane:fail            `& failure reason
 &`msg:delivery         `& smtp confirmation message
+&`msg:fail:internal    `& failure reason
+&`msg:fail:delivery    `& smtp error message
 &`msg:rcpt:host:defer  `& error string
 &`msg:rcpt:defer       `& error string
 &`msg:host:defer       `& error string
@@ -39860,6 +40404,9 @@ Edit &_Makefile_& in the appropriate sub-directory (&_src/routers_&,
 &_src/transports_&, &_src/auths_&, or &_src/lookups_&); add a line for the new
 driver or lookup type and add it to the definition of OBJ.
 .next
+Edit &_OS/Makefile-Base_& adding a &_.o_& file for the predefined-macros, to the
+definition of OBJ_MACRO.  Add a set of line to do the compile also.
+.next
 Create &_newdriver.h_& and &_newdriver.c_& in the appropriate sub-directory of
 &_src_&.
 .next