]> git.pld-linux.org Git - packages/exim.git/blame - exim4.conf
- exim 4.32
[packages/exim.git] / exim4.conf
CommitLineData
a59efb33
AM
1######################################################################
2# Runtime configuration file for Exim #
3######################################################################
4
5
6# This is a default configuration file which will operate correctly in
7# uncomplicated installations. Please see the manual for a complete list
8# of all the runtime configuration options that can be included in a
9# configuration file. There are many more than are mentioned here. The
10# manual is in the file doc/spec.txt in the Exim distribution as a plain
11# ASCII file. Other formats (PostScript, Texinfo, HTML, PDF) are available
12# from the Exim ftp sites. The manual is also online at the Exim web sites.
13
14
15# This file is divided into several parts, all but the first of which are
16# headed by a line starting with the word "begin". Only those parts that
17# are required need to be present. Blank lines, and lines starting with #
18# are ignored.
19
20
21########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
22# #
23# Whenever you change Exim's configuration file, you *must* remember to #
24# HUP the Exim daemon, because it will not pick up the new configuration #
25# until you do. However, any other Exim processes that are started, for #
26# example, a process started by an MUA in order to send a message, will #
27# see the new configuration as soon as it is in place. #
28# #
29# You do not need to HUP the daemon for changes in auxiliary files that #
30# are referenced from this file. They are read every time they are used. #
31# #
32# It is usually a good idea to test a new configuration for syntactic #
33# correctness before installing it (for example, by running the command #
34# "exim -C /config/file.new -bV"). #
35# #
36########### IMPORTANT ########## IMPORTANT ########### IMPORTANT ###########
37
38
39
40######################################################################
41# MAIN CONFIGURATION SETTINGS #
42######################################################################
43
44# Specify your host's canonical name here. This should normally be the fully
45# qualified "official" name of your host. If this option is not set, the
46# uname() function is called to obtain the name. In many cases this does
47# the right thing and you need not set anything explicitly.
48
49# primary_hostname =
50
51
52# The next three settings create two lists of domains and one list of hosts.
53# These lists are referred to later in this configuration using the syntax
54# +local_domains, +relay_to_domains, and +relay_from_hosts, respectively. They
55# are all colon-separated lists:
56
57domainlist local_domains = @
58domainlist relay_to_domains =
59hostlist relay_from_hosts = 127.0.0.1
60
a3c8a76a 61# If You wish to enable support for clam antivirus, uncomment the following
42952ff9
ŁJM
62# lines here, and search for 'acl' section of this file (look for 'begin acl'
63# keyword). This will require clamav package to be installed and configured.
a3c8a76a 64# Other antivirus engines are also supported. Read
42952ff9
ŁJM
65# /usr/share/doc/exim-*/exiscan-acl-spec.txt.gz for more info.
66
67# av_scanner = clamd:/var/lib/clamav/clamd.socket
68# acl_smtp_data = acl_check_data
69
4fd05b1b
ŁJM
70# You can use self-signed cerficates (you will need openssl-tools package):
71
72# openssl genrsa -out /etc/openssl/mail.key 1024
73# openssl req -new -x509 -days 365 -key /etc/openssl/mail.key -out /etc/openssl/mail.crt
74
a59efb33
AM
75# Most straightforward access control requirements can be obtained by
76# appropriate settings of the above options. In more complicated situations, you
77# may need to modify the Access Control List (ACL) which appears later in this
78# file.
79
80# The first setting specifies your local domains, for example:
81#
82# domainlist local_domains = my.first.domain : my.second.domain
83#
84# You can use "@" to mean "the name of the local host", as in the default
85# setting above. This is the name that is specified by primary_hostname,
86# as specified above (or defaulted). If you do not want to do any local
87# deliveries, remove the "@" rom the setting above. If you want to accept mail
88# addressed to your host's literal IP address, for example, mail addressed to
89# "user@[192.168.23.44]", you can add "@[]" as an item in the local domains
90# list. You also need to uncomment "allow_domain_literals" below. This is not
91# recommended for today's Internet.
92
93# The second setting specifies domains for which your host is an incoming relay.
94# If you are not doing any relaying, you should leave the list empty. However,
95# if your host is an MX backup or gateway of some kind for some domains, you
96# must set relay_to_domains to match those domains. For example:
97#
98# domainlist relay_to_domains = *.myco.com : my.friend.org
99#
100# This will allow any host to relay through your host to those domains.
101# See the section of the manual entitled "Control of relaying" for more
102# information.
103
104# The third setting specifies hosts that can use your host as an outgoing relay
105# to any other host on the Internet. Such a setting commonly refers to a
106# complete local network as well as the localhost. For example:
107#
108# hostlist relay_from_hosts = 127.0.0.1 : 192.168.0.0/16
109#
110# The "/16" is a bit mask (CIDR notation), not a number of hosts. Note that you
111# have to include 127.0.0.1 if you want to allow processes on your host to send
112# SMTP mail by using the loopback address. A number of MUAs use this method of
113# sending mail.
114
115
116# All three of these lists may contain many different kinds of item, including
117# wildcarded names, regular expressions, and file lookups. See the reference
118# manual for details. The lists above are used in the access control list for
119# incoming messages. The name of this ACL is defined here:
120
121acl_smtp_rcpt = acl_check_rcpt
122
123# You should not change that setting until you understand how ACLs work.
124
125
126# Specify the domain you want to be added to all unqualified addresses
127# here. An unqualified address is one that does not contain an "@" character
128# followed by a domain. For example, "caesar@rome.ex" is a fully qualified
129# address, but the string "caesar" (i.e. just a login name) is an unqualified
130# email address. Unqualified addresses are accepted only from local callers by
131# default. See the recipient_unqualified_hosts option if you want to permit
132# unqualified addresses from remote sources. If this option is not set, the
133# primary_hostname value is used for qualification.
134
135# qualify_domain =
136
137
138# If you want unqualified recipient addresses to be qualified with a different
139# domain to unqualified sender addresses, specify the recipient domain here.
140# If this option is not set, the qualify_domain value is used.
141
142# qualify_recipient =
143
144
145# The following line must be uncommented if you want Exim to recognize
146# addresses of the form "user@[10.11.12.13]" that is, with a "domain literal"
147# (an IP address) instead of a named domain. The RFCs still require this form,
148# but it makes little sense to permit mail to be sent to specific hosts by
149# their IP address in the modern Internet. This ancient format has been used
150# by those seeking to abuse hosts by using them for unwanted relaying. If you
151# really do want to support domain literals, uncomment the following line, and
152# see also the "domain_literal" router below.
153
154# allow_domain_literals
155
156
157# No deliveries will ever be run under the uids of these users (a colon-
158# separated list). An attempt to do so causes a panic error to be logged, and
159# the delivery to be deferred. This is a paranoic safety catch. Note that the
160# default setting means you cannot deliver mail addressed to root as if it
161# were a normal user. This isn't usually a problem, as most sites have an alias
162# for root that redirects such mail to a human administrator.
163
164never_users = root
165
166
167# The setting below causes Exim to do a reverse DNS lookup on all incoming
168# IP calls, in order to get the true host name. If you feel this is too
169# expensive, you can specify the networks for which a lookup is done, or
170# remove the setting entirely.
171
172host_lookup = *
173
174
175# The settings below, which are actually the same as the defaults in the
176# code, cause Exim to make RFC 1413 (ident) callbacks for all incoming SMTP
177# calls. You can limit the hosts to which these calls are made, and/or change
178# the timeout that is used. If you set the timeout to zero, all RFC 1413 calls
179# are disabled. RFC 1413 calls are cheap and can provide useful information
180# for tracing problem messages, but some hosts and firewalls have problems
181# with them. This can result in a timeout instead of an immediate refused
182# connection, leading to delays on starting up an SMTP session.
183
184rfc1413_hosts = *
185rfc1413_query_timeout = 30s
186
187
188# By default, Exim expects all envelope addresses to be fully qualified, that
189# is, they must contain both a local part and a domain. If you want to accept
190# unqualified addresses (just a local part) from certain hosts, you can specify
191# these hosts by setting one or both of
192#
193# sender_unqualified_hosts =
194# recipient_unqualified_hosts =
195#
196# to control sender and recipient addresses, respectively. When this is done,
197# unqualified addresses are qualified using the settings of qualify_domain
198# and/or qualify_recipient (see above).
199
200
201# If you want Exim to support the "percent hack" for certain domains,
202# uncomment the following line and provide a list of domains. The "percent
203# hack" is the feature by which mail addressed to x%y@z (where z is one of
204# the domains listed) is locally rerouted to x@y and sent on. If z is not one
205# of the "percent hack" domains, x%y is treated as an ordinary local part. This
206# hack is rarely needed nowadays; you should not enable it unless you are sure
207# that you really need it.
208#
209# percent_hack_domains =
210#
211# As well as setting this option you will also need to remove the test
212# for local parts containing % in the ACL definition below.
213
214
215# When Exim can neither deliver a message nor return it to sender, it "freezes"
216# the delivery error message (aka "bounce message"). There are also other
217# circumstances in which messages get frozen. They will stay on the queue for
218# ever unless one of the following options is set.
219
220# This option unfreezes frozen bounce messages after two days, tries
221# once more to deliver them, and ignores any delivery failures.
222
223ignore_bounce_errors_after = 2d
224
225# This option cancels (removes) frozen messages that are older than a week.
226
227timeout_frozen_after = 7d
228
229
230
231######################################################################
232# ACL CONFIGURATION #
233# Specifies access control lists for incoming SMTP mail #
234######################################################################
235
236begin acl
237
42952ff9
ŁJM
238# This access control list is used for every message after DATA command in
239# incoming SMTP connection. It's used mainly for malware (viruses) scanning.
240# Uncomment it, 'av_scanner' and 'acl_smtp_data' to enable support for
a3c8a76a 241# antivirus software. Read /usr/share/doc/exim-*/exiscan-acl-spec.txt.gz
42952ff9
ŁJM
242# for detailed instructions. Also remember to change 'mysecret' to
243# something else. This will add cryptographic "checks done" header that
244# will prevent re-scanning when the message re-visits one of your mail
245# servers, and the body size did not change.
246
247# acl_check_data:
248#
249# accept condition = ${if eq {${hmac{md5}{mysecret}{$body_linecount}}}{$h_X-Scan-Signature:} {1}{0}}
250#
251# deny message = $found_extension files are not accepted here
252# demime = com:vbs:bat:pif:scr
253#
254# warn message = X-MIME-Warning: Serious MIME defect detected ($demime_reason)
255# demime = *
256# condition = ${if >{$demime_errorlevel}{2}{1}{0}}
257#
258# deny message = Virus found :$malware_name
259# malware = *
260#
261# warn message = X-Scan-Signature: ${hmac{md5}{mysecret}{$body_linecount}}
262#
263# accept
264
a59efb33
AM
265# This access control list is used for every RCPT command in an incoming
266# SMTP message. The tests are run in order until the address is either
267# accepted or denied.
268
269acl_check_rcpt:
270
271 # Accept if the source is local SMTP (i.e. not over TCP/IP). We do this by
272 # testing for an empty sending host field.
273
274 accept hosts = :
275
276 # Deny if the local part contains @ or % or / or | or !. These are rarely
277 # found in genuine local parts, but are often tried by people looking to
278 # circumvent relaying restrictions.
279
280 deny local_parts = ^.*[@%!/|]
281
282 # Accept mail to postmaster in any local domain, regardless of the source,
283 # and without verifying the sender.
284
285 accept local_parts = postmaster
286 domains = +local_domains
287
288 # Deny unless the sender address can be verified.
289
290 require verify = sender
291
292 #############################################################################
293 # There are no checks on DNS "black" lists because the domains that contain
294 # these lists are changing all the time. However, here are two examples of
295 # how you could get Exim to perform a DNS black list lookup at this point.
296 # The first one denies, while the second just warns.
297 #
298 # deny message = rejected because $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text
299 # dnslists = black.list.example
300 #
301 # warn message = X-Warning: $sender_host_address is in a black list at $dnslist_domain
302 # log_message = found in $dnslist_domain
303 # dnslists = black.list.example
304 #############################################################################
305
306 # Accept if the address is in a local domain, but only if the recipient can
307 # be verified. Otherwise deny. The "endpass" line is the border between
308 # passing on to the next ACL statement (if tests above it fail) or denying
309 # access (if tests below it fail).
310
311 accept domains = +local_domains
312 endpass
313 message = unknown user
314 verify = recipient
315
316 # Accept if the address is in a domain for which we are relaying, but again,
317 # only if the recipient can be verified.
318
319 accept domains = +relay_to_domains
320 endpass
321 message = unrouteable address
322 verify = recipient
323
324 # If control reaches this point, the domain is neither in +local_domains
325 # nor in +relay_to_domains.
326
327 # Accept if the message comes from one of the hosts for which we are an
328 # outgoing relay. Recipient verification is omitted here, because in many
329 # cases the clients are dumb MUAs that don't cope well with SMTP error
330 # responses. If you are actually relaying out from MTAs, you should probably
331 # add recipient verification here.
332
333 accept hosts = +relay_from_hosts
334
335 # Accept if the message arrived over an authenticated connection, from
336 # any host. Again, these messages are usually from MUAs, so recipient
337 # verification is omitted.
338
339 accept authenticated = *
340
341 # Reaching the end of the ACL causes a "deny", but we might as well give
342 # an explicit message.
343
344 deny message = relay not permitted
345
346
347
348######################################################################
349# ROUTERS CONFIGURATION #
350# Specifies how addresses are handled #
351######################################################################
352# THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! #
353# An address is passed to each router in turn until it is accepted. #
354######################################################################
355
356begin routers
357
358# This router routes to remote hosts over SMTP by explicit IP address,
359# when an email address is given in "domain literal" form, for example,
360# <user@[192.168.35.64]>. The RFCs require this facility. However, it is
361# little-known these days, and has been exploited by evil people seeking
362# to abuse SMTP relays. Consequently it is commented out in the default
363# configuration. If you uncomment this router, you also need to uncomment
364# allow_domain_literals above, so that Exim can recognize the syntax of
365# domain literal addresses.
366
367# domain_literal:
368# driver = ipliteral
369# transport = remote_smtp
370
371
372# This router routes addresses that are not in local domains by doing a DNS
373# lookup on the domain name. Any domain that resolves to a loopback interface
374# address (127.0.0.0/8) is treated as if it had no DNS entry. If the DNS
375# lookup fails, no further routers are tried because of the no_more setting,
376# and consequently the address is unrouteable.
377
378dnslookup:
379 driver = dnslookup
380 domains = ! +local_domains
381 transport = remote_smtp
382 ignore_target_hosts = 127.0.0.0/8
383 no_more
384
385
386# The remaining routers handle addresses in the local domain(s).
387
388
0e9140df 389# This router handles aliasing using a traditional /etc/mail/aliases file.
a59efb33 390#
0e9140df 391##### NB You must ensure that /etc/mail/aliases exists. It used to be the case
a59efb33
AM
392##### NB that every Unix had that file, because it was the Sendmail default.
393##### NB These days, there are systems that don't have it. Your aliases
394##### NB file should at least contain an alias for "postmaster".
395#
396# If any of your aliases expand to pipes or files, you will need to set
397# up a user and a group for these deliveries to run under. You can do
398# this by uncommenting the "user" option below (changing the user name
399# as appropriate) and adding a "group" option if necessary. Alternatively, you
400# can specify "user" on the transports that are used. Note that the transports
401# listed below are the same as are used for .forward files; you might want
402# to set up different ones for pipe and file deliveries from aliases.
403
404system_aliases:
405 driver = redirect
406 allow_fail
407 allow_defer
0e9140df 408 data = ${lookup{$local_part}lsearch{/etc/mail/aliases}}
a59efb33
AM
409# user = exim
410 file_transport = address_file
411 pipe_transport = address_pipe
412
413
414# This router handles forwarding using traditional .forward files in users'
415# home directories. If you want it also to allow mail filtering when a forward
416# file starts with the string "# Exim filter", uncomment the "allow_filter"
417# option.
418
419# The no_verify setting means that this router is skipped when Exim is
420# verifying addresses. Similarly, no_expn means that this router is skipped if
421# Exim is processing an EXPN command.
422
423# The check_ancestor option means that if the forward file generates an
424# address that is an ancestor of the current one, the current one gets
425# passed on instead. This covers the case where A is aliased to B and B
426# has a .forward file pointing to A.
427
428# The three transports specified at the end are those that are used when
429# forwarding generates a direct delivery to a file, or to a pipe, or sets
430# up an auto-reply, respectively.
431
432userforward:
433 driver = redirect
434 check_local_user
435 file = $home/.forward
436 no_verify
437 no_expn
438 check_ancestor
439# allow_filter
440 file_transport = address_file
441 pipe_transport = address_pipe
442 reply_transport = address_reply
443
3d67b043 444# Procmail. Uncomment following if you want procmail delivery.
445
446#procmail:
447# driver = accept
448# check_local_user
449# local_part_suffix = DSUFFIX*
450# local_part_suffix_optional
451# require_files = "${local_part}:+${home}/.procmailrc:\
452# +/usr/bin/procmail:!${home}/.forward"
453# transport = procmail_pipe
a59efb33
AM
454
455# This router matches local user mailboxes.
456
457localuser:
458 driver = accept
459 check_local_user
460 transport = local_delivery
461
462
463
464######################################################################
465# TRANSPORTS CONFIGURATION #
466######################################################################
467# ORDER DOES NOT MATTER #
468# Only one appropriate transport is called for each delivery. #
469######################################################################
470
471# A transport is used only when referenced from a router that successfully
472# handles an address.
473
474begin transports
475
476
477# This transport is used for delivering messages over SMTP connections.
478
479remote_smtp:
480 driver = smtp
481
482
483# This transport is used for local delivery to user mailboxes in traditional
484# BSD mailbox format. By default it will be run under the uid and gid of the
485# local user, and requires the sticky bit to be set on the /var/mail directory.
486# Some systems use the alternative approach of running mail deliveries under a
487# particular group instead of using the sticky bit. The commented options below
488# show how this can be done.
489
490local_delivery:
491 driver = appendfile
492 file = /var/mail/$local_part
493 delivery_date_add
494 envelope_to_add
495 return_path_add
29a901ea 496 group = mail
a59efb33
AM
497# mode = 0660
498
3d67b043 499# Procmail transport. Uncomment following if you want procmail delivery
500
501#procmail_pipe:
502# driver = pipe
503# command = "procmail -f-"
504# delivery_date_add
505# envelope_to_add
506# path = "/usr/local/bin:/usr/bin:/bin"
507# return_path_add
508# user = ${local_part}
509# temp_errors= 75 : 75 : 256
510# log_defer_output
511# log_fail_output
512
a59efb33
AM
513
514# This transport is used for handling pipe deliveries generated by alias or
515# .forward files. If the pipe generates any standard output, it is returned
516# to the sender of the message as a delivery error. Set return_fail_output
517# instead of return_output if you want this to happen only when the pipe fails
518# to complete normally. You can set different transports for aliases and
519# forwards if you want to - see the references to address_pipe in the routers
520# section above.
521
522address_pipe:
523 driver = pipe
524 return_output
525
526
527# This transport is used for handling deliveries directly to files that are
528# generated by aliasing or forwarding.
529
530address_file:
531 driver = appendfile
532 delivery_date_add
533 envelope_to_add
534 return_path_add
535
536
537# This transport is used for handling autoreplies generated by the filtering
538# option of the userforward router.
539
540address_reply:
541 driver = autoreply
542
543
544
545######################################################################
546# RETRY CONFIGURATION #
547######################################################################
548
549begin retry
550
551# This single retry rule applies to all domains and all errors. It specifies
552# retries every 15 minutes for 2 hours, then increasing retry intervals,
553# starting at 1 hour and increasing each time by a factor of 1.5, up to 16
554# hours, then retries every 6 hours until 4 days have passed since the first
555# failed delivery.
556
557# Domain Error Retries
558# ------ ----- -------
559
560* * F,2h,15m; G,16h,1h,1.5; F,4d,6h
561
562
563
564######################################################################
565# REWRITE CONFIGURATION #
566######################################################################
567
568# There are no rewriting specifications in this default configuration file.
569
570begin rewrite
571
572
573
574######################################################################
575# AUTHENTICATION CONFIGURATION #
576######################################################################
577
578# There are no authenticator specifications in this default configuration file.
579
580begin authenticators
581
42952ff9
ŁJM
582# Uncomment lines below to enable SMTP AUTH support. Be aware that this
583# requires cyrus-sasl-saslauthd package to be installed.
584
585# plain:
586# driver = plaintext
587# public_name = PLAIN
e794809d 588# server_prompts = :
1c679d11 589# server_condition = ${if saslauthd{{$2}{$3}{smtp}}{1}{0}}
42952ff9
ŁJM
590# server_set_id = $2
591#
592# login:
593# driver = plaintext
594# public_name = LOGIN
595# server_prompts = "Username:: : Password::"
596# server_condition = ${if saslauthd{{$1}{$2}{smtp}}{1}{0}}
597# server_set_id = $1
a59efb33
AM
598
599# End of Exim configuration file
This page took 0.140031 seconds and 4 git commands to generate.