]> git.openstreetmap.org Git - chef.git/blob - cookbooks/exim/templates/default/exim4.conf.erb
ec423cc7e729ec198a61493c069abd20ee380e7b
[chef.git] / cookbooks / exim / templates / default / exim4.conf.erb
1 # DO NOT EDIT - This file is being maintained by Chef
2
3 ######################################################################
4 #                  Runtime configuration file for Exim               #
5 ######################################################################
6
7
8 # This is a default configuration file which will operate correctly in
9 # uncomplicated installations. Please see the manual for a complete list
10 # of all the runtime configuration options that can be included in a
11 # configuration file. There are many more than are mentioned here. The
12 # manual is in the file doc/spec.txt in the Exim distribution as a plain
13 # ASCII file. Other formats (PostScript, Texinfo, HTML, PDF) are available
14 # from the Exim ftp sites. The manual is also online at the Exim web sites.
15
16
17 # This file is divided into several parts, all but the first of which are
18 # headed by a line starting with the word "begin". Only those parts that
19 # are required need to be present. Blank lines, and lines starting with #
20 # are ignored.
21
22
23 ########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
24 #                                                                          #
25 # Whenever you change Exim's configuration file, you *must* remember to    #
26 # HUP the Exim daemon, because it will not pick up the new configuration   #
27 # until you do. However, any other Exim processes that are started, for    #
28 # example, a process started by an MUA in order to send a message, will    #
29 # see the new configuration as soon as it is in place.                     #
30 #                                                                          #
31 # You do not need to HUP the daemon for changes in auxiliary files that    #
32 # are referenced from this file. They are read every time they are used.   #
33 #                                                                          #
34 # It is usually a good idea to test a new configuration for syntactic      #
35 # correctness before installing it (for example, by running the command    #
36 # "exim -C /config/file.new -bV").                                         #
37 #                                                                          #
38 ########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
39
40
41
42 ######################################################################
43 #                    MAIN CONFIGURATION SETTINGS                     #
44 ######################################################################
45
46 # Specify your host's canonical name here. This should normally be the fully
47 # qualified "official" name of your host. If this option is not set, the
48 # uname() function is called to obtain the name. In many cases this does
49 # the right thing and you need not set anything explicitly.
50
51 primary_hostname = <%= node[:fqdn] %>
52
53
54 # The next three settings create two lists of domains and one list of hosts.
55 # These lists are referred to later in this configuration using the syntax
56 # +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They
57 # are all colon-separated lists:
58
59 domainlist local_domains = <%= node[:exim][:local_domains].join(" : ") %>
60 domainlist relay_to_domains = <%= @relay_to_domains.join(" : ") %>
61 hostlist   relay_from_hosts = <; <%= @relay_from_hosts.join(" ; ") %>
62
63 # Most straightforward access control requirements can be obtained by
64 # appropriate settings of the above options. In more complicated situations,
65 # you may need to modify the Access Control Lists (ACLs) which appear later in
66 # this file.
67
68 # The first setting specifies your local domains, for example:
69 #
70 #   domainlist local_domains = my.first.domain : my.second.domain
71 #
72 # You can use "@" to mean "the name of the local host", as in the default
73 # setting above. This is the name that is specified by primary_hostname,
74 # as specified above (or defaulted). If you do not want to do any local
75 # deliveries, remove the "@" from the setting above. If you want to accept mail
76 # addressed to your host's literal IP address, for example, mail addressed to
77 # "user@[192.168.23.44]", you can add "@[]" as an item in the local domains
78 # list. You also need to uncomment "allow_domain_literals" below. This is not
79 # recommended for today's Internet.
80
81 # The second setting specifies domains for which your host is an incoming relay.
82 # If you are not doing any relaying, you should leave the list empty. However,
83 # if your host is an MX backup or gateway of some kind for some domains, you
84 # must set relay_to_domains to match those domains. For example:
85 #
86 # domainlist relay_to_domains = *.myco.com : my.friend.org
87 #
88 # This will allow any host to relay through your host to those domains.
89 # See the section of the manual entitled "Control of relaying" for more
90 # information.
91
92 # The third setting specifies hosts that can use your host as an outgoing relay
93 # to any other host on the Internet. Such a setting commonly refers to a
94 # complete local network as well as the localhost. For example:
95 #
96 # hostlist relay_from_hosts = 127.0.0.1 : 192.168.0.0/16
97 #
98 # The "/16" is a bit mask (CIDR notation), not a number of hosts. Note that you
99 # have to include 127.0.0.1 if you want to allow processes on your host to send
100 # SMTP mail by using the loopback address. A number of MUAs use this method of
101 # sending mail.
102
103 # All three of these lists may contain many different kinds of item, including
104 # wildcarded names, regular expressions, and file lookups. See the reference
105 # manual for details. The lists above are used in the access control lists for
106 # checking incoming messages. The names of these ACLs are defined here:
107
108 acl_smtp_rcpt = acl_check_rcpt
109 acl_smtp_data = acl_check_data
110
111 # You should not change those settings until you understand how ACLs work.
112
113
114 <% if File.exist?("/var/run/clamav/clamd.ctl") -%>
115 # If you are running a version of Exim that was compiled with the content-
116 # scanning extension, you can cause incoming messages to be automatically
117 # scanned for viruses. You have to modify the configuration in two places to
118 # set this up. The first of them is here, where you define the interface to
119 # your scanner. This example is typical for ClamAV; see the manual for details
120 # of what to set for other virus scanners. The second modification is in the
121 # acl_check_data access control list (see below).
122
123 av_scanner = clamd:/var/run/clamav/clamd.ctl
124
125
126 <% end -%>
127 <% if File.exist?("/var/run/spamd.pid") -%>
128 # For spam scanning, there is a similar option that defines the interface to
129 # SpamAssassin. You do not need to set this if you are using the default, which
130 # is shown in this commented example. As for virus scanning, you must also
131 # modify the acl_check_data access control list to enable spam scanning.
132
133 spamd_address = 127.0.0.1 783
134
135
136 <% end -%>
137 # If Exim is compiled with support for TLS, you may want to enable the
138 # following options so that Exim allows clients to make encrypted
139 # connections. In the authenticators section below, there are template
140 # configurations for plaintext username/password authentication. This kind
141 # of authentication is only safe when used within a TLS connection, so the
142 # authenticators will only work if the following TLS settings are turned on
143 # as well.
144
145 # Allow any client to use TLS.
146
147 tls_advertise_hosts = <; !127.0.0.1 ; !::1
148
149 # Specify the location of the Exim server's TLS certificate and private key.
150 # The private key must not be encrypted (password protected). You can put
151 # the certificate and private key in the same file, in which case you only
152 # need the first setting, or in separate files, in which case you need both
153 # options.
154
155 tls_certificate = /etc/ssl/certs/exim.pem
156 tls_privatekey = /etc/ssl/private/exim.key
157
158 # In order to support roaming users who wish to send email from anywhere,
159 # you may want to make Exim listen on other ports as well as port 25, in
160 # case these users need to send email from a network that blocks port 25.
161 # The standard port for this purpose is port 587, the "message submission"
162 # port. See RFC 4409 for details. Microsoft MUAs cannot be configured to
163 # talk the message submission protocol correctly, so if you need to support
164 # them you should also allow TLS-on-connect on the traditional but
165 # non-standard port 465.
166
167 daemon_smtp_ports = <%= node[:exim][:daemon_smtp_ports].join(" : ") %>
168 # tls_on_connect_ports = 465
169
170
171 # Specify the domain you want to be added to all unqualified addresses
172 # here. An unqualified address is one that does not contain an "@" character
173 # followed by a domain. For example, "caesar@rome.example" is a fully qualified
174 # address, but the string "caesar" (i.e. just a login name) is an unqualified
175 # email address. Unqualified addresses are accepted only from local callers by
176 # default. See the recipient_unqualified_hosts option if you want to permit
177 # unqualified addresses from remote sources. If this option is not set, the
178 # primary_hostname value is used for qualification.
179
180 qualify_domain = openstreetmap.org
181
182
183 # If you want unqualified recipient addresses to be qualified with a different
184 # domain to unqualified sender addresses, specify the recipient domain here.
185 # If this option is not set, the qualify_domain value is used.
186
187 qualify_recipient = <%= node[:fqdn] %>
188
189
190 # The following line must be uncommented if you want Exim to recognize
191 # addresses of the form "user@[10.11.12.13]" that is, with a "domain literal"
192 # (an IP address) instead of a named domain. The RFCs still require this form,
193 # but it makes little sense to permit mail to be sent to specific hosts by
194 # their IP address in the modern Internet. This ancient format has been used
195 # by those seeking to abuse hosts by using them for unwanted relaying. If you
196 # really do want to support domain literals, uncomment the following line, and
197 # see also the "domain_literal" router below.
198
199 # allow_domain_literals
200
201
202 # No deliveries will ever be run under the uids of users specified by
203 # never_users (a colon-separated list). An attempt to do so causes a panic
204 # error to be logged, and the delivery to be deferred. This is a paranoic
205 # safety catch. There is an even stronger safety catch in the form of the
206 # FIXED_NEVER_USERS setting in the configuration for building Exim. The list of
207 # users that it specifies is built into the binary, and cannot be changed. The
208 # option below just adds additional users to the list. The default for
209 # FIXED_NEVER_USERS is "root", but just to be absolutely sure, the default here
210 # is also "root".
211
212 # Note that the default setting means you cannot deliver mail addressed to root
213 # as if it were a normal user. This isn't usually a problem, as most sites have
214 # an alias for root that redirects such mail to a human administrator.
215
216 never_users = root
217
218
219 # The setting below causes Exim to do a reverse DNS lookup on all incoming
220 # IP calls, in order to get the true host name. If you feel this is too
221 # expensive, you can specify the networks for which a lookup is done, or
222 # remove the setting entirely.
223
224 host_lookup = *
225
226
227 # The settings below, which are actually the same as the defaults in the
228 # code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP
229 # calls. You can limit the hosts to which these calls are made, and/or change
230 # the timeout that is used. If you set the timeout to zero, all RFC 1413 calls
231 # are disabled. RFC 1413 calls are cheap and can provide useful information
232 # for tracing problem messages, but some hosts and firewalls have problems
233 # with them. This can result in a timeout instead of an immediate refused
234 # connection, leading to delays on starting up SMTP sessions. (The default was
235 # reduced from 30s to 5s for release 4.61.)
236
237 rfc1413_hosts = *
238 rfc1413_query_timeout = 5s
239
240
241 # By default, Exim expects all envelope addresses to be fully qualified, that
242 # is, they must contain both a local part and a domain. If you want to accept
243 # unqualified addresses (just a local part) from certain hosts, you can specify
244 # these hosts by setting one or both of
245 #
246 # sender_unqualified_hosts =
247 # recipient_unqualified_hosts =
248 #
249 # to control sender and recipient addresses, respectively. When this is done,
250 # unqualified addresses are qualified using the settings of qualify_domain
251 # and/or qualify_recipient (see above).
252
253
254 # If you want Exim to support the "percent hack" for certain domains,
255 # uncomment the following line and provide a list of domains. The "percent
256 # hack" is the feature by which mail addressed to x%y@z (where z is one of
257 # the domains listed) is locally rerouted to x@y and sent on. If z is not one
258 # of the "percent hack" domains, x%y is treated as an ordinary local part. This
259 # hack is rarely needed nowadays; you should not enable it unless you are sure
260 # that you really need it.
261 #
262 # percent_hack_domains =
263 #
264 # As well as setting this option you will also need to remove the test
265 # for local parts containing % in the ACL definition below.
266
267
268 # When Exim can neither deliver a message nor return it to sender, it "freezes"
269 # the delivery error message (aka "bounce message"). There are also other
270 # circumstances in which messages get frozen. They will stay on the queue for
271 # ever unless one of the following options is set.
272
273 # This option unfreezes frozen bounce messages after two days, tries
274 # once more to deliver them, and ignores any delivery failures.
275
276 ignore_bounce_errors_after = 2d
277
278 # This option cancels (removes) frozen messages that are older than a week.
279
280 timeout_frozen_after = 7d
281
282
283 # By default, messages that are waiting on Exim's queue are all held in a
284 # single directory called "input" which it itself within Exim's spool
285 # directory. (The default spool directory is specified when Exim is built, and
286 # is often /var/spool/exim/.) Exim works best when its queue is kept short, but
287 # there are circumstances where this is not always possible. If you uncomment
288 # the setting below, messages on the queue are held in 62 subdirectories of
289 # "input" instead of all in the same directory. The subdirectories are called
290 # 0, 1, ... A, B, ... a, b, ... z. This has two benefits: (1) If your file
291 # system degrades with many files in one directory, this is less likely to
292 # happen; (2) Exim can process the queue one subdirectory at a time instead of
293 # all at once, which can give better performance with large queues.
294
295 # split_spool_directory = true
296
297
298 # Log just about everything we can log so that we have the best
299 # possible chance of knowing what's going on.
300
301 log_selector = +all -skip_delivery
302
303
304 # Define trusted users.
305
306 trusted_users = <%= node[:exim][:trusted_users].join(" : ") %>
307
308
309 # Don't keep any environment when starting programs - this is the
310 # default but setting it stops exim warning
311
312 keep_environment =
313
314
315
316 ######################################################################
317 #                       ACL CONFIGURATION                            #
318 #         Specifies access control lists for incoming SMTP mail      #
319 ######################################################################
320
321 begin acl
322
323 # This access control list is used for every RCPT command in an incoming
324 # SMTP message. The tests are run in order until the address is either
325 # accepted or denied.
326
327 acl_check_rcpt:
328
329   # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by
330   # testing for an empty sending host field.
331
332   accept  hosts = :
333           control = dkim_disable_verify
334
335   #############################################################################
336   # The following section of the ACL is concerned with local parts that contain
337   # @ or % or ! or / or | or dots in unusual places.
338   #
339   # The characters other than dots are rarely found in genuine local parts, but
340   # are often tried by people looking to circumvent relaying restrictions.
341   # Therefore, although they are valid in local parts, these rules lock them
342   # out, as a precaution.
343   #
344   # Empty components (two dots in a row) are not valid in RFC 2822, but Exim
345   # allows them because they have been encountered. (Consider local parts
346   # constructed as "firstinitial.secondinitial.familyname" when applied to
347   # someone like me, who has no second initial.) However, a local part starting
348   # with a dot or containing /../ can cause trouble if it is used as part of a
349   # file name (e.g. for a mailing list). This is also true for local parts that
350   # contain slashes. A pipe symbol can also be troublesome if the local part is
351   # incorporated unthinkingly into a shell command line.
352   #
353   # Two different rules are used. The first one is stricter, and is applied to
354   # messages that are addressed to one of the local domains handled by this
355   # host. The line "domains = +local_domains" restricts it to domains that are
356   # defined by the "domainlist local_domains" setting above. The rule  blocks
357   # local parts that begin with a dot or contain @ % ! / or |. If you have
358   # local accounts that include these characters, you will have to modify this
359   # rule.
360
361   deny    message       = Restricted characters in address
362           domains       = +local_domains
363           local_parts   = ^[.] : ^.*[@%!/|]
364
365   # The second rule applies to all other domains, and is less strict. The line
366   # "domains = !+local_domains" restricts it to domains that are NOT defined by
367   # the "domainlist local_domains" setting above. The exclamation mark is a
368   # negating operator. This rule allows your own users to send outgoing
369   # messages to sites that use slashes and vertical bars in their local parts.
370   # It blocks local parts that begin with a dot, slash, or vertical bar, but
371   # allows these characters within the local part. However, the sequence /../
372   # is barred. The use of @ % and ! is blocked, as before. The motivation here
373   # is to prevent your users (or your users' viruses) from mounting certain
374   # kinds of attack on remote sites.
375
376   deny    message       = Restricted characters in address
377           domains       = !+local_domains
378           local_parts   = ^[./|] : ^.*[@!] : ^.*/\\.\\./
379   #############################################################################
380
381   # Block bounces to selected addresses
382
383   deny    local_parts   = root:postmaster:webmaster:abuse:support
384           senders       = :
385
386   # Block sender of spam backscatter
387
388   deny    senders       = www-data@www.easyticket.de:*@email.realestate.co.nz:sipdentistry@mail.mediaworksonline.com:www-data@*.consoglobe.com:lina-noreply@jobstreet.com:apache@704210-web2.tristatecamera.com:webmaster@openstreetmap.org:noreply@pring.co.uk
389           !hosts        = +relay_from_hosts
390
391   # Accept mail to postmaster in any local domain, regardless of the source,
392   # and without verifying the sender.
393
394   accept  local_parts   = postmaster
395           domains       = +local_domains
396
397   # Deny incoming mail unless the sender address can be verified.
398
399   deny   !hosts         = +relay_from_hosts
400          !verify        = sender
401
402   # Accept if the message comes from one of the hosts for which we are an
403   # outgoing relay. It is assumed that such hosts are most likely to be MUAs,
404   # so we set control=submission to make Exim treat the message as a
405   # submission. It will fix up various errors in the message, for example, the
406   # lack of a Date: header line. If you are actually relaying out out from
407   # MTAs, you may want to disable this. If you are handling both relaying from
408   # MTAs and submissions from MUAs you should probably split them into two
409   # lists, and handle them differently.
410
411   # Recipient verification is omitted here, because in many cases the clients
412   # are dumb MUAs that don't cope well with SMTP error responses. If you are
413   # actually relaying out from MTAs, you should probably add recipient
414   # verification here.
415
416   # Note that, by putting this test before any DNS black list checks, you will
417   # always accept from these hosts, even if they end up on a black list. The
418   # assumption is that they are your friends, and if they get onto a black
419   # list, it is a mistake.
420
421   accept  hosts         = +relay_from_hosts
422           control       = submission
423           control       = dkim_disable_verify
424
425   # Accept if the message arrived over an authenticated connection, from
426   # any host. Again, these messages are usually from MUAs, so recipient
427   # verification is omitted, and submission mode is set. And again, we do this
428   # check before any black list tests.
429
430   accept  authenticated = *
431           control       = submission
432           control       = dkim_disable_verify
433
434   # Insist that any other recipient address that we accept is either in one of
435   # our local domains, or is in a domain for which we explicitly allow
436   # relaying. Any other domain is rejected as being unacceptable for relaying.
437
438   require message = relay not permitted
439           domains = +local_domains : +relay_to_domains
440
441   # We also require all accepted addresses to be verifiable. This check will
442   # do local part verification for local domains, but only check the domain
443   # for remote domains. The only way to check local parts for the remote
444   # relay domains is to use a callout (add /callout), but please read the
445   # documentation about callouts before doing this.
446
447   require verify = recipient
448
449 <% if node[:exim][:dns_blacklists] -%>
450   # Deny any messages from hosts in certain blacklists.
451
452   deny    message       = Rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
453           dnslists      = <%= node[:exim][:dns_blacklists].join(" : ") %>
454
455 <% end -%>
456   #############################################################################
457   # This check is commented out because it is recognized that not every
458   # sysadmin will want to do it. If you enable it, the check performs
459   # Client SMTP Authorization (csa) checks on the sending host. These checks
460   # do DNS lookups for SRV records. The CSA proposal is currently (May 2005)
461   # an Internet draft. You can, of course, add additional conditions to this
462   # ACL statement to restrict the CSA checks to certain hosts only.
463   #
464   # require verify = csa
465   #############################################################################
466
467   # At this point, the address has passed all the checks that have been
468   # configured, so we accept it unconditionally.
469
470   accept
471
472
473 # This ACL is used after the contents of a message have been received. This
474 # is the ACL in which you can test a message's headers or body, and in
475 # particular, this is where you can invoke external virus or spam scanners.
476 # Some suggested ways of configuring these tests are shown below, commented
477 # out. Without any tests, this ACL accepts all messages. If you want to use
478 # such tests, you must ensure that Exim is compiled with the content-scanning
479 # extension (WITH_CONTENT_SCAN=yes in Local/Makefile).
480
481 acl_check_data:
482
483 <% if File.exist?("/var/run/clamav/clamd.ctl") -%>
484   # Deny if the message contains a virus. Before enabling this check, you
485   # must install a virus scanner and set the av_scanner option above.
486   #
487   deny    demime     = *
488           malware    = *
489           message    = This message contains a virus ($malware_name).
490
491 <% end -%>
492 <% if File.exist?("/var/run/spamd.pid") -%>
493   # Deny if the message looks like spam. Before enabling this check, you
494   # must install spamassassin and set the spamd_address option above.
495   #
496   deny    spam       = nobody/deferok
497           message    = This message scored $spam_score SpamAssassin points.
498
499 <% end -%>
500   # Deny spammy messages with headers of the form:
501   #   X-PHP-Originating-Script: <digits>:<name>.php
502   #   X-PHP-Originating-Script: <digits>:<name>.class.php
503   deny    condition  = ${if match {$h_X-PHP-Originating-Script:}{^[0-9]+:[A-Za-z]+(\\.class)?\\.php\$}}
504          !hosts      = +relay_from_hosts
505           message    = This message failed local spam checks.
506
507   # Accept the message.
508
509   accept
510
511
512
513 ######################################################################
514 #                      ROUTERS CONFIGURATION                         #
515 #               Specifies how addresses are handled                  #
516 ######################################################################
517 #     THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT!       #
518 # An address is passed to each router in turn until it is accepted.  #
519 ######################################################################
520
521 begin routers
522
523 # This router handles aliasing using a linearly searched alias file with the
524 # name /etc/aliases. When this configuration is installed automatically,
525 # the name gets inserted into this file from whatever is set in Exim's
526 # build-time configuration. The default path is the traditional /etc/aliases.
527 # If you install this configuration by hand, you need to specify the correct
528 # path in the "data" setting below.
529 #
530 ##### NB  You must ensure that the alias file exists. It used to be the case
531 ##### NB  that every Unix had that file, because it was the Sendmail default.
532 ##### NB  These days, there are systems that don't have it. Your aliases
533 ##### NB  file should at least contain an alias for "postmaster".
534 #
535 # If any of your aliases expand to pipes or files, you will need to set
536 # up a user and a group for these deliveries to run under. You can do
537 # this by uncommenting the "user" option below (changing the user name
538 # as appropriate) and adding a "group" option if necessary. Alternatively, you
539 # can specify "user" on the transports that are used. Note that the transports
540 # listed below are the same as are used for .forward files; you might want
541 # to set up different ones for pipe and file deliveries from aliases.
542
543 system_aliases:
544   driver = redirect
545   domains = !noreply.openstreetmap.org : +local_domains
546   allow_fail
547   allow_defer
548   data = ${lookup{$local_part}lsearch{/etc/aliases}}
549 # user = exim
550   file_transport = address_file
551   pipe_transport = address_pipe
552
553 <% if File.directory?("/var/lib/mailman") -%>
554 # This router handles mail for mailman mailing lists.
555
556 mailman:
557   driver = accept
558   domains = +local_domains
559   condition = ${lookup{$local_part@$domain}lsearch{/var/lib/mailman/data/virtual-mailman}{1}{0}}
560   require_files = /var/lib/mailman/lists/$local_part/config.pck
561   local_part_suffix = -bounces : -bounces+* : \
562                       -confirm+* : -join : -leave : \
563                       -subscribe : -unsubscribe : \
564                       -owner : -request : -admin 
565   local_part_suffix_optional
566   transport = mailman
567
568 <% end -%>
569 # This router handles mail for noreply.openstreetmap.org
570
571 noreply:
572   driver = accept
573   domains = noreply.openstreetmap.org
574   require_files = /etc/exim4/noreply/$local_part
575   transport = noreply
576
577 <% node[:exim][:routes].each do |name,details| -%>
578 # This router handles mail for <%= details[:comment] -%>.
579
580 <%= name -%>:
581 <% if details[:host] -%>
582   driver = manualroute
583 <% else -%>
584   driver = accept
585 <% end -%>
586 <% if details[:domains] -%>
587   domains = <%= details[:domains].join(" : ") %>
588 <% end -%>
589 <% if details[:local_parts] -%>
590   local_parts = <%= details[:local_parts].join(" : ") %>
591   local_part_suffix = +*
592   local_part_suffix_optional
593 <% end -%>
594 <% if details[:host] -%>
595 <% if details[:host].kind_of?(Array) -%>
596   route_data = <%= details[:host].join(":") %> byname
597 <% else -%>
598   route_data = <%= details[:host] %> byname
599 <% end -%>
600   transport = remote_smtp
601 <% else -%>
602   transport = <%= name %>
603 <% end -%>
604
605 <% end -%>
606
607 <% if node[:exim][:smarthost_via] -%>
608 # This router routes addresses that are not in local domains by
609 # forwarding them to a smarthost.
610
611 smarthost:
612   driver = manualroute
613   domains = ! +local_domains
614   transport = remote_smtp
615   route_data = <%= node[:exim][:smarthost_via].gsub(":", "::") -%> byname
616   same_domain_copy_routing = yes
617   no_more
618 <% else -%>
619 # This router routes addresses that are not in local domains by doing a DNS
620 # lookup on the domain name. The exclamation mark that appears in "domains = !
621 # +local_domains" is a negating operator, that is, it can be read as "not". The
622 # recipient's domain must not be one of those defined by "domainlist
623 # local_domains" above for this router to be used.
624 #
625 # If the router is used, any domain that resolves to 0.0.0.0 or to a loopback
626 # interface address (127.0.0.0/8) is treated as if it had no DNS entry. Note
627 # that 0.0.0.0 is the same as 0.0.0.0/32, which is commonly treated as the
628 # local host inside the network stack. It is not 0.0.0.0/0, the default route.
629 # If the DNS lookup fails, no further routers are tried because of the no_more
630 # setting, and consequently the address is unrouteable.
631
632 dnslookup:
633   driver = dnslookup
634   domains = ! +local_domains
635   transport = remote_smtp
636   same_domain_copy_routing = yes
637   ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
638   no_more
639 <% end -%>
640
641
642 ######################################################################
643 #                      TRANSPORTS CONFIGURATION                      #
644 ######################################################################
645 #                       ORDER DOES NOT MATTER                        #
646 #     Only one appropriate transport is called for each delivery.    #
647 ######################################################################
648
649 # A transport is used only when referenced from a router that successfully
650 # handles an address.
651
652 begin transports
653
654
655 # This transport is used for delivering messages over SMTP connections.
656
657 remote_smtp:
658   driver = smtp
659
660
661 # This transport is used for handling pipe deliveries generated by alias or
662 # .forward files. If the pipe generates any standard output, it is returned
663 # to the sender of the message as a delivery error. Set return_fail_output
664 # instead of return_output if you want this to happen only when the pipe fails
665 # to complete normally. You can set different transports for aliases and
666 # forwards if you want to - see the references to address_pipe in the routers
667 # section above.
668
669 address_pipe:
670   driver = pipe
671   return_output
672
673
674 # This transport is used for handling deliveries directly to files that are
675 # generated by aliasing or forwarding.
676
677 address_file:
678   driver = appendfile
679   delivery_date_add
680   envelope_to_add
681   return_path_add
682
683
684 <% if File.directory?("/var/lib/mailman") -%>
685 # This transport is used for handling deliveries to mailman mailing lists.
686
687 mailman:
688   driver = pipe
689   command = /var/lib/mailman/mail/mailman \
690             '${if def:local_part_suffix \
691                   {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}}} \
692                   {post}}' \
693             $local_part
694   current_directory = /var/lib/mailman
695   home_directory = /var/lib/mailman
696   user = list
697   group = daemon
698   freeze_exec_fail = true
699
700
701 <% end -%>
702 # This transport handles mail for noreply.openstreetmap.org
703
704 noreply:
705   driver = autoreply
706   from = OpenStreetMap <noreply@openstreetmap.org>
707   to = $sender_address
708   subject = Re: $header_subject:
709   headers = MIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8
710   file = /etc/exim4/noreply/$local_part
711   user = Debian-exim
712   group = Debian-exim
713
714 <% node[:exim][:routes].each do |name,details| -%>
715 <% if details[:command] or details[:file] or details[:maildir] -%>
716 # This transport handles mail for <%= details[:comment] -%>.
717
718 <%= name -%>:
719 <% if details[:command] -%>
720   driver = pipe
721   command = <%= details[:command] %>
722   home_directory = <%= details[:home_directory] %>
723   path = <%= details[:path] || "/bin:/usr/bin" %>
724   return_output
725 <% else -%>
726   driver = appendfile
727 <% if details[:file] -%>
728   file = <%= details[:file] %>
729 <% elsif details[:maildir] -%>
730   directory = <%= details[:maildir] %>
731   maildir_format
732 <% end -%>
733   envelope_to_add
734   return_path_add
735   mode = 0660
736 <% end -%>
737   user = <%= details[:user] %>
738 <% if details[:group] -%>
739   group = <%= details[:group] %>
740 <% end -%>
741
742 <% end -%>
743 <% end -%>
744
745 ######################################################################
746 #                      RETRY CONFIGURATION                           #
747 ######################################################################
748
749 begin retry
750
751 # This single retry rule applies to all domains and all errors. It specifies
752 # retries every 15 minutes for 2 hours, then increasing retry intervals,
753 # starting at 1 hour and increasing each time by a factor of 1.5, up to 16
754 # hours, then retries every 6 hours until 4 days have passed since the first
755 # failed delivery.
756
757 # WARNING: If you do not have any retry rules at all (this section of the
758 # configuration is non-existent or empty), Exim will not do any retries of
759 # messages that fail to get delivered at the first attempt. The effect will
760 # be to treat temporary errors as permanent. Therefore, DO NOT remove this
761 # retry rule unless you really don't want any retries.
762
763 # Address or Domain    Error       Retries
764 # -----------------    -----       -------
765
766 *                      *           F,2h,15m; G,16h,1h,1.5; F,4d,6h
767
768
769
770 ######################################################################
771 #                      REWRITE CONFIGURATION                         #
772 ######################################################################
773
774 # There are no rewriting specifications in this default configuration file.
775
776 begin rewrite
777 <% node[:exim][:rewrites].each do |rewrite| -%>
778 <%= rewrite[:pattern] %> <%= rewrite[:replacement] %> <%= rewrite[:flags] %>
779 <% end -%>
780
781
782
783 ######################################################################
784 #                   AUTHENTICATION CONFIGURATION                     #
785 ######################################################################
786
787 # The following authenticators support plaintext username/password
788 # authentication using the standard PLAIN mechanism and the traditional
789 # but non-standard LOGIN mechanism, with Exim acting as the server.
790 # PLAIN and LOGIN are enough to support most MUA software.
791 #
792 # These authenticators are not complete: you need to change the
793 # server_condition settings to specify how passwords are verified.
794 # They are set up to offer authentication to the client only if the
795 # connection is encrypted with TLS, so you also need to add support
796 # for TLS. See the global configuration options section at the start
797 # of this file for more about TLS.
798 #
799 # The default RCPT ACL checks for successful authentication, and will accept
800 # messages from authenticated users from anywhere on the Internet.
801
802 begin authenticators
803
804 # PLAIN authentication has no server prompts. The client sends its
805 # credentials in one lump, containing an authorization ID (which we do not
806 # use), an authentication ID, and a password. The latter two appear as
807 # $auth2 and $auth3 in the configuration and should be checked against a
808 # valid username and password. In a real configuration you would typically
809 # use $auth2 as a lookup key, and compare $auth3 against the result of the
810 # lookup, perhaps using the crypteq{}{} condition.
811
812 #PLAIN:
813 #  driver                     = plaintext
814 #  server_set_id              = $auth2
815 #  server_prompts             = :
816 #  server_condition           = Authentication is not yet configured
817 #  server_advertise_condition = ${if def:tls_cipher }
818
819 # LOGIN authentication has traditional prompts and responses. There is no
820 # authorization ID in this mechanism, so unlike PLAIN the username and
821 # password are $auth1 and $auth2. Apart from that you can use the same
822 # server_condition setting for both authenticators.
823
824 #LOGIN:
825 #  driver                     = plaintext
826 #  server_set_id              = $auth1
827 #  server_prompts             = <| Username: | Password:
828 #  server_condition           = Authentication is not yet configured
829 #  server_advertise_condition = ${if def:tls_cipher }
830
831
832 ######################################################################
833 #                   CONFIGURATION FOR local_scan()                   #
834 ######################################################################
835
836 # If you have built Exim to include a local_scan() function that contains
837 # tables for private options, you can define those options here. Remember to
838 # uncomment the "begin" line. It is commented by default because it provokes
839 # an error with Exim binaries that are not built with LOCAL_SCAN_HAS_OPTIONS
840 # set in the Local/Makefile.
841
842 # begin local_scan
843
844
845 # End of Exim configuration file