vhost.m4: Rename `route' to `virtual_route'.
[exim-config] / exchange.m4
CommitLineData
185b5456
MW
1### -*-m4-*-
2###
3### Transmission to remote hosts for distorted.org.uk Exim configuration.
4###
5### (c) 2012 Mark Wooding
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This program is free software; you can redistribute it and/or modify
11### it under the terms of the GNU General Public License as published by
12### the Free Software Foundation; either version 2 of the License, or
13### (at your option) any later version.
14###
15### This program is distributed in the hope that it will be useful,
16### but WITHOUT ANY WARRANTY; without even the implied warranty of
17### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18### GNU General Public License for more details.
19###
20### You should have received a copy of the GNU General Public License
21### along with this program; if not, write to the Free Software Foundation,
22### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
24###--------------------------------------------------------------------------
25### Listen for incoming connections.
26
d411be33
MW
27SECTION(global, daemon)m4_dnl
28daemon_smtp_ports = CONF_smtp_port : CONF_submission_port
29
185b5456
MW
30SECTION(global, tls)m4_dnl
31tls_certificate = CONF_sysconf_dir/server.cert
32tls_privatekey = CONF_sysconf_dir/server.key
33tls_advertise_hosts = *
b6d74252 34tls_dhparam = CONF_ca_dir/dh-param-2048.pem
185b5456
MW
35tls_require_ciphers = ${if or {{={$received_port}{CONF_submission_port}} \
36 {match_ip {$sender_host_address}{+trusted}}} \
37 {CONF_good_ciphers} \
38 {CONF_acceptable_ciphers}}
39tls_verify_certificates = CONF_ca_dir/ca.cert
40tls_verify_hosts = ${if eq{$acl_c_mode}{submission} {} {+allnets}}
41
42DIVERT(null)
43###--------------------------------------------------------------------------
44### Check source addresses for apparently local senders.
45
46SECTION(acl, mail-hooks)m4_dnl
47 ## Check that a submitted message's sender address is allowable.
48 require acl = mail_client_addr
49
50 ## Insist that a local client connect through TLS.
51 deny message = Hosts within CONF_master_domain must use TLS
52 !condition = ${if eq{$acl_c_mode}{submission}}
53 hosts = +allnets
54 !encrypted = *
55
56SECTION(acl, misc)m4_dnl
57mail_client_addr:
58
59 ## If this is a message submission then that's handled elsewhere.
60 accept condition = ${if eq{$acl_c_mode}{submission}}
61
fd37fad5
MW
62 ## Make sure that the sender matches the client address. I feel like
63 ## I want to reject these, but that will break stuff. For example,
64 ## if I send mail to an externally hosted address which is really a
65 ## distribution list containing some local address, then we'll
66 ## (approximately legitimately) receive mail with an apparently-local
67 ## sender from a remote host.
68 warn !hosts = ${LOOKUP_DOMAIN($sender_address_domain,
185b5456
MW
69 {KV(hosts, {$value}{+allnets})},
70 {${if match_domain {$sender_address_domain} \
71 {+public} \
72 {+allnets}{! +allnets}}})}
fd37fad5
MW
73 add_header = :after_received:X-Distorted-Warning: \
74 RCLNTLSNDR \
75 Apparently local sender, but received from remote \
c1709c7f
MW
76 server.\n\t\
77 sender=$sender_address, \
78 host=$sender_host_address
185b5456
MW
79
80 ## OK.
81 accept
82
83DIVERT(null)
84###--------------------------------------------------------------------------
85### The obvious trivial router.
86
87SECTION(routers, remote)m4_dnl
88## Send mail on to a host in our own network. We must apply extra security.
89local:
90 driver = dnslookup
91 domains = ! +known : *.CONF_master_domain
92 self = fail
93 transport = smtp_local
94 no_more
95
96## Send mail on to unknown hosts.
97remote:
98 driver = dnslookup
99 domains = ! +known
100 self = fail
101 transport = smtp
102 no_more
103
104DIVERT(null)
105###----- That's all, folks --------------------------------------------------