X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/4fe4d0b16321e3af984c3e595aaafbf60a0d0259..e0574cb59a15a54466beb2f30eb016ced390bf39:/doc/doc-docbook/spec.xfpt?ds=inline diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 814afc1eb..ff945eebd 100644 --- a/doc/doc-docbook/spec.xfpt +++ b/doc/doc-docbook/spec.xfpt @@ -45,7 +45,7 @@ . 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)" @@ -448,12 +448,9 @@ available in other formats (HTML, PostScript, PDF, and Texinfo). Section .section "FTP and web sites" "SECID2" .cindex "web site" .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" @@ -462,12 +459,14 @@ differently formatted versions of the documentation. A recent addition to the online information is the Exim wiki (&url(http://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" @@ -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 "HTTPS download site" .cindex "distribution" "ftp site" -The master ftp site for the Exim distribution is +.cindex "distribution" "https site" +The master distribution site for the Exim distribution is .display -&*ftp://ftp.exim.org/pub/exim*& +&*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 &'https://downloads.exim.org/'& is identical to the +content served at &'https://ftp.exim.org/pub/exim'& and +&'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" @@ -538,17 +552,14 @@ 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, 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 time of 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 @@ -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" @@ -3162,10 +3173,8 @@ 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 " form, if no such macro is found the exit status will be nonzero. -.wen .vitem &%-bp%& .oindex "&%-bp%&" @@ -3838,7 +3847,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%& @@ -3957,8 +3966,17 @@ 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. +. .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 @@ -7839,18 +7857,16 @@ ${lookup redis{set keyname ${quote_redis:objvalue plus}}} ${lookup redis{get keyname}} .endd -.new 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 +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. -.wen .ecindex IIDfidalo1 .ecindex IIDfidalo2 @@ -9150,7 +9166,6 @@ 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:" @@ -9159,8 +9174,8 @@ 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 @@ -9173,8 +9188,7 @@ Example use (as an ACL modifier): .code add_header = :at_start:${authresults {$primary_hostname}} .endd -This is safe even if no authentication reselts are available. -.wen +This is safe even if no authentication results are available. .vitem "&*${certextract{*&<&'field'&>&*}{*&<&'certificate'&>&*}&&& @@ -9429,11 +9443,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" @@ -9446,7 +9463,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 @@ -9454,6 +9471,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 @@ -9611,9 +9637,10 @@ some of the braces: .code ${length_:} .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'&>&*}&&& @@ -9861,15 +9888,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: @@ -10034,6 +10072,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'&>&*}}*& @@ -10090,11 +10130,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 @@ -10111,7 +10151,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 @@ -10120,13 +10160,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 @@ -10137,6 +10179,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 @@ -10156,6 +10201,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" @@ -10199,7 +10246,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?= }' @@ -10208,6 +10255,8 @@ user@example.com Last:user@example.com # exim -be '${addresses:From: "Last, First" }' user@example.com +# exim -be '${addresses:フィル <フィリップ@example.jp>}' +フィリップ@example.jp .endd .vitem &*${base32:*&<&'digits'&>&*}*& @@ -10397,7 +10446,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. @@ -10439,6 +10488,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" @@ -10452,6 +10502,7 @@ ${length{}{}} 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'&>&*}*& @@ -10479,6 +10530,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'&>&*}*& @@ -10561,6 +10613,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" @@ -10690,10 +10746,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'&>&*}*& @@ -10726,6 +10780,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'&>&*}*& @@ -10740,6 +10795,7 @@ ${substr{}{}{}} .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" @@ -10762,6 +10818,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" @@ -10770,6 +10827,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'&>&*}*&" &&& @@ -10992,7 +11063,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" @@ -11055,6 +11127,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'&>&*}*& @@ -11066,6 +11139,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'&>&*}*& @@ -11074,6 +11148,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: @@ -11140,6 +11215,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'&>&*}*& @@ -11151,6 +11227,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'&>&*}*& @@ -11177,6 +11254,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 @@ -11600,10 +11679,8 @@ 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. -.new This second case also sets up inforamtion used by the &$authresults$& expansion item. -.wen .vitem &$authenticated_fail_id$& .cindex "authentication" "fail" "id" @@ -11943,11 +12020,9 @@ 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$&. -.new .cindex authentication "expansion item" Performing these checks sets up information used by the &$authresults$& expansion item. -.wen .vitem &$host_lookup_failed$& @@ -12901,7 +12976,6 @@ A number of variables whose names start with &$spam$& are available when Exim is compiled with the content-scanning extension. For details, see section &<>&. -.new .vitem &$spf_header_comment$& &&& &$spf_received$& &&& &$spf_result$& &&& @@ -12909,7 +12983,6 @@ is compiled with the content-scanning extension. For details, see section &$spf_smtp_comment$& These variables are only available if Exim is built with SPF support. For details see section &<>&. -.wen .vitem &$spool_directory$& .vindex "&$spool_directory$&" @@ -12972,7 +13045,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$& @@ -13863,6 +13937,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" @@ -14765,6 +14840,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 &<>&. +.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" @@ -15084,7 +15172,7 @@ 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/_&. @@ -16906,11 +16994,9 @@ See section &<>& 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 &<>& for more details. -.wen @@ -16966,10 +17052,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: @@ -16982,7 +17068,7 @@ $body_zerocount Users of the local_scan() API (see &<>&), 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). @@ -17212,7 +17298,8 @@ 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. -&*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 @@ -17232,13 +17319,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 &<>& for discussion of when this option might be re-expanded. @@ -17365,18 +17450,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 &<>&. @@ -18832,9 +18915,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. @@ -18967,7 +19048,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" @@ -18983,7 +19063,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" @@ -19610,12 +19689,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: @@ -23941,20 +24018,37 @@ For testing purposes, this value can be overridden by the &%-oB%& command line option. +.option dane_require_tls_ciphers smtp string&!! unset +.cindex "TLS" "requiring specific ciphers for DANE" +.cindex "cipher" "requiring specific" +.cindex DANE "TLS ciphers" +This option may be used to override &%tls_require_ciphers%& for connections +where DANE has been determined to be in effect. +If not set, then &%tls_require_ciphers%& will be used. +Normal SMTP delivery is not able to make strong demands of TLS cipher +configuration, because delivery will fall back to plaintext. Once DANE has +been determined to be in effect, there is no plaintext fallback and making the +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. + + .option data_timeout smtp time 5m This sets a timeout for the transmission of each block in the data portion of 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 &<>&. @@ -24262,7 +24356,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" @@ -24271,7 +24364,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 &<>&. -.wen .option hosts_require_ocsp smtp "host list&!!" unset .cindex "TLS" "requiring for certain servers" @@ -24302,7 +24394,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" @@ -24312,7 +24403,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 &<>&. -.wen .option hosts_try_fastopen smtp "host list&!!" unset .cindex "fast open, TCP" "enabling, in client" @@ -24670,6 +24760,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 &<>&. +.wen + @@ -26119,11 +26219,9 @@ 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. -.new .cindex authentication "expansion item" Successful authentication sets up information used by the &$authresults$& expansion item. -.wen @@ -26217,8 +26315,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. @@ -26745,7 +26843,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: @@ -26795,15 +26893,17 @@ without code changes in Exim. .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 @@ -26811,7 +26911,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" @@ -27211,7 +27315,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 @@ -27222,8 +27326,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%& @@ -27393,7 +27497,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 @@ -27458,6 +27565,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" @@ -28076,7 +28195,6 @@ Open-source PKI book, available online at -.new .section DANE "SECDANE" .cindex DANE DNS-based Authentication of Named Entities, as applied to SMTP over TLS, provides assurance to a client that @@ -28102,25 +28220,55 @@ that DNS lookups they do for the server have not been tampered with. The domain to this server, its A record, its TLSA record and any associated CNAME records must all be covered by DNSSEC. 2) add TLSA DNS records. These say what the server certificate for a TLS connection should be. -3) offer a server certificate, or certificate chain, in TLS connections which is traceable to the one -defined by (one of?) the TSLA records +3) offer a server certificate, or certificate chain, in TLS connections which is is anchored by one of the TLSA records. There are no changes to Exim specific to server-side operation of DANE. Support for client-side operation of DANE can be included at compile time by defining SUPPORT_DANE=yes 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 cerver 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). @@ -28138,6 +28286,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: @@ -28158,8 +28316,9 @@ This modification of hosts_request_ocsp is only done if it has the default value those who use &%hosts_require_ocsp%&, should consider the interaction with DANE in their OCSP settings. -For client-side DANE there are two new smtp transport options, &%hosts_try_dane%& and &%hosts_require_dane%&. -The latter variant will result in failure if the target host is not DNSSEC-secured. +For client-side DANE there are three new smtp transport options, &%hosts_try_dane%&, &%hosts_require_dane%& +and &%dane_require_tls_ciphers%&. +The require variant will result in failure if the target host is not DNSSEC-secured. DANE will only be usable if the target host has DNSSEC-secured MX, A and TLSA records. @@ -28168,6 +28327,14 @@ If a TLSA lookup is done and succeeds, a DANE-verified TLS connection will be required for the host. If it does not, the host will not be used; there is no fallback to non-DANE or non-TLS. +If DANE is requested and usable, then the TLS cipher list configuration +prefers to use the option &%dane_require_tls_ciphers%& and falls +back to &%tls_require_ciphers%& only if that is unset. +This lets you configure "decent crypto" for DANE and "better than nothing +crypto" as the default. Note though that while GnuTLS lets the string control +which versions of TLS/SSL will be negotiated, OpenSSL does not and you're +limited to ciphersuite constraints. + If DANE is requested and useable (see above) the following transport options are ignored: .code hosts_require_tls @@ -28199,7 +28366,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). @@ -29413,7 +29601,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. @@ -29822,9 +30010,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 @@ -30712,7 +30901,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 = \ @@ -30730,7 +30919,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 : \ @@ -30941,13 +31130,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 @@ -31118,6 +31309,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 + @@ -31832,9 +32032,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 &<>&) 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%& @@ -31848,11 +32046,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 @@ -31869,8 +32076,9 @@ $ 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" @@ -31921,7 +32129,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. @@ -32003,7 +32211,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" @@ -32700,10 +32908,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 @@ -36350,8 +36563,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 offered or used &`M8S `& 8BITMIME status for incoming message &`P `& on &`<=`& lines: protocol used &` `& on &`=>`& and &`**`& lines: return path @@ -36415,11 +36629,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 @@ -36464,7 +36676,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, advertisement on <= lines, use on => 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 @@ -36555,7 +36769,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 @@ -36564,7 +36777,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" @@ -36667,6 +36879,12 @@ 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 +.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". +.next .cindex "log" "queue run" .cindex "queue runner" "logging" &%queue_run%&: The start and end of every queue run are logged. @@ -36686,14 +36904,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 @@ -36851,10 +37067,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" @@ -38490,6 +38704,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: @@ -38827,11 +39047,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_&. @@ -38852,7 +39070,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. @@ -38866,7 +39083,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 @@ -38878,7 +39094,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 @@ -38893,7 +39108,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. @@ -38922,11 +39136,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 OpenSSL 1.1.1 or later, be a valid Ed25519 private key (same format as above) -.wen .next start with a slash, in which case it is treated as a file that contains the private key @@ -38936,7 +39148,6 @@ 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 @@ -38978,18 +39189,26 @@ To produce the required public key value for a DNS record: 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 -.wen + +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 @@ -39002,7 +39221,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 @@ -39032,28 +39251,44 @@ 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. -.new -.cindex authentication "expansion item" -Performing verification sets up information used by the -&$authresults$& expansion item. -.wen - Calling the ACL only for existing signatures is not sufficient to build more advanced policies. For that reason, the global option &%dkim_verify_signers%&, and a global expansion variable @@ -39119,17 +39354,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 @@ -39168,14 +39405,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 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. @@ -39186,7 +39420,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'. @@ -39205,6 +39438,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. @@ -39215,9 +39454,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. @@ -39242,7 +39479,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 @@ -39252,7 +39488,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 @@ -39296,7 +39531,6 @@ for more information of what they mean. -.new .section "SPF (Sender Policy Framework)" SECSPF .cindex SPF verification @@ -39310,15 +39544,13 @@ 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. +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. -.new .cindex authentication "expansion item" Performing verification sets up information used by the &$authresults$& expansion item. -.wen .cindex SPF "ACL condition" @@ -39349,18 +39581,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 @@ -39467,13 +39692,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 . //////////////////////////////////////////////////////////////////////////// @@ -39689,9 +39912,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 @@ -39710,6 +39931,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