Exim force TLS for specific destination domain

eximtls

I need to configure Exim to require TLS when sending emails to a specific domain.

I know that I can use

 hosts_require_tls = host

in the smtp transport. But it sounds like that requires that I set the host of the receiving mail server. I would instead like to specify the domain.

Also, if I use this, will all other hosts/domains work without TLS? Just want to confirm before I implement.

Thanks.

Best Answer

you can use the recipient ACL and use the encrypted condition, see here.

deny
    domains = secure.mail.org
    ! encrypted = *

EDIT

To force sending encrypted mail to some domains, you can create a "required tls" transport (specifying host_require_tls), and then create a router for the domains you want, e.g (untested):

begin router

tls_router:
    driver = accept
    domains = secure.mail.com
    transport = tls_smtp

begin transport

tls_smtp:
    driver = smtp
    hosts_require_tls = *