X-Git-Url: https://git.distorted.org.uk/~mdw/exim-config/blobdiff_plain/185b5456076ca86959643ce2f19c98c0f82f281e..e913c9991d2a69fb2f1ac5bafa2d9942eb2be60f:/exchange.m4 diff --git a/exchange.m4 b/exchange.m4 index 08fe4a0..1e82249 100644 --- a/exchange.m4 +++ b/exchange.m4 @@ -24,17 +24,8 @@ ###-------------------------------------------------------------------------- ### Listen for incoming connections. -SECTION(global, tls)m4_dnl -tls_certificate = CONF_sysconf_dir/server.cert -tls_privatekey = CONF_sysconf_dir/server.key -tls_advertise_hosts = * -tls_dhparam = CONF_ca_dir/dh-param.pem -tls_require_ciphers = ${if or {{={$received_port}{CONF_submission_port}} \ - {match_ip {$sender_host_address}{+trusted}}} \ - {CONF_good_ciphers} \ - {CONF_acceptable_ciphers}} -tls_verify_certificates = CONF_ca_dir/ca.cert -tls_verify_hosts = ${if eq{$acl_c_mode}{submission} {} {+allnets}} +SECTION(global, daemon)m4_dnl +daemon_smtp_ports = CONF_smtp_port : CONF_submission_port DIVERT(null) ###-------------------------------------------------------------------------- @@ -44,25 +35,29 @@ SECTION(acl, mail-hooks)m4_dnl ## Check that a submitted message's sender address is allowable. require acl = mail_client_addr - ## Insist that a local client connect through TLS. - deny message = Hosts within CONF_master_domain must use TLS - !condition = ${if eq{$acl_c_mode}{submission}} - hosts = +allnets - !encrypted = * - SECTION(acl, misc)m4_dnl mail_client_addr: ## If this is a message submission then that's handled elsewhere. accept condition = ${if eq{$acl_c_mode}{submission}} - ## Make sure that the sender matches the client address. - require message = Client host invalid for sender domain - hosts = ${LOOKUP_DOMAIN($sender_address_domain, + ## Make sure that the sender matches the client address. I feel like + ## I want to reject these, but that will break stuff. For example, + ## if I send mail to an externally hosted address which is really a + ## distribution list containing some local address, then we'll + ## (approximately legitimately) receive mail with an apparently-local + ## sender from a remote host. + warn !hosts = ${LOOKUP_DOMAIN($sender_address_domain, {KV(hosts, {$value}{+allnets})}, {${if match_domain {$sender_address_domain} \ {+public} \ {+allnets}{! +allnets}}})} + add_header = :after_received:X-Distorted-Warning: \ + RCLNTLSNDR \ + Apparently local sender, but received from remote \ + server.\n\t\ + sender=$sender_address \ + host=$sender_host_address ## OK. accept @@ -75,7 +70,7 @@ SECTION(routers, remote)m4_dnl ## Send mail on to a host in our own network. We must apply extra security. local: driver = dnslookup - domains = ! +known : *.CONF_master_domain + domains = ! +known : CONF_master_domain : *.CONF_master_domain self = fail transport = smtp_local no_more