. 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)"
.section "FTP and web sites" "SECID2"
.cindex "web site"
.cindex "FTP site"
-.new
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.
-.wen
.cindex "wiki"
.cindex "FAQ"
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.
-.new
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.
-.wen
.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.
-.new
Please do not ask for configuration help in the bug-tracker.
-.wen
.section "Mailing lists" "SECID3"
.cindex "HTTPS download site"
.cindex "distribution" "ftp site"
.cindex "distribution" "https site"
-.new
The master distribution site for the Exim distribution is
.display
&*https://downloads.exim.org/*&
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.
-.wen
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_&.
.endd
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.
-.new
The &_.xz_& file is usually the smallest, while the &_.gz_& file is the
most portable to old systems.
-.wen
.cindex "distribution" "signing details"
.cindex "distribution" "public key"
&_nigel-pubkey.asc_&. All keys used will be available in public keyserver pools,
such as &'pool.sks-keyservers.net'&.
-.new
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'&.
-.wen
The signatures for the tar bundles are in:
.display
&_exim-postscript-n.nn.tar.gz_&
&_exim-texinfo-n.nn.tar.gz_&
.endd
-.new
These tar files contain only the &_doc_& directory, not the complete
distribution, and are also available in &_.bz2_& and &_.xz_& forms.
-.wen
.section "Limitations" "SECID6"
are available, similarly to the drivers. Because macros are sometimes used
for storing passwords, this option is restricted.
The output format is one item per line.
-.new
For the "-bP macro <name>" form, if no such macro is found
the exit status will be nonzero.
-.wen
.vitem &%-bp%&
.oindex "&%-bp%&"
${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
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
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:"
add_header = :at_start:${authresults {$primary_hostname}}
.endd
This is safe even if no authentication results are available.
-.wen
.vitem "&*${certextract{*&<&'field'&>&*}{*&<&'certificate'&>&*}&&&
&*$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"
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
&%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
.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:
.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.
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'&>&*}*&
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"
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$&
is compiled with the content-scanning extension. For details, see section
&<<SECTscanspamass>>&.
-.new
.vitem &$spf_header_comment$& &&&
&$spf_received$& &&&
&$spf_result$& &&&
&$spf_smtp_comment$&
These variables are only available if Exim is built with SPF support.
For details see section &<<SECSPF>>&.
-.wen
.vitem &$spool_directory$&
.vindex "&$spool_directory$&"
.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"
reversed and looked up in the reverse DNS, as described in more detail in
section &<<SECTverifyCSA>>&.
+.new
+.option dns_cname_loops main integer 1
+.cindex DNS "CNAME following"
+This option controls the following of CNAME chains, needed if the resolver does
+not do it internally.
+As of 2018 most should, and the default can be left.
+If you have an ancient one, a value of 10 is likely needed.
+
+The default value of one CNAME-follow is needed
+thanks to the observed return for an MX request,
+given no MX presence but a CNAME to an A, of the CNAME.
+.wen
+
.option dns_dnssec_ok main integer -1
.cindex "DNS" "resolver options"
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/_&.
-.new
.option spf_guess main string "v=spf1 a/24 mx/24 ptr ?all"
This option is available when Exim is compiled with SPF support.
See section &<<SECSPF>>& for more details.
-.wen
This option specifies a certificate revocation list. The expanded value must
be the name of a file that contains CRLs in PEM format.
-.new
Under OpenSSL the option can specify a directory with CRL files.
&*Note:*& Under OpenSSL the option must, if given, supply a CRL
for each signing element of the certificate chain (i.e. all but the leaf).
For the file variant this can be multiple PEM blocks in the one file.
-.wen
See &<<SECTtlssni>>& for discussion of when this option might be re-expanded.
Usable for GnuTLS 3.4.4 or 3.3.17 or OpenSSL 1.1.0 (or later).
-.new
For GnuTLS 3.5.6 or later the expanded value of this option can be a list
of files, to match a list given for the &%tls_certificate%& option.
The ordering of the two lists must match.
-.wen
.option tls_on_connect_ports main "string list" unset
.cindex SSMTP
.cindex SMTPS
This option specifies a list of incoming SSMTP (aka SMTPS) ports that should
-operate the obsolete SSMTP (SMTPS) protocol, where a TLS session is immediately
+operate the SSMTP (SMTPS) protocol, where a TLS session is immediately
set up without waiting for the client to issue a STARTTLS command. For
further details, see section &<<SECTsupobssmt>>&.
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.
also being queued.
-.new
.option ipv4_only "string&!!" unset
.cindex IPv6 disabling
.cindex DNS "IPv6 disabling"
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"
&%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:
option.
-.new
.option dane_require_tls_ciphers smtp string&!! unset
.cindex "TLS" "requiring specific ciphers for DANE"
.cindex "cipher" "requiring specific"
counter-intuitively decreasing it.
If the option expands to be empty or is forced to fail, then it will
be treated as unset and &%tls_require_ciphers%& will be used instead.
-.wen
.option data_timeout smtp time 5m
of the message. Its value must not be zero. See also &%final_timeout%&.
+.option dkim_canon smtp string&!! unset
.option dkim_domain smtp string list&!! unset
-.option dkim_selector smtp string&!! unset
+.option dkim_hash smtp string&!! sha256
+.option dkim_identity smtp string&!! unset
.option dkim_private_key smtp string&!! unset
-.option dkim_canon smtp string&!! unset
+.option dkim_selector smtp string&!! unset
.option dkim_strict smtp string&!! unset
.option dkim_sign_headers smtp string&!! "per RFC"
-.option dkim_hash smtp string&!! sha256
-.option dkim_identity smtp string&!! unset
+.option dkim_timestamps smtp string&!! unset
DKIM signing options. For details see section &<<SECDKIMSIGN>>&.
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"
and that a DANE-verified TLS connection is made.
There will be no fallback to in-clear communication.
See section &<<SECDANE>>&.
-.wen
.option hosts_require_ocsp smtp "host list&!!" unset
.cindex "TLS" "requiring for certain servers"
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"
a DANE-verified TLS connection is made to that host;
there will be no fallback to in-clear communication.
See section &<<SECDANE>>&.
-.wen
.option hosts_try_fastopen smtp "host list&!!" unset
.cindex "fast open, TCP" "enabling, in client"
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
.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:
.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
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"
.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
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"
-.new
.section DANE "SECDANE"
.cindex DANE
DNS-based Authentication of Named Entities, as applied to SMTP over TLS, provides assurance to a client that
Another approach which should be seriously considered is to use DANE with a certificate
from a public CA, because of another technology, "MTA-STS", described below.
+.new
+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).
At the time of writing, &url(https://www.huque.com/bin/gen_tlsa)
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 importantlyimportantly 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:
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).
-.wen
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
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 = \
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 : \
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
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
+
Exim's side of the malware scanner, or are given on separate lines to
the daemon as options before the main scan command.
-.new
.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.
-.wen
For example:
.code
.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
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
&%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
.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"
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
&%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"
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_&.
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.
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
.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
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.
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
is set.
.endlist
-.new
To generate keys under OpenSSL:
.code
openssl genrsa -out dkim_rsa.private 2048
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
-.wen
+probably drop support for whichever proposal loses.
.option dkim_hash smtp string&!! sha256
-.new
Can be set to any one of the supported hash methods, which are:
.ilist
&`sha1`& &-- should not be used, is old and insecure
.next
&`sha512`& &-- possibly more secure but less well supported
.endlist
-.wen
-.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
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
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
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 {$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
+ 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
.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.
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'.
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.
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.
.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
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
-.new
.section "SPF (Sender Policy Framework)" SECSPF
.cindex SPF verification
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"
Currently, only IPv4 addresses are supported.
-. wen-for SPF section
-.wen
. ////////////////////////////////////////////////////////////////////////////
.cindex utf8 "address downconversion"
.cindex i18n "utf8 address downconversion"
-.new
The RCPT ACL
-.wen
may use the following modifier:
.display
control = utf8_downconvert