Added tls_dh_max_bits & check tls_require_ciphers early.
[exim.git] / doc / doc-docbook / spec.xfpt
index 167208ac9482e4d8648cd22dfbaf03d42a4ac36b..da97d40823c5b51b91de3c95e87091713da8c921 100644 (file)
@@ -46,7 +46,7 @@
 . /////////////////////////////////////////////////////////////////////////////
 
 .set previousversion "4.75"
-.set version "4.77"
+.set version "4.80"
 
 .set ACL "access control lists (ACLs)"
 .set I   "    "
 <bookinfo>
 <title>Specification of the Exim Mail Transfer Agent</title>
 <titleabbrev>The Exim MTA</titleabbrev>
-<date>06 May 2011</date>
+<date>17 May 2012</date>
 <author><firstname>Exim</firstname><surname>Maintainers</surname></author>
 <authorinitials>EM</authorinitials>
 <revhistory><revision>
-  <revnumber>4.77</revnumber>
-  <date>10 Oct 2011</date>
+  <revnumber>4.80</revnumber>
+  <date>17 May 2012</date>
   <authorinitials>EM</authorinitials>
 </revision></revhistory>
-<copyright><year>2011</year><holder>University of Cambridge</holder></copyright>
+<copyright><year>2012</year><holder>University of Cambridge</holder></copyright>
 </bookinfo>
 .literal off
 
@@ -6756,11 +6756,13 @@ is used on its own as the result. If the lookup does not succeed, the
 &`fail`& keyword causes a &'forced expansion failure'& &-- see section
 &<<SECTforexpfai>>& for an explanation of what this means.
 
-The supported DNS record types are A, CNAME, MX, NS, PTR, SRV, and TXT, and,
-when Exim is compiled with IPv6 support, AAAA (and A6 if that is also
+.new
+The supported DNS record types are A, CNAME, MX, NS, PTR, SPF, SRV, and TXT,
+and, when Exim is compiled with IPv6 support, AAAA (and A6 if that is also
 configured). If no type is given, TXT is assumed. When the type is PTR,
 the data can be an IP address, written as normal; inversion and the addition of
 &%in-addr.arpa%& or &%ip6.arpa%& happens automatically. For example:
+.wen
 .code
 ${lookup dnsdb{ptr=192.168.4.5}{$value}fail}
 .endd
@@ -6786,13 +6788,18 @@ It is permitted to specify a space as the separator character. Further
 white space is ignored.
 
 .cindex "TXT record" "in &(dnsdb)& lookup"
+.cindex "SPF record" "in &(dnsdb)& lookup"
+.new
 For TXT records with multiple items of data, only the first item is returned,
 unless a separator for them is specified using a comma after the separator
 character followed immediately by the TXT record item separator. To concatenate
-items without a separator, use a semicolon instead.
+items without a separator, use a semicolon instead. For SPF records the
+default behaviour is to concatenate multiple items without using a separator.
+.wen
 .code
 ${lookup dnsdb{>\n,: txt=a.b.example}}
 ${lookup dnsdb{>\n; txt=a.b.example}}
+${lookup dnsdb{spf=example.org}}
 .endd
 It is permitted to specify a space as the separator character. Further
 white space is ignored.
@@ -9767,7 +9774,8 @@ supplied number and is at least 0.  The quality of this randomness depends
 on how Exim was built; the values are not suitable for keying material.
 If Exim is linked against OpenSSL then RAND_pseudo_bytes() is used.
 .new
-if Exim is linked against GnuTLS then gnutls_rnd(GNUTLS_RND_NONCE) is used.
+If Exim is linked against GnuTLS then gnutls_rnd(GNUTLS_RND_NONCE) is used,
+for versions of GnuTLS with that function.
 .wen
 Otherwise, the implementation may be arc4random(), random() seeded by
 srandomdev() or srandom(), or a custom implementation even weaker than
@@ -11942,6 +11950,10 @@ files, for example: Thu Oct 17 17:14:09 1995.
 .vindex "&$tod_epoch$&"
 The time and date as a number of seconds since the start of the Unix epoch.
 
+.vitem &$tod_epoch_l$&
+.vindex "&$tod_epoch_l$&"
+The time and date as a number of microseconds since the start of the Unix epoch.
+
 .vitem &$tod_full$&
 .vindex "&$tod_full$&"
 A full version of the time and date, for example: Wed, 16 Oct 1995 09:51:40
@@ -12682,6 +12694,7 @@ listed in more than one group.
 .row &%tls_advertise_hosts%&         "advertise TLS to these hosts"
 .row &%tls_certificate%&             "location of server certificate"
 .row &%tls_crl%&                     "certificate revocation list"
+.row &%tls_dh_max_bits%&             "clamp D-H bit count suggestion"
 .row &%tls_dhparam%&                 "DH parameters for server"
 .row &%tls_on_connect_ports%&        "specify SSMTP (SMTPS) ports"
 .row &%tls_privatekey%&              "location of server private key"
@@ -14393,7 +14406,7 @@ adjusted lightly.  An unrecognised item will be detected at startup, by
 invoking Exim with the &%-bV%& flag.
 
 .new
-Historical note: prior to release 4.78, Exim defaulted this value to
+Historical note: prior to release 4.80, Exim defaulted this value to
 "+dont_insert_empty_fragments", which may still be needed for compatibility
 with some clients, but which lowers security by increasing exposure to
 some now infamous attacks.
@@ -15668,6 +15681,25 @@ See &<<SECTtlssni>>& for discussion of when this option might be re-expanded.
 .wen
 
 
+.new
+.option tls_dh_max_bits main integer 2236
+.cindex "TLS" "D-H bit count"
+The number of bits used for Diffie-Hellman key-exchange may be suggested by
+the chosen TLS library.  That value might prove to be too high for
+interoperability.  This option provides a maximum clamp on the value
+suggested, trading off security for interoperability.
+
+The value must be at least 1024.
+
+The value 2236 was chosen because, at time of adding the option, it was the
+hard-coded maximum value supported by the NSS cryptographic library, as used
+by Thunderbird, while GnuTLS was suggesting 2432 bits as normal.
+
+If you prefer more security and are willing to break some clients, raise this
+number.
+.wen
+
+
 .option tls_dhparam main string&!! unset
 .cindex "TLS" "D-H parameters for server"
 The value of this option is expanded, and must then be the absolute path to
@@ -15675,6 +15707,11 @@ a file which contains the server's DH parameter values.
 This is used only for OpenSSL. When Exim is linked with GnuTLS, this option is
 ignored. See section &<<SECTopenvsgnu>>& for further details.
 
+.new
+If the DH bit-count from loading the file is greater than tls_dh_max_bits then
+it will be ignored.
+.end
+
 
 .option tls_on_connect_ports main "string list" unset
 This option specifies a list of incoming SSMTP (aka SMTPS) ports that should
@@ -24546,14 +24583,14 @@ who authenticated is placed in &$auth1$&.
 .cindex "authentication" "CRAM-MD5"
 .cindex "authentication" "SCRAM-SHA-1"
 The &(gsasl)& authenticator provides server integration for the GNU SASL
-library and the mechanisms it provides.  This is new as of the 4.78 release
+library and the mechanisms it provides.  This is new as of the 4.80 release
 and there are a few areas where the library does not let Exim smoothly
 scale to handle future authentication mechanisms, so no guarantee can be
 made that any particular new authentication mechanism will be supported
 without code changes in Exim.
 
 
-.option server_channelbinding gsasl bool false
+.option server_channelbinding gsasl boolean false
 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
@@ -24928,6 +24965,9 @@ name of a directory (for OpenSSL it can be either).
 The &%tls_dhparam%& option is ignored, because early versions of GnuTLS had no
 facility for varying its Diffie-Hellman parameters. I understand that this has
 changed, but Exim has not been updated to provide this facility.
+.new
+Instead, the GnuTLS support will use a file from the spool directory.
+.wen
 .next
 .vindex "&$tls_peerdn$&"
 Distinguished Name (DN) strings reported by the OpenSSL library use a slash for
@@ -24959,7 +24999,8 @@ implementation, then patches are welcome.
 GnuTLS uses D-H parameters that may take a substantial amount of time
 to compute. It is unreasonable to re-compute them for every TLS session.
 Therefore, Exim keeps this data in a file in its spool directory, called
-&_gnutls-params-normal_&.
+&_gnutls-params-NNNN_& for some value of NNNN, corresponding to the number
+of bits requested.
 The file is owned by the Exim user and is readable only by
 its owner. Every Exim process that start up GnuTLS reads the D-H
 parameters from this file. If the file does not exist, the first Exim process
@@ -24978,7 +25019,7 @@ until enough randomness (entropy) is available. This may cause Exim to hang for
 a substantial amount of time, causing timeouts on incoming connections.
 
 The solution is to generate the parameters externally to Exim. They are stored
-in &_gnutls-params-normal_& in PEM format, which means that they can be
+in &_gnutls-params-N_& in PEM format, which means that they can be
 generated externally using the &(certtool)& command that is part of GnuTLS.
 
 To replace the parameters with new ones, instead of deleting the file
@@ -24986,20 +25027,27 @@ and letting Exim re-create it, you can generate new parameters using
 &(certtool)& and, when this has been done, replace Exim's cache file by
 renaming. The relevant commands are something like this:
 .code
+# ls
+[ look for file; assume gnutls-params-1024 is the most recent ]
 # rm -f new-params
 # touch new-params
 # chown exim:exim new-params
 # chmod 0600 new-params
-# certtool --generate-dh-params >>new-params
+# certtool --generate-dh-params --bits 1024 >>new-params
 # chmod 0400 new-params
-# mv new-params gnutls-params-normal
+# mv new-params gnutls-params-1024
 .endd
 If Exim never has to generate the parameters itself, the possibility of
 stalling is removed.
 
-The filename changed in Exim 4.78, to gain the -normal suffix, corresponding
-to the GnuTLS constant &`GNUTLS_SEC_PARAM_NORMAL`&, defining the number of
-bits to include.  At time of writing, NORMAL corresponds to 2432 bits for D-H.
+The filename changed in Exim 4.80, to gain the -bits suffix.  The value which
+Exim will choose depends upon the version of GnuTLS in use.  For older GnuTLS,
+the value remains hard-coded in Exim as 1024.  As of GnuTLS 2.12.x, there is
+a way for Exim to ask for the "normal" number of bits for D-H public-key usage,
+and Exim does so.  Exim thus removes itself from the policy decision, and the
+filename and bits used change as the GnuTLS maintainers change the value for
+their parameter &`GNUTLS_SEC_PARAM_NORMAL`&.  At the time of writing, this
+gives 2432 bits.
 .wen
 
 
@@ -25076,7 +25124,7 @@ Documentation of the strings accepted may be found in the GnuTLS manual, under
 "Priority strings".  This is online as
 &url(http://www.gnu.org/software/gnutls/manual/html_node/Priority-Strings.html).
 
-Prior to Exim 4.78, an older API of GnuTLS was used, and Exim supported three
+Prior to Exim 4.80, an older API of GnuTLS was used, and Exim supported three
 additional options, "&%gnutls_require_kx%&", "&%gnutls_require_mac%&" and
 "&%gnutls_require_protocols%&".  &%tls_require_ciphers%& was an Exim list.
 .wen