@@ -26128,6 +26128,7 @@ included by setting
26128
26128
AUTH_CRAM_MD5=yes
26129
26129
AUTH_CYRUS_SASL=yes
26130
26130
AUTH_DOVECOT=yes
26131
+ AUTH_EXTERNAL=yes
26131
26132
AUTH_GSASL=yes
26132
26133
AUTH_HEIMDAL_GSSAPI=yes
26133
26134
AUTH_PLAINTEXT=yes
@@ -26139,15 +26140,20 @@ authentication mechanism (RFC 2195), and the second provides an interface to
26139
26140
the Cyrus SASL authentication library.
26140
26141
The third is an interface to Dovecot's authentication system, delegating the
26141
26142
work via a socket interface.
26142
- The fourth provides an interface to the GNU SASL authentication library, which
26143
+ .new
26144
+ The fourth provides for negotiation of authentication done via non-SMTP means,
26145
+ as defined by RFC 4422 Appendix A.
26146
+ .wen
26147
+ The fifth provides an interface to the GNU SASL authentication library, which
26143
26148
provides mechanisms but typically not data sources.
26144
- The fifth provides direct access to Heimdal GSSAPI, geared for Kerberos, but
26149
+ The sixth provides direct access to Heimdal GSSAPI, geared for Kerberos, but
26145
26150
supporting setting a server keytab.
26146
- The sixth can be configured to support
26151
+ The seventh can be configured to support
26147
26152
the PLAIN authentication mechanism (RFC 2595) or the LOGIN mechanism, which is
26148
- not formally documented, but used by several MUAs. The seventh authenticator
26153
+ not formally documented, but used by several MUAs.
26154
+ The eighth authenticator
26149
26155
supports Microsoft's &'Secure Password Authentication'& mechanism.
26150
- The eighth is an Exim authenticator but not an SMTP one;
26156
+ The last is an Exim authenticator but not an SMTP one;
26151
26157
instead it can use information from a TLS negotiation.
26152
26158
26153
26159
The authenticators are configured using the same syntax as other drivers (see
@@ -27382,6 +27388,143 @@ msn:
27382
27388
27383
27389
27384
27390
27391
+ . ////////////////////////////////////////////////////////////////////////////
27392
+ . ////////////////////////////////////////////////////////////////////////////
27393
+
27394
+ .chapter "The external authenticator" "CHAPexternauth"
27395
+ .scindex IIDexternauth1 "&(external)& authenticator"
27396
+ .scindex IIDexternauth2 "authenticators" "&(external)&"
27397
+ .cindex "authentication" "Client Certificate"
27398
+ .cindex "authentication" "X509"
27399
+ .cindex "Certificate-based authentication"
27400
+ The &(external)& authenticator provides support for
27401
+ authentication based on non-SMTP information.
27402
+ The specification is in RFC 4422 Appendix A
27403
+ (&url(https://tools.ietf.org/html/rfc4422)).
27404
+ It is only a transport and negotiation mechanism;
27405
+ the process of authentication is entirely controlled
27406
+ by the server configuration.
27407
+
27408
+ The client presents an identity in-clear.
27409
+ It is probably wise for a server to only advertise,
27410
+ and for clients to only attempt,
27411
+ this authentication method on a secure (eg. under TLS) connection.
27412
+
27413
+ One possible use, compatible with the
27414
+ K-9 Mail Andoid client (&url(https://k9mail.github.io/)),
27415
+ is for using X509 client certificates.
27416
+
27417
+ It thus overlaps in function with the TLS authenticator
27418
+ (see &<<CHAPtlsauth>>&)
27419
+ but is a full SMTP SASL authenticator
27420
+ rather than being implicit for TLS-connection carried
27421
+ client certificates only.
27422
+
27423
+ The examples and discussion in this chapter assume that
27424
+ client-certificate authentication is being done.
27425
+
27426
+ The client must present a certificate,
27427
+ for which it must have been requested via the
27428
+ &%tls_verify_hosts%& or &%tls_try_verify_hosts%& main options
27429
+ (see &<<CHAPTLS>>&).
27430
+ For authentication to be effective the certificate should be
27431
+ verifiable against a trust-anchor certificate known to the server.
27432
+
27433
+ .section "External options" "SECTexternsoptions"
27434
+ .cindex "options" "&(external)& authenticator (server)"
27435
+ The &(external)& authenticator has two server options:
27436
+
27437
+ .option server_param2 external string&!! unset
27438
+ .option server_param3 external string&!! unset
27439
+ .cindex "variables (&$auth1$& &$auth2$& etc)" "in &(external)& authenticator"
27440
+ These options are expanded before the &%server_condition%& option
27441
+ and the result are placed in &$auth2$& and &$auth3$& resectively.
27442
+ If the expansion is forced to fail, authentication fails. Any other expansion
27443
+ failure causes a temporary error code to be returned.
27444
+
27445
+ They can be used to clarify the coding of a complex &%server_condition%&.
27446
+
27447
+ .section "Using external in a server" "SECTexternserver"
27448
+ .cindex "AUTH" "in &(external)& authenticator"
27449
+ .cindex "numerical variables (&$1$& &$2$& etc)" &&&
27450
+ "in &(external)& authenticator"
27451
+ .vindex "&$auth1$&, &$auth2$&, etc"
27452
+ .cindex "base64 encoding" "in &(external)& authenticator"
27453
+
27454
+ When running as a server, &(external)& performs the authentication test by
27455
+ expanding a string. The data sent by the client with the AUTH command, or in
27456
+ response to subsequent prompts, is base64 encoded, and so may contain any byte
27457
+ values when decoded. The decoded value is treated as
27458
+ an identity for authentication and
27459
+ placed in the expansion variable &$auth1$&.
27460
+
27461
+ For compatibility with previous releases of Exim, the value is also placed in
27462
+ the expansion variable &$1$&. However, the use of this
27463
+ variable for this purpose is now deprecated, as it can lead to confusion in
27464
+ string expansions that also use them for other things.
27465
+
27466
+ .vindex "&$authenticated_id$&"
27467
+ Once an identity has been received,
27468
+ &%server_condition%& is expanded. If the expansion is forced to fail,
27469
+ authentication fails. Any other expansion failure causes a temporary error code
27470
+ to be returned. If the result of a successful expansion is an empty string,
27471
+ &"0"&, &"no"&, or &"false"&, authentication fails. If the result of the
27472
+ expansion is &"1"&, &"yes"&, or &"true"&, authentication succeeds and the
27473
+ generic &%server_set_id%& option is expanded and saved in &$authenticated_id$&.
27474
+ For any other result, a temporary error code is returned, with the expanded
27475
+ string as the error text.
27476
+
27477
+ Example:
27478
+ .code
27479
+ ext_ccert_san_mail:
27480
+ driver = external
27481
+ public_name = EXTERNAL
27482
+
27483
+ server_advertise_condition = $tls_in_certificate_verified
27484
+ server_param2 = ${certextract {subj_altname,mail,>:} \
27485
+ {$tls_in_peercert}}
27486
+ server_condition = ${if forany {$auth2} \
27487
+ {eq {$item}{$auth1}}}
27488
+ server_set_id = $auth1
27489
+ .endd
27490
+ This accepts a client certificate that is verifiable against any
27491
+ of your configured trust-anchors
27492
+ (which usually means the full set of public CAs)
27493
+ and which has a mail-SAN matching the claimed identity sent by the client.
27494
+
27495
+ Note that, up to TLS1.2, the client cert is on the wire in-clear, including the SAN,
27496
+ The account name is therefore guessable by an opponent.
27497
+ TLS 1.3 protects both server and client certificates, and is not vulnerable
27498
+ in this way.
27499
+ Likewise, a traditional plaintext SMTP AUTH done inside TLS is not.
27500
+
27501
+
27502
+ .section "Using external in a client" "SECTexternclient"
27503
+ .cindex "options" "&(external)& authenticator (client)"
27504
+ The &(external)& authenticator has one client option:
27505
+
27506
+ .option client_send external string&!! unset
27507
+ This option is expanded and sent with the AUTH command as the
27508
+ identity being asserted.
27509
+
27510
+ Example:
27511
+ .code
27512
+ ext_ccert:
27513
+ driver = external
27514
+ public_name = EXTERNAL
27515
+
27516
+ client_condition = ${if !eq{$tls_out_cipher}{}}
27517
+ client_send = myaccount@smarthost.example.net
27518
+ .endd
27519
+
27520
+
27521
+ .ecindex IIDexternauth1
27522
+ .ecindex IIDexternauth2
27523
+
27524
+
27525
+
27526
+
27527
+
27385
27528
. ////////////////////////////////////////////////////////////////////////////
27386
27529
. ////////////////////////////////////////////////////////////////////////////
27387
27530
0 commit comments