X-Git-Url: https://git.exim.org/users/jgh/exim.git/blobdiff_plain/20f0f78891ed20b57218dbf416ab584900a60b54..e41242f9612adaedadd5f3607b202f32ca086b4f:/doc/doc-docbook/spec.xfpt?ds=inline diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt index 50c110f3d..37ada7514 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.91" +.set previousversion "4.92" .include ./local_params .set ACL "access control lists (ACLs)" @@ -371,13 +371,11 @@ contributors. .section "Exim documentation" "SECID1" . Keep this example change bar when updating the documentation! -.new .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 this document; this paragraph is so marked if the rendition is capable of showing a change indicator. -.wen This document is very much a reference manual; it is not a tutorial. The reader is expected to have some familiarity with the SMTP mail transfer protocol and @@ -2628,6 +2626,7 @@ supplementary group is one of those listed in the &%trusted_groups%& configuration option. Note that the Exim group is not automatically trusted. .cindex '&"From"& line' +.cindex "envelope from" .cindex "envelope sender" Trusted users are always permitted to use the &%-f%& option or a leading &"From&~"& line to specify the envelope sender of a message that is passed to @@ -2768,6 +2767,8 @@ used to specify a path on the command line if a pid file is required. The SIGHUP signal .cindex "SIGHUP" .cindex "daemon" "restarting" +.cindex signal "to reload configuration" +.cindex daemon "reload configuration" can be used to cause the daemon to re-execute itself. This should be done whenever Exim's configuration file, or any file that is incorporated into it by means of the &%.include%& facility, is changed, and also whenever a new version @@ -2877,6 +2878,7 @@ separate document entitled &'Exim's interfaces to mail filtering'&. When testing a filter file, .cindex "&""From""& line" +.cindex "envelope from" .cindex "envelope sender" .oindex "&%-f%&" "for filter testing" the envelope sender can be set by the &%-f%& option, @@ -3661,14 +3663,12 @@ 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. @@ -3719,6 +3719,7 @@ between &%-F%& and the <&'string'&> is optional. .cindex "sender" "address" .cindex "address" "sender" .cindex "trusted users" +.cindex "envelope from" .cindex "envelope sender" .cindex "user" "trusted" This option sets the address of the envelope sender of a locally-generated @@ -6257,6 +6258,9 @@ remote_smtp: 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. @@ -6265,6 +6269,11 @@ 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 &<>& 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. @@ -6299,6 +6308,9 @@ smarthost_smtp: 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 @@ -6318,6 +6330,9 @@ 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: driver = appendfile @@ -6731,6 +6746,31 @@ lookup types support only literal keys. &*Warning 2*&: In a host list, you must always use &(net-iplsearch)& so that the implicit key is the host's IP address rather than its name (see section &<>&). + +.new +&*Warning 3*&: Do not use an IPv4-mapped IPv6 address for a key; use the +IPv4, in dotted-quad form. (Exim converts IPv4-mapped IPv6 addresses to this +notation before executing the lookup.) +.wen +.next +.new +.cindex lookup json +.cindex json "lookup type" +.cindex JSON expansions +&(json)&: The given file is a text file with a JSON structure. +An element of the structure is extracted, defined by the search key. +The key is a list of subelement selectors +(colon-separated by default but changeable in the usual way) +which are applied in turn to select smaller and smaller portions +of the JSON structure. +If a selector is numeric, it must apply to a JSON array; the (zero-based) +nunbered array element is selected. +Otherwise it must apply to a JSON object; the named element is selected. +The final resulting element can be a simple JSON type or a JSON object +or array; for the latter two a string-representation os the JSON +is returned. +For elements of type string, the returned value is de-quoted. +.wen .next .cindex "linear search" .cindex "lookup" "lsearch" @@ -8649,8 +8689,12 @@ to quote keys was made available in &(lsearch)& files. However, the more recently implemented &(iplsearch)& files do require colons in IPv6 keys (notated using the quoting facility) so as to distinguish them from IPv4 keys. For this reason, when the lookup type is &(iplsearch)&, IPv6 addresses are -converted using colons and not dots. In all cases, full, unabbreviated IPv6 +converted using colons and not dots. +.new +In all cases except IPv4-mapped IPv6, full, unabbreviated IPv6 addresses are always used. +The latter are converted to IPv4 addresses, in dotted-quad form. +.wen Ideally, it would be nice to tidy up this anomalous situation by changing to colons in all cases, given that quoting is now available for &(lsearch)&. @@ -9159,6 +9203,7 @@ 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 +.cindex expansion "string concatenation" when a dollar or backslash character is encountered. A dollar specifies the start of a portion of the string that is interpreted and replaced as described below in section &<>& onwards. Backslash is used as an @@ -9507,8 +9552,9 @@ ${extract{Z}{A=... B=...}{$value} fail } This forces an expansion failure (see section &<>&); {<&'string2'&>} must be present for &"fail"& to be recognized. -.new .vitem "&*${extract json{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&& + {*&<&'string3'&>&*}}*&" &&& + "&*${extract jsons{*&<&'key'&>&*}{*&<&'string1'&>&*}{*&<&'string2'&>&*}&&& {*&<&'string3'&>&*}}*&" .cindex "expansion" "extracting from JSON object" .cindex JSON expansions @@ -9523,10 +9569,16 @@ The expanded <&'string1'&> must be of the form: 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. +For the &"json"& variant, +if a returned value is a JSON string, it retains its leading and +trailing quotes. +.new +For the &"jsons"& variant, which is intended for use with JSON strings, the +leading and trailing quotes are removed from the returned value. +.wen . XXX should be a UTF-8 compare The results of matching are handled as above. -.wen .vitem "&*${extract{*&<&'number'&>&*}{*&<&'separators'&>&*}&&& @@ -9560,8 +9612,9 @@ yields &"99"&. Two successive separators mean that the field between them is empty (for example, the fifth field above). -.new -.vitem "&*${extract json{*&<&'number'&>&*}}&&& +.vitem "&*${extract json {*&<&'number'&>&*}}&&& + {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&" &&& + "&*${extract jsons{*&<&'number'&>&*}}&&& {*&<&'string1'&>&*}{*&<&'string2'&>&*}{*&<&'string3'&>&*}}*&" .cindex "expansion" "extracting from JSON array" .cindex JSON expansions @@ -9570,6 +9623,12 @@ 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. +For the &"json"& variant, +if a returned value is a JSON string, it retains its leading and +trailing quotes. +.new +For the &"jsons"& variant, which is intended for use with JSON strings, the +leading and trailing quotes are removed from the returned value. .wen @@ -9578,7 +9637,8 @@ there is no choice of field separator. .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 (&<>&). +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 @@ -9835,7 +9895,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 (&<>&). The first field of the list is numbered one. If the number is negative, the fields are @@ -9929,7 +9989,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 (&<>&). +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 @@ -10081,14 +10142,12 @@ 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 @@ -10134,7 +10193,8 @@ 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 (&<>&). +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 them. The result of that expansion is assigned to &$value$& before the next @@ -10263,7 +10323,7 @@ rather than any Unicode-aware character handling. .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 (&<>&). 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. @@ -10900,11 +10960,15 @@ If the string is a single variable of type certificate, returns the SHA-1 hash fingerprint of the certificate. -.vitem &*${sha256:*&<&'string'&>&*}*& +.vitem &*${sha256:*&<&'string'&>&*}*& &&& + &*${sha2:*&<&'string'&>&*}*& &&& + &*${sha2_:*&<&'string'&>&*}*& .cindex "SHA-256 hash" +.cindex "SHA-2 hash" .cindex certificate fingerprint .cindex "expansion" "SHA-256 hashing" .cindex "&%sha256%& expansion item" +.cindex "&%sha2%& expansion item" The &%sha256%& operator computes the SHA-256 hash value of the string and returns it as a 64-digit hexadecimal number, in which any letters are in upper case. @@ -10912,6 +10976,15 @@ it as a 64-digit hexadecimal number, in which any letters are in upper case. If the string is a single variable of type certificate, returns the SHA-256 hash fingerprint of the certificate. +.new +The operator can also be spelled &%sha2%& and does the same as &%sha256%& +(except for certificates, which are not supported). +Finally, if an underbar +and a number is appended it specifies the output length, selecting a +member of the SHA-2 family of hash functions. +Values of 256, 384 and 512 are accepted, with 256 being the default. +.wen + .vitem &*${sha3:*&<&'string'&>&*}*& &&& &*${sha3_:*&<&'string'&>&*}*& @@ -11009,7 +11082,6 @@ Case is defined per the system C locale. .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, @@ -11022,7 +11094,6 @@ 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'&>&*}*&" &&& @@ -11274,7 +11345,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 (&<>&). +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 @@ -11298,6 +11370,25 @@ being processed, to enable these expansion items to be nested. To scan a named list, expand it with the &*listnamed*& operator. +.new +.vitem "&*forall_json{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" &&& + "&*forany_json{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" &&& + "&*forall_jsons{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" &&& + "&*forany_jsons{*&<&'a JSON array'&>&*}{*&<&'a condition'&>&*}*&" +.cindex JSON "iterative conditions" +.cindex JSON expansions +.cindex expansion "&*forall_json*& condition" +.cindex expansion "&*forany_json*& condition" +.cindex expansion "&*forall_jsons*& condition" +.cindex expansion "&*forany_jsons*& condition" +As for the above, except that the first argument must, after expansion, +be a JSON array. +The array separator is not changeable. +For the &"jsons"& variants the elements are expected to be JSON strings +and have their quotes removed before the evaluation of the condition. +.wen + + .vitem &*ge&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*& &&& &*gei&~{*&<&'string1'&>&*}{*&<&'string2'&>&*}*& @@ -12108,6 +12199,7 @@ This variable contains the version string of the Exim build. The first character is a major version number, currently 4. Then after a dot, the next group of digits is a minor version number. There may be other characters following the minor version. +This value may be overridden by the &%exim_version%& main config option. .vitem &$header_$&<&'name'&> This is not strictly an expansion variable. It is expansion syntax for @@ -12667,6 +12759,16 @@ or if not set, the value of &$qualify_domain$&. .cindex queues named The name of the spool queue in use; empty for the default queue. +.new +.vitem &$r_...$& +.vindex &$r_...$& +.cindex router variables +Values can be placed in these variables by the &%set%& option of a router. +They can be given any name that starts with &$r_$&. +The values persist for the address being handled through subsequent routers +and the eventual transport. +.wen + .vitem &$rcpt_count$& .vindex "&$rcpt_count$&" When a message is being received by SMTP, this variable contains the number of @@ -13285,6 +13387,12 @@ The deprecated &$tls_cipher$& variable is the same as &$tls_in_cipher$& during m but in the context of an outward SMTP delivery taking place via the &(smtp)& transport becomes the same as &$tls_out_cipher$&. +.new +.vitem &$tls_in_cipher_std$& +.vindex "&$tls_in_cipher_std$&" +As above, but returning the RFC standard name for the cipher suite. +.wen + .vitem &$tls_out_cipher$& .vindex "&$tls_out_cipher$&" This variable is @@ -13293,6 +13401,12 @@ and then set to the outgoing cipher suite if one is negotiated. See chapter &<>& for details of TLS support and chapter &<>& for details of the &(smtp)& transport. +,new +.vitem &$tls_out_cipher_std$& +.vindex "&$tls_out_cipher_std$&" +As above, but returning the RFC standard name for the cipher suite. +.wen + .vitem &$tls_out_dane$& .vindex &$tls_out_dane$& DANE active status. See section &<>&. @@ -13427,7 +13541,8 @@ Otherwise, empty. .vitem &$version_number$& .vindex "&$version_number$&" -The version number of Exim. +The version number of Exim. Same as &$exim_version$&, may be overridden +by the &%exim_version%& main config option. .vitem &$warn_message_delay$& .vindex "&$warn_message_delay$&" @@ -13654,7 +13769,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 &<>&. When IPv6 addresses are involved, +described in section &<>&. When IPv6 addresses are involved, it is usually best to change the separator to avoid having to double all the colons. For example: .code @@ -13721,7 +13836,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 (&<>&) 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 @@ -14265,6 +14381,7 @@ See also the &'Policy controls'& section above. .row &%ignore_fromline_hosts%& "allow &""From ""& from these hosts" .row &%ignore_fromline_local%& "allow &""From ""& from local SMTP" .row &%pipelining_advertise_hosts%& "advertise pipelining to these hosts" +.row &%pipelining_connect_advertise_hosts%& "advertise pipelining to these hosts" .row &%prdr_enable%& "advertise PRDR to all hosts" .row &%smtputf8_advertise_hosts%& "advertise SMTPUTF8 to these hosts" .row &%tls_advertise_hosts%& "advertise TLS to these hosts" @@ -15021,7 +15138,6 @@ 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 @@ -15032,7 +15148,6 @@ 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 @@ -15057,6 +15172,11 @@ domain matches this list. This is a fudge to help with name servers that give big delays or otherwise do not work for the AAAA record type. In due course, when the world's name servers have all been upgraded, there should be no need for this option. +.new +Note that all lookups, including those done for verification, are affected; +this will result in verify failure for IPv6 connections or ones using names +only valid for IPv6 addresses. +.wen .option dns_retrans main time 0s @@ -15259,6 +15379,14 @@ not also supplied, the gid is taken from the result of &[getpwnam()]& if it is used. See chapter &<>& for a discussion of security issues. +.option exim_version main string "current version" +.cindex "Exim version" +.cindex customizing "version number" +.cindex "version number of Exim" override +This option allows to override the &$version_number$&/&$exim_version$& Exim reports in +various places. Use with care, this may fool stupid security scanners. + + .option extra_local_interfaces main "string list" unset This option defines network interfaces that are to be considered local when routing, but which are not used for listening by the daemon. See section @@ -15778,6 +15906,7 @@ and no &'Sender:'& header is ever added. If, in addition, you want to retain &'Sender:'& header lines supplied by untrusted users, you must also set &%local_sender_retain%& to be true. +.cindex "envelope from" .cindex "envelope sender" These options affect only the header lines in the message. The envelope sender is still forced to be the login id at the qualify domain unless @@ -16084,7 +16213,7 @@ harm. This option overrides the &%pipe_as_creator%& option of the &(pipe)& transport driver. -.option openssl_options main "string list" "+no_sslv2 +single_dh_use +no_ticket" +.option openssl_options main "string list" "+no_sslv2 +no_sslv3 +single_dh_use +no_ticket" .cindex "OpenSSL "compatibility options" This option allows an administrator to adjust the SSL options applied by OpenSSL to connections. It is given as a space-separated list of items, @@ -16264,6 +16393,19 @@ for each SMTP command and response. When PIPELINING is advertised, Exim assumes that clients will use it; &"out of order"& commands that are &"expected"& do not count as protocol errors (see &%smtp_max_synprot_errors%&). +.new +.option pipelining_connect_advertise_hosts main "host list&!!" * +.cindex "pipelining" "early connection" +.cindex "pipelining" PIPE_CONNECT +If Exim is built with the SUPPORT_PIPE_CONNECT build option +this option controls which hosts the facility is advertised to +and from which pipeline early-connection (before MAIL) SMTP +commands are acceptable. +When used, the pipelining saves on roundtrip times. + +Currently the option name &"X_PIPE_CONNECT"& is used. +.wen + .option prdr_enable main boolean false .cindex "PRDR" "enabling on server" @@ -16524,23 +16666,26 @@ on at the end (preceded by a semicolon). The string is expanded each time it is used. If the expansion yields an empty string, no &'Received:'& header line is added to the message. Otherwise, the string should start with the text &"Received:"& and conform to the RFC 2822 specification for &'Received:'& -header lines. The default setting is: +header lines. +.new +The default setting is: .code received_header_text = Received: \ ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\ - {${if def:sender_ident \ - {from ${quote_local_part:$sender_ident} }}\ - ${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\ + {${if def:sender_ident \ + {from ${quote_local_part:$sender_ident} }}\ + ${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\ by $primary_hostname \ - ${if def:received_protocol {with $received_protocol}} \ - ${if def:tls_in_cipher {($tls_in_cipher)\n\t}}\ + ${if def:received_protocol {with $received_protocol }}\ + ${if def:tls_in_cipher_std { tls $tls_in_cipher_std\n\t}}\ (Exim $version_number)\n\t\ ${if def:sender_address \ {(envelope-from <$sender_address>)\n\t}}\ id $message_exim_id\ ${if def:received_for {\n\tfor $received_for}} .endd +.wen The reference to the TLS cipher is omitted when Exim is built without TLS support. The use of conditional expansions ensures that this works for both @@ -17477,7 +17622,7 @@ 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 (&<>&) to avoid confusion under IPv6. &*Note*&: Under versions of OpenSSL preceding 1.1.1, when a list of more than one @@ -17792,6 +17937,7 @@ See &%unknown_login%&. .cindex "sender" "setting by untrusted user" .cindex "untrusted user setting sender" .cindex "user" "untrusted setting sender" +.cindex "envelope from" .cindex "envelope sender" When an untrusted user submits a message to Exim using the standard input, Exim normally creates an envelope sender address from the user's login and the @@ -17942,6 +18088,10 @@ file = ${extract{mailbox}{$address_data}} This makes the configuration file less messy, and also reduces the number of lookups (though Exim does cache lookups). +.new +See also the &%set%& option below. +.wen + .vindex "&$sender_address_data$&" .vindex "&$address_data$&" The &%address_data%& facility is also useful as a means of passing information @@ -18194,6 +18344,7 @@ Not effective on redirect routers. .option errors_to routers string&!! unset +.cindex "envelope from" .cindex "envelope sender" .cindex "router" "changing address for errors" If a router successfully handles an address, it may assign the address to a @@ -18282,7 +18433,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 &<>&), and a port can be specified with +changed (see section &<>&), 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 &<>&). @@ -18314,7 +18465,7 @@ and the discussion in chapter &<>&. .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 &<>&), 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 @@ -18352,7 +18503,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 &<>&), 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 @@ -18635,7 +18786,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 +(&<>&). If any expansion is forced to fail, the item is ignored. Other expansion failures cause routing of the address to be deferred. @@ -18854,6 +19006,33 @@ SMTP VRFY command is enabled, it must be used after MAIL if the sender address matters. +.new +.option set routers "string list" unset +.cindex router variables +This option may be used multiple times on a router; +because of this the list aspect is mostly irrelevant. +The list separator is a colon but can be changed in the +usual way. + +Each list-element given must be of the form $"name = value"$ +and the names used must start with the string &"r_"&. +Values containing colons should either have them doubled, or +the entire list should be prefixed with a list-separator change. +When a router runs, the strings are evaluated in order, +to create variables which are added to the set associated with +the address. +The variable is set with the expansion of the value. +The variables can be used by the router options +(not including any preconditions) +and by the transport. +Later definitions of a given named variable will override former ones. +Varible use is via the usual &$r_...$& syntax. + +This is similar to the &%address_data%& option, except that +many independent variables can be used, with choice of naming. +.wen + + .option translate_ip_address routers string&!! unset .cindex "IP address" "translating" .cindex "packet radio" @@ -19737,7 +19916,7 @@ 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 &<>&. +as described in section &<>&. If the list of hosts was obtained from a &%route_list%& item, the following variables are set during its expansion: @@ -21462,7 +21641,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 &<>&), which are (separately) expanded and added to the header portion of a message as it is transported, as described in section &<>&. Additional header lines can also be specified by @@ -21488,7 +21667,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 &<>&); these headers are omitted from the message as it is transported, as described in section &<>&. Header removal can also be specified by routers. @@ -21639,6 +21818,7 @@ on a remote transport in the current implementation. .option return_path transports string&!! unset .cindex "envelope sender" +.cindex "envelope from" .cindex "transport" "return path; changing" .cindex "return path" "changing in transport" If this option is set, the string is expanded at transport time and replaces @@ -22685,6 +22865,7 @@ percentage. .option use_bsmtp appendfile boolean false +.cindex "envelope from" .cindex "envelope sender" If this option is set true, &(appendfile)& writes messages in &"batch SMTP"& format, with the envelope sender and recipient(s) included as SMTP commands. If @@ -23561,14 +23742,15 @@ command = /bin/sh -c ${lookup{$local_part}lsearch{/some/file}} .cindex "filter" "transport filter" .vindex "&$pipe_addresses$&" Special handling takes place when an argument consists of precisely the text -&`$pipe_addresses`&. This is not a general expansion variable; the only +&`$pipe_addresses`& (no quotes). +This is not a general expansion variable; the only place this string is recognized is when it appears as an argument for a pipe or transport filter command. It causes each address that is being handled to be inserted in the argument list at that point &'as a separate argument'&. This avoids any problems with spaces or shell metacharacters, and is of use when a &(pipe)& transport is handling groups of addresses in a batch. -If &%force_command%& is enabled on the transport, Special handling takes place +If &%force_command%& is enabled on the transport, special handling takes place for an argument that consists of precisely the text &`$address_pipe`&. It is handled similarly to &$pipe_addresses$& above. It is expanded and each argument is inserted in the argument list at that point @@ -24439,6 +24621,30 @@ facilities such as AUTH, PIPELINING, SIZE, and STARTTLS. Exim will not use the SMTP PIPELINING extension when delivering to any host that matches this list, even if the server host advertises PIPELINING support. +.new +.option hosts_pipe_connect smtp "host list&!!" unset +.cindex "pipelining" "early connection" +.cindex "pipelining" PIPE_CONNECT +If Exim is built with the SUPPORT_PIPE_CONNECT build option +this option controls which to hosts the facility watched for +and recorded, and used for subsequent connections. + +The retry hints database is used for the record, +and records are subject to the &%retry_data_expire%& option. +When used, the pipelining saves on roundtrip times. +It also turns SMTP into a client-first protocol +so combines well with TCP Fast Open. + +Note: +When the facility is used, the transport &%helo_data%& option +will be expanded before the &$sending_ip_address$& variable +is filled in. +A check is made for the use of that variable, without the +presence of a &"def:"& test on it, but suitably complex coding +can avoid the check and produce unexpected results. +You have been warned. +.wen + .option hosts_avoid_tls smtp "host list&!!" unset .cindex "TLS" "avoiding for certain hosts" @@ -24478,13 +24684,15 @@ been started will not be passed to a new delivery process for sending another message on the same connection. See section &<>& for an explanation of when this might be needed. -.option hosts_noproxy_tls smtp "host list&!!" * +.new +.option hosts_noproxy_tls smtp "host list&!!" unset .cindex "TLS" "passing connection" .cindex "multiple SMTP deliveries" .cindex "TLS" "multiple message deliveries" For any host that matches this list, a TLS session which has been started will not be passed to a new delivery process for sending another message on the same session. +.wen The traditional implementation closes down TLS and re-starts it in the new process, on the same open TCP connection, for each successive message @@ -24580,7 +24788,7 @@ 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. -.option hosts_try_dane smtp "host list&!!" unset +.option hosts_try_dane smtp "host list&!!" * .cindex DANE "transport options" .cindex DANE "attempting for certain servers" If built with DANE support, Exim will lookup a @@ -24590,7 +24798,7 @@ a DANE-verified TLS connection is made to that host; there will be no fallback to in-clear communication. See section &<>&. -.option hosts_try_fastopen smtp "host list&!!" unset +.option hosts_try_fastopen smtp "host list&!!" * .cindex "fast open, TCP" "enabling, in client" .cindex "TCP Fast Open" "enabling, in client" .cindex "RFC 7413" "TCP Fast Open" @@ -24636,7 +24844,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 (&<>&). +For example: .code interface = <; 192.168.123.123 ; 3ffe:ffff:836f::fe86:a061 .endd @@ -24703,10 +24912,8 @@ 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 @@ -24724,11 +24931,9 @@ over a pipe to a local process &-- see chapter &<>&. 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. -.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 @@ -24957,7 +25162,6 @@ 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" @@ -24965,7 +25169,6 @@ If built with internationalization support, this option controls conversion of UTF-8 in message addresses to a-label form. For details see section &<>&. -.wen @@ -25158,6 +25361,7 @@ When an address is being routed, either for delivery or for verification, rewriting is applied immediately to child addresses that are generated by redirection, unless &%no_rewrite%& is set on the router. +.cindex "envelope from" .cindex "envelope sender" "rewriting at transport time" .cindex "rewriting" "at transport time" .cindex "header lines" "rewriting at transport time" @@ -26126,6 +26330,7 @@ included by setting AUTH_CRAM_MD5=yes AUTH_CYRUS_SASL=yes AUTH_DOVECOT=yes +AUTH_EXTERNAL=yes AUTH_GSASL=yes AUTH_HEIMDAL_GSSAPI=yes AUTH_PLAINTEXT=yes @@ -26137,15 +26342,20 @@ authentication mechanism (RFC 2195), and the second provides an interface to the Cyrus SASL authentication library. The third is an interface to Dovecot's authentication system, delegating the work via a socket interface. -The fourth provides an interface to the GNU SASL authentication library, which +.new +The fourth provides for negotiation of authentication done via non-SMTP means, +as defined by RFC 4422 Appendix A. +.wen +The fifth provides an interface to the GNU SASL authentication library, which provides mechanisms but typically not data sources. -The fifth provides direct access to Heimdal GSSAPI, geared for Kerberos, but +The sixth provides direct access to Heimdal GSSAPI, geared for Kerberos, but supporting setting a server keytab. -The sixth can be configured to support +The seventh can be configured to support the PLAIN authentication mechanism (RFC 2595) or the LOGIN mechanism, which is -not formally documented, but used by several MUAs. The seventh authenticator +not formally documented, but used by several MUAs. +The eighth authenticator supports Microsoft's &'Secure Password Authentication'& mechanism. -The eighth is an Exim authenticator but not an SMTP one; +The last is an Exim authenticator but not an SMTP one; instead it can use information from a TLS negotiation. The authenticators are configured using the same syntax as other drivers (see @@ -26607,7 +26817,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. @@ -27380,6 +27590,143 @@ msn: +. //////////////////////////////////////////////////////////////////////////// +. //////////////////////////////////////////////////////////////////////////// + +.chapter "The external authenticator" "CHAPexternauth" +.scindex IIDexternauth1 "&(external)& authenticator" +.scindex IIDexternauth2 "authenticators" "&(external)&" +.cindex "authentication" "Client Certificate" +.cindex "authentication" "X509" +.cindex "Certificate-based authentication" +The &(external)& authenticator provides support for +authentication based on non-SMTP information. +The specification is in RFC 4422 Appendix A +(&url(https://tools.ietf.org/html/rfc4422)). +It is only a transport and negotiation mechanism; +the process of authentication is entirely controlled +by the server configuration. + +The client presents an identity in-clear. +It is probably wise for a server to only advertise, +and for clients to only attempt, +this authentication method on a secure (eg. under TLS) connection. + +One possible use, compatible with the +K-9 Mail Andoid client (&url(https://k9mail.github.io/)), +is for using X509 client certificates. + +It thus overlaps in function with the TLS authenticator +(see &<>&) +but is a full SMTP SASL authenticator +rather than being implicit for TLS-connection carried +client certificates only. + +The examples and discussion in this chapter assume that +client-certificate authentication is being done. + +The client must present a certificate, +for which it must have been requested via the +&%tls_verify_hosts%& or &%tls_try_verify_hosts%& main options +(see &<>&). +For authentication to be effective the certificate should be +verifiable against a trust-anchor certificate known to the server. + +.section "External options" "SECTexternsoptions" +.cindex "options" "&(external)& authenticator (server)" +The &(external)& authenticator has two server options: + +.option server_param2 external string&!! unset +.option server_param3 external string&!! unset +.cindex "variables (&$auth1$& &$auth2$& etc)" "in &(external)& authenticator" +These options are expanded before the &%server_condition%& option +and the result are placed in &$auth2$& and &$auth3$& resectively. +If the expansion is forced to fail, authentication fails. Any other expansion +failure causes a temporary error code to be returned. + +They can be used to clarify the coding of a complex &%server_condition%&. + +.section "Using external in a server" "SECTexternserver" +.cindex "AUTH" "in &(external)& authenticator" +.cindex "numerical variables (&$1$& &$2$& etc)" &&& + "in &(external)& authenticator" +.vindex "&$auth1$&, &$auth2$&, etc" +.cindex "base64 encoding" "in &(external)& authenticator" + +When running as a server, &(external)& performs the authentication test by +expanding a string. The data sent by the client with the AUTH command, or in +response to subsequent prompts, is base64 encoded, and so may contain any byte +values when decoded. The decoded value is treated as +an identity for authentication and +placed in the expansion variable &$auth1$&. + +For compatibility with previous releases of Exim, the value is also placed in +the expansion variable &$1$&. However, the use of this +variable for this purpose is now deprecated, as it can lead to confusion in +string expansions that also use them for other things. + +.vindex "&$authenticated_id$&" +Once an identity has been received, +&%server_condition%& is expanded. If the expansion is forced to fail, +authentication fails. Any other expansion failure causes a temporary error code +to be returned. If the result of a successful expansion is an empty string, +&"0"&, &"no"&, or &"false"&, authentication fails. If the result of the +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. + +Example: +.code +ext_ccert_san_mail: + driver = external + public_name = EXTERNAL + + server_advertise_condition = $tls_in_certificate_verified + server_param2 = ${certextract {subj_altname,mail,>:} \ + {$tls_in_peercert}} + server_condition = ${if forany {$auth2} \ + {eq {$item}{$auth1}}} + server_set_id = $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 mail-SAN matching the claimed identity sent by the client. + +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. + + +.section "Using external in a client" "SECTexternclient" +.cindex "options" "&(external)& authenticator (client)" +The &(external)& authenticator has one client option: + +.option client_send external string&!! unset +This option is expanded and sent with the AUTH command as the +identity being asserted. + +Example: +.code +ext_ccert: + driver = external + public_name = EXTERNAL + + client_condition = ${if !eq{$tls_out_cipher}{}} + client_send = myaccount@smarthost.example.net +.endd + + +.ecindex IIDexternauth1 +.ecindex IIDexternauth2 + + + + + . //////////////////////////////////////////////////////////////////////////// . //////////////////////////////////////////////////////////////////////////// @@ -27435,20 +27782,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 @@ -27703,9 +28055,7 @@ 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 -.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. @@ -27771,7 +28121,6 @@ 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 @@ -27781,7 +28130,6 @@ 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" &&& @@ -28090,7 +28438,7 @@ There is no current way to staple a proof for a client certificate. -.section "Configuring an Exim client to use TLS" "SECID185" +.section "Configuring an Exim client to use TLS" "SECTclientTLS" .cindex "cipher" "logging" .cindex "log" "TLS cipher" .cindex "log" "distinguished name" @@ -28130,6 +28478,13 @@ transport provide the client with a certificate, which is passed to the server if it requests it. If the server is Exim, it will request a certificate only if &%tls_verify_hosts%& or &%tls_try_verify_hosts%& matches the client. +.new +Do not use a certificate which has the OCSP-must-staple extension, +for client use (they are usable for server use). +As TLS has no means for the client to staple before TLS 1.3 it will result +in failed connections. +.wen + If the &%tls_verify_certificates%& option is set on the &(smtp)& transport, it specifies a collection of expected server certificates. These may be @@ -28464,7 +28819,6 @@ DANE-TA is commonly used for several services and/or servers, each having a TLSA 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. @@ -28489,7 +28843,6 @@ 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). @@ -28507,7 +28860,6 @@ 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 @@ -28515,7 +28867,6 @@ 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 @@ -30613,13 +30964,13 @@ client host, and its contents have been verified. If there has been no previous attempt to verify the HELO/EHLO contents, it is carried out when this condition is encountered. See the description of the &%helo_verify_hosts%& and &%helo_try_verify_hosts%& options for details of how to request verification -independently of this condition. +independently of this condition, and for detail of the verification. For SMTP input that does not come over TCP/IP (the &%-bs%& command line option), this condition is always true. -.vitem &*verify&~=&~not_blind*& +.vitem &*verify&~=&~not_blind/*&<&'options'&> .cindex "verifying" "not blind" .cindex "bcc recipients, verifying none" This condition checks that there are no blind (bcc) recipients in the message. @@ -30629,6 +30980,11 @@ case-sensitively; domains are checked case-insensitively. If &'Resent-To:'& or &'Resent-Cc:'& header lines exist, they are also checked. This condition can be used only in a DATA or non-SMTP ACL. +.new +There is one possible option, &`case_insensitive`&. If this is present then +local parts are checked case-insensitively. +.wen + There are, of course, many legitimate messages that make use of blind (bcc) recipients. This check should not be used on its own for blocking messages. @@ -31356,14 +31712,12 @@ 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, -.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. 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 @@ -31534,14 +31888,12 @@ 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 @@ -32547,7 +32899,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 &<>&). .endlist You can append a &`defer_ok`& element to the &%malware%& argument list to accept @@ -32630,7 +32982,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 @@ -32658,7 +33010,7 @@ spamd_address = /var/run/spamd_socket 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 &<>&): .code spamd_address = 192.168.2.10 783 : \ 192.168.2.11 783 : \ @@ -32671,7 +33023,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 (&<>&); +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, @@ -33138,9 +33491,7 @@ code. The incident is logged on the main and reject logs. .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 -.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 @@ -33167,6 +33518,7 @@ in &_Local/Makefile_& (see section &<>& 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" @@ -34120,6 +34472,7 @@ headers remove "Old-Subject" .section "Setting an errors address in a system filter" "SECID217" +.cindex "envelope from" .cindex "envelope sender" In a system filter, if a &%deliver%& command is followed by .code @@ -34353,6 +34706,7 @@ other words, such qualification is also controlled by .cindex "sender" "address" .oindex "&%uucp_from_pattern%&" .oindex "&%uucp_from_sender%&" +.cindex "envelope from" .cindex "envelope sender" .cindex "Sendmail compatibility" "&""From""& line" Messages that have come from UUCP (and some other applications) often begin @@ -35801,6 +36155,7 @@ the address, giving a suitable error message. .section "Variable Envelope Return Paths (VERP)" "SECTverp" .cindex "VERP" .cindex "Variable Envelope Return Paths" +.cindex "envelope from" .cindex "envelope sender" Variable Envelope Return Paths &-- see &url(https://cr.yp.to/proto/verp.txt) &-- are a way of helping mailing list administrators discover which subscription @@ -36792,7 +37147,7 @@ the following table: &`F `& sender address (on delivery lines) &`H `& host name and IP address &`I `& local interface used -&`id `& message id for incoming message +&`id `& message id (from header) for incoming message &`K `& CHUNKING extension used &`L `& on &`<=`& and &`=>`& lines: PIPELINING extension used &`M8S `& 8BITMIME status for incoming message @@ -36899,6 +37254,8 @@ selection marked by asterisks: &` incoming_port `& remote port on <= lines &`*lost_incoming_connection `& as it says (includes timeouts) &` millisec `& millisecond timestamps and RT,QT,DT,D times +&`*msg_id `& on <= lines, Message-ID: header value +&` msg_id_created `& on <= lines, Message-ID: header value when one had to be added &` outgoing_interface `& local interface on => lines &` outgoing_port `& add remote port to => lines &`*queue_run `& start and end queue runs @@ -37082,6 +37439,16 @@ connection is unexpectedly dropped. &%millisec%&: Timestamps have a period and three decimal places of finer granularity appended to the seconds value. .next +.new +.cindex "log" "message id" +&%msg_id%&: The value of the Message-ID: header. +.next +&%msg_id_created%&: The value of the Message-ID: header, when one had to be created. +This will be either because the message is a bounce, or was submitted locally +(submission mode) without one. +The field identifier will have an asterix appended: &"id*="&. +.wen +.next .cindex "log" "outgoing interface" .cindex "log" "local interface" .cindex "log" "local address and port" @@ -37108,7 +37475,6 @@ 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 @@ -37117,6 +37483,15 @@ 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. + +.new +.cindex "pipelining" "early connection" +If Exim is built with the SUPPORT_PIPE_CONNECT build option +accept "L" fields have a period appended if the feature was +offered but not used, or an asterisk appended if used. +Delivery "L" fields have an asterisk appended if used. +.wen + .next .cindex "log" "queue run" .cindex "queue runner" "logging" @@ -37472,6 +37847,11 @@ Match only frozen messages. .vitem &*-x*& Match only non-frozen messages. + +.new +.vitem &*-G*&&~<&'queuename'&> +Match only messages in the given queue. Without this, the default queue is searched. +.wen .endlist The following options control the format of the output: @@ -38937,11 +39317,9 @@ 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 @@ -39328,7 +39706,7 @@ senders). .cindex "DKIM" "signing" For signing to be usable you must have published a DKIM record in DNS. -Note that RFC 8301 says: +Note that RFC 8301 (which does not cover EC keys) says: .code rsa-sha1 MUST NOT be used for signing or verifying. @@ -39348,7 +39726,11 @@ These options take (expandable) strings as arguments. .option dkim_domain smtp string list&!! unset The domain(s) you want to sign with. After expansion, this can be a list. -Each element in turn is put into the &%$dkim_domain%& expansion variable +Each element in turn, +.new +lowercased, +.wen +is put into the &%$dkim_domain%& expansion variable while expanding the remaining signing options. If it is empty after expansion, DKIM signing is not done, and no error will result even if &%dkim_strict%& is set. @@ -39402,8 +39784,9 @@ Signers MUST use RSA keys of at least 1024 bits for all keys. Signers SHOULD use RSA keys of at least 2048 bits. .endd -Support for EC keys is being developed under -&url(https://datatracker.ietf.org/doc/draft-ietf-dcrup-dkim-crypto/). +.new +EC keys for DKIM are defined by RFC 8463. +.wen They are considerably smaller than RSA keys for equivalent protection. As they are a recent development, users should consider dual-signing (by setting a list of selectors, and an expansion for this option) @@ -39423,10 +39806,12 @@ openssl pkey -outform DER -pubout -in dkim_ed25519.private | tail -c +13 | base6 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. +.new +Exim also supports an alternate format +of Ed25519 keys in DNS which was a candidate during development +of the standard, but not adopted. +A future release will probably drop that support. +.wen .option dkim_hash smtp string&!! sha256 Can be set to any one of the supported hash methods, which are: @@ -39484,7 +39869,6 @@ 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. @@ -39494,22 +39878,19 @@ for the expiry tag 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" -.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). +The results of that verification are then made available to the +&%acl_smtp_dkim%& ACL, 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. @@ -39517,7 +39898,7 @@ 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 &new(verification result) in the ACL +To evaluate the 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. @@ -39553,6 +39934,14 @@ dkim_verify_signers = $sender_address_domain:$dkim_signers If a domain or identity is listed several times in the (expanded) value of &%dkim_verify_signers%&, the ACL is only called once for that domain or identity. +.new +Note that if the option is set using untrustworthy data +(such as the From: header) +care should be taken to force lowercase for domains +and for the domain part if identities. +The default setting can be regarded as trustworthy in this respect. +.wen + If multiple signatures match a domain (or identity), the ACL is called once for each matching signature. @@ -39671,12 +40060,10 @@ 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. @@ -39992,6 +40379,8 @@ of the proxy): .endd If &$proxy_session$& is set but &$proxy_external_address$& is empty there was a protocol error. +The variables &$sender_host_address$& and &$sender_host_port$& +will have values for the actual client system, not the proxy. Since the real connections are all coming from the proxy, and the per host connection tracking is done before Proxy Protocol is @@ -40164,11 +40553,9 @@ 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. @@ -40376,6 +40763,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