vhost.m4: Don't crash if `domains.conf' doesn't exist.
[exim-config] / base.m4
CommitLineData
185b5456
MW
1### -*-m4-*-
2###
3### Basic settings 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### Global settings.
26
27SECTION(global, priv)m4_dnl
28prod_requires_admin = false
29
30SECTION(global, logging)m4_dnl
31log_file_path = : syslog
32log_selector = \
33 +smtp_confirmation \
34 +tls_peerdn
35log_timezone = true
36syslog_duplication = false
37syslog_timestamp = false
38
39SECTION(global, daemon)m4_dnl
40local_interfaces = <; CONF_interfaces
41extra_local_interfaces = <; 0.0.0.0 ; ::
42
43SECTION(global, resource)m4_dnl
44deliver_queue_load_max = 8
45queue_only_load = 12
46smtp_accept_max = 16
47smtp_accept_queue = 32
48smtp_accept_reserve = 4
49smtp_load_reserve = 10
50smtp_reserve_hosts = +trusted
51
52SECTION(global, policy)m4_dnl
53host_lookup = *
54
55SECTION(global, users)m4_dnl
56gecos_name = $1
57gecos_pattern = ([^,:]*)
58
59SECTION(global, incoming)m4_dnl
60received_header_text = Received: \
61 ${if def:sender_rcvhost {from $sender_rcvhost\n\t} \
62 {${if def:sender_ident \
63 {from ${quote_local_part:$sender_ident} }}\
64 ${if def:sender_helo_name \
65 {(helo=$sender_helo_name)\n\t}}}}\
66 by $primary_hostname \
67 ${if def:received_protocol \
68 {with $received_protocol \
69 ${if def:tls_cipher {(cipher=$tls_cipher)\n\t}}}}\
70 (Exim $version_number)\n\t\
71 ${if def:sender_address \
72 {(envelope-from <$sender_address>\
73 ${if def:authenticated_id \
74 {; auth=$authenticated_id}})\n\t}}\
75 id $message_exim_id\
76 ${if def:received_for {\n\tfor $received_for}}
77
78SECTION(global, smtp)m4_dnl
79smtp_return_error_details = true
80accept_8bitmime = true
81
82SECTION(global, process)m4_dnl
83extract_addresses_remove_arguments = false
84headers_charset = utf-8
85qualify_domain = CONF_master_domain
86
87SECTION(global, bounce)m4_dnl
88delay_warning = 1h : 24h : 2d
89
90DIVERT(null)
91###--------------------------------------------------------------------------
92### Access control lists.
93
94SECTION(global, acl-after)
95SECTION(global, acl)m4_dnl
96acl_smtp_helo = helo
97SECTION(acl, misc)m4_dnl
98helo:
99 require message = The other one has bells on
100 verify = helo
101
102 accept
103
104SECTION(global, acl)m4_dnl
105acl_smtp_mail = mail
106SECTION(acl, mail)m4_dnl
107mail:
108
109 ## Always allow the empty sender, so that we can receive bounces.
110 accept senders = :
111
112 ## Ensure that the sender is routable. This is important to prevent
113 ## undeliverable bounces.
114 require message = Invalid sender; \
115 ($sender_verify_failure; $acl_verify_message)
116 verify = sender
117
118 ## If this is directly from a client then hack on it for a while.
119 warn condition = ${if eq{$acl_c_mode}{submission}}
120 control = submission
121
122SECTION(acl, mail-tail)m4_dnl
123 ## And we're done.
124 accept
125
126SECTION(global, acl)m4_dnl
127acl_smtp_connect = connect
128SECTION(acl, connect)m4_dnl
129connect:
130SECTION(acl, connect-tail)m4_dnl
e12c9586 131 ## Configure variables according to the submission mode.
185b5456 132 warn acl = check_submission
e12c9586
MW
133
134 ## Done.
185b5456
MW
135 accept
136
137check_submission:
138 ## See whether this message needs hacking on.
139 accept !hosts = +localnet
140 !condition = ${if ={$received_port}{CONF_submission_port}}
141 set acl_c_mode = relay
142
143 ## Remember to apply submission controls.
144 warn set acl_c_mode = submission
145
146 ## Done.
147 accept
148
149SECTION(global, acl)m4_dnl
150acl_smtp_rcpt = rcpt
151SECTION(acl, rcpt)m4_dnl
152rcpt:
153
154 ## Reject if the client isn't allowed to relay and the recipient
155 ## isn't in one of our known domains.
156 deny message = Relaying not permitted
157 !hosts = CONF_relay_clients
158 !authenticated = *
159 !domains = +known
160
161 ## Ensure that the recipient is routable.
162 require message = Invalid recipient \
163 ($recipient_verify_failure; $acl_verify_message)
164 verify = recipient
165
166SECTION(acl, rcpt-tail)m4_dnl
167 ## Everything checks out OK: let this one go through.
168 accept
169
170SECTION(global, acl)m4_dnl
171acl_smtp_data = data
172SECTION(acl, data)m4_dnl
173data:
174
175SECTION(acl, data-tail)m4_dnl
176 accept
177
178SECTION(global, acl)m4_dnl
179acl_smtp_expn = expn_vrfy
180acl_smtp_vrfy = expn_vrfy
181SECTION(acl)m4_dnl
182expn_vrfy:
183 accept hosts = +trusted
184 deny message = Suck it and see
185
186DIVERT(null)
187###--------------------------------------------------------------------------
188### Common options for forwarding routers.
189
190## We're pretty permissive here.
191m4_define(<:FILTER_BASE:>,
192 <:driver = redirect
193 modemask = 002
194 check_owner = false
195 check_group = false
196 allow_filter = true
197 allow_defer = true
198 allow_fail = true
199 forbid_blackhole = false
200 check_ancestor = true:>)
201
202## Common options for forwarding routers at verification time.
203m4_define(<:FILTER_VERIFY:>,
204 <:verify_only = true
205 user = CONF_filter_user
206 forbid_filter_dlfunc = true
207 forbid_filter_logwrite = true
208 forbid_filter_perl = true
209 forbid_filter_readsocket = true
210 forbid_filter_run = true
211 file_transport = dummy
212 directory_transport = dummy
213 pipe_transport = dummy
214 reply_transport = dummy:>)
215
216## Transports for redirection filters.
217m4_define(<:FILTER_TRANSPORTS:>,
218 <:file_transport = mailbox
219 directory_transport = maildir
220 pipe_transport = pipe
221 reply_transport = reply:>)
222
223DIVERT(null)
224###--------------------------------------------------------------------------
225### Some standard transports.
226
227m4_define(<:USER_DELIVERY:>,
228 <:delivery_date_add = true
229 envelope_to_add = true
230 return_path_add = true:>)
231
232SECTION(transports)m4_dnl
233## A standard transport for remote delivery. Try to do TLS, and don't worry
234## too much if it's not very secure: the alternative is sending in plaintext
235## anyway.
236smtp:
237 driver = smtp
238 tls_require_ciphers = CONF_acceptable_ciphers
239 tls_dh_min_bits = 1020
240 tls_tempfail_tryclear = true
241
242## Transport to a local SMTP server; use TLS and perform client
243## authentication.
244smtp_local:
245 driver = smtp
246 hosts_require_tls = *
247 tls_certificate = CONF_sysconf_dir/client.cert
248 tls_privatekey = CONF_sysconf_dir/client.key
249 tls_verify_certificates = CONF_ca_dir/ca.cert
250 tls_require_ciphers = CONF_good_ciphers
251 tls_dh_min_bits = 3070
252 tls_tempfail_tryclear = false
253 authenticated_sender = ${if def:authenticated_id \
254 ${authenticated_id@CONF_master_domain} \
255 fail}
256
257## A standard transport for local delivery.
258deliver:
259 driver = appendfile
260 file = /var/mail/$local_part
261 USER_DELIVERY
262
263## Transports for user filters.
264mailbox:
265 driver = appendfile
266 USER_DELIVERY
267
268maildir:
269 driver = appendfile
270 maildir_format = true
271 USER_DELIVERY
272
273pipe:
274 driver = pipe
275 return_output = true
276
277## A special dummy transport for use during address verification.
278dummy:
279 driver = appendfile
280 file = /dev/null
281
282DIVERT(null)
283###--------------------------------------------------------------------------
284### Retry configuration.
285
286SECTION(retry, default)m4_dnl
287## Default.
288* * \
289 F,2h,15m; G,16h,2h,1.5; F,4d,6h
290
291DIVERT(null)
292###----- That's all, folks --------------------------------------------------