Use compressed form of ipv6 in $sender_host_address under -bh. Bug 3027
[exim.git] / test / confs / 2112
1 # Exim test configuration 2112
2 # TLS client: verify certificate from server - fails
3
4 SERVER=
5
6 .include DIR/aux-var/tls_conf_prefix
7
8 primary_hostname = myhost.test.ex
9
10 FX = DIR/aux-fixed
11 S1 = FX/exim-ca/example.com/server1.example.com
12
13 CA1 =   S1/ca_chain.pem 
14 CERT1 = S1/server1.example.com.pem
15 KEY1 =  S1/server1.example.com.unlocked.key
16 CA2 =   FX/cert2
17 CERT2 = FX/cert2
18 KEY2 =  FX/cert2
19
20 # ----- Main settings -----
21
22 acl_smtp_rcpt = accept
23
24 log_selector =  +tls_peerdn+tls_certificate_verified +received_recipients
25
26 queue_only
27 queue_run_in_order
28
29 tls_advertise_hosts = *
30
31 # Set certificate only if server
32
33 tls_certificate = ${if eq {SERVER}{server}{CERT1}fail}
34 tls_privatekey = ${if eq {SERVER}{server}{KEY1}fail}
35
36 tls_verify_hosts = *
37 tls_verify_certificates = ${if eq {SERVER}{server}{CERT2}fail}
38
39
40 # ----- Routers -----
41
42 begin routers
43
44 server_dump:
45   driver = redirect
46   condition = ${if eq {SERVER}{server}{yes}{no}}
47   data = :blackhole:
48
49 client_x:
50   driver = accept
51   local_parts = userx
52   retry_use_local_part
53   transport = send_to_server_failcert
54   errors_to = ""
55
56 client_y:
57   driver = accept
58   local_parts = usery
59   retry_use_local_part
60   transport = send_to_server_retry
61
62 client_z:
63   driver = accept
64   local_parts = userz
65   retry_use_local_part
66   transport = send_to_server_crypt
67
68 client_q:
69   driver = accept
70   local_parts = userq
71   retry_use_local_part
72   transport = send_to_server_req_fail
73
74 client_r:
75   driver = accept
76   local_parts = userr
77   retry_use_local_part
78   transport = send_to_server_req_failname
79
80 client_s:
81   driver = accept
82   local_parts = user_s
83   retry_use_local_part
84   transport = send_to_server_req_passname
85
86 client_t:
87   driver = accept
88   local_parts = usert
89   retry_use_local_part
90   transport = send_to_server_req_failchain
91
92 client_u:
93   driver = accept
94   local_parts = useru
95   retry_use_local_part
96   transport = send_to_server_req_passchain
97
98
99 # ----- Transports -----
100
101 begin transports
102
103 # this will fail to verify the cert at HOSTIPV4 so fail the crypt requirement
104 send_to_server_failcert:
105   driver = smtp
106   allow_localhost
107   hosts = HOSTIPV4
108   port = PORT_D
109   hosts_try_fastopen = :
110   hosts_require_tls = HOSTIPV4
111   tls_certificate = CERT2
112   tls_privatekey = CERT2
113
114   tls_verify_certificates = CA2
115   tls_try_verify_hosts =
116   tls_verify_cert_hostnames =
117
118 # this will fail to verify the cert at HOSTIPV4 so fail the crypt, then retry on 127.1; ok
119 send_to_server_retry:
120   driver = smtp
121   allow_localhost
122   hosts = HOSTIPV4 : 127.0.0.1
123   port = PORT_D
124   hosts_try_fastopen = :
125   hosts_require_tls = HOSTIPV4
126   tls_certificate = CERT2
127   tls_privatekey = CERT2
128
129   tls_verify_certificates = \
130     ${if eq{$host_address}{127.0.0.1}{CA1}{CA2}}
131   tls_try_verify_hosts =
132   tls_verify_cert_hostnames =
133
134 # this will fail to verify the cert but continue unverified though crypted
135 send_to_server_crypt:
136   driver = smtp
137   allow_localhost
138   hosts = HOSTIPV4
139   port = PORT_D
140   hosts_try_fastopen = :
141   hosts_require_tls = HOSTIPV4
142   tls_certificate = CERT2
143   tls_privatekey = CERT2
144
145   tls_verify_certificates = CA2
146   tls_try_verify_hosts = *
147   tls_verify_cert_hostnames =
148
149 # this will fail to verify the cert at HOSTIPV4 and fallback to unencrypted
150 send_to_server_req_fail:
151   driver = smtp
152   allow_localhost
153   hosts = HOSTIPV4
154   port = PORT_D
155   hosts_try_fastopen = :
156   tls_certificate = CERT2
157   tls_privatekey = CERT2
158
159   tls_verify_certificates = CA2
160   tls_verify_hosts = *
161   tls_verify_cert_hostnames =
162
163 # this will fail to verify the cert name and fallback to unencrypted
164 send_to_server_req_failname:
165    driver =             smtp
166    allow_localhost
167    hosts =              serverbadname.example.com
168    port =               PORT_D
169   hosts_try_fastopen =  :
170    tls_certificate =    CERT2
171    tls_privatekey =     CERT2
172  
173    tls_verify_certificates =    CA1
174    tls_verify_cert_hostnames =  HOSTIPV4
175    tls_verify_hosts =           *
176  
177 # this will pass the cert verify including name check
178 send_to_server_req_passname:
179    driver =             smtp
180    allow_localhost
181    hosts =              server1.example.com
182    port =               PORT_D
183   hosts_try_fastopen =  :
184    tls_certificate =    CERT2
185    tls_privatekey =     CERT2
186  
187    tls_verify_certificates =    CA1
188    tls_verify_cert_hostnames =  HOSTIPV4
189    tls_verify_hosts =           *
190
191  # this will fail the cert verify name check, because CNAME rules
192  send_to_server_req_failchain:
193    driver =             smtp
194    allow_localhost
195    hosts =              serverchain1.example.com
196    port =               PORT_D
197    hosts_try_fastopen = :
198    tls_certificate =    CERT2
199    tls_privatekey =     CERT2
200  
201    tls_verify_certificates =    CA1
202    tls_verify_cert_hostnames =  HOSTIPV4
203    tls_verify_hosts =           *
204
205  # this will pass the cert verify name check, because CNAME rules
206  send_to_server_req_passchain:
207    driver =             smtp
208    allow_localhost
209    hosts =              alternatename.server1.example.com
210    port =               PORT_D
211    hosts_try_fastopen = :
212    tls_certificate =    CERT2
213    tls_privatekey =     CERT2
214
215    tls_verify_certificates =    CA1
216    tls_verify_cert_hostnames =  HOSTIPV4
217    tls_verify_hosts =           *
218
219 # End