summaryrefslogtreecommitdiff
path: root/conf.d/030_routers.conf
blob: be3651fbf88f3467afe4e376028658209a9380a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
######################################################################
#                      ROUTERS CONFIGURATION                         #
#               Specifies how addresses are handled                  #
######################################################################
#     THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT!       #
# An address is passed to each router in turn until it is accepted.  #
######################################################################

begin routers

# This router routes to remote hosts over SMTP by explicit IP address,
# when an email address is given in "domain literal" form, for example,
# <user@[192.168.35.64]>. The RFCs require this facility. However, it is
# little-known these days, and has been exploited by evil people seeking
# to abuse SMTP relays. Consequently it is commented out in the default
# configuration. If you uncomment this router, you also need to uncomment
# allow_domain_literals above, so that Exim can recognize the syntax of
# domain literal addresses.

# domain_literal:
#   driver = ipliteral
#   domains = ! +local_domains
#   transport = remote_smtp


localrouting:
  domains             = ! +local_domains
  transport           = remote_smtp
  ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
  driver              = manualroute
  route_data          = ${lookup{$domain}lsearch*{SMTPMAP}}
  host_find_failed    = ignore
  host_all_ignored    = pass


# This router routes addresses that are not in local domains by doing a DNS
# lookup on the domain name. The exclamation mark that appears in "domains = !
# +local_domains" is a negating operator, that is, it can be read as "not". The
# recipient's domain must not be one of those defined by "domainlist
# local_domains" above for this router to be used.
#
# If the router is used, any domain that resolves to 0.0.0.0 or to a loopback
# interface address (127.0.0.0/8) is treated as if it had no DNS entry. Note
# that 0.0.0.0 is the same as 0.0.0.0/32, which is commonly treated as the
# local host inside the network stack. It is not 0.0.0.0/0, the default route.
# If the DNS lookup fails, no further routers are tried because of the no_more
# setting, and consequently the address is unrouteable.

dnslookup:
  driver              = dnslookup
  domains             = ! +local_domains
  transport           = signed_smtp
  ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
  no_more


# This alternative router can be used when you want to send all mail to a
# server which handles DNS lookups for you; an ISP will typically run such
# a server for their customers.  If you uncomment "smarthost" then you
# should comment out "dnslookup" above.  Setting a real hostname in route_data
# wouldn't hurt either.

# smarthost:
#   driver = manualroute
#   domains = ! +local_domains
#   transport = remote_smtp
#   route_data = MAIL.HOSTNAME.FOR.CENTRAL.SERVER.EXAMPLE
#   ignore_target_hosts = <; 0.0.0.0 ; 127.0.0.0/8 ; ::1
#   no_more


# The remaining routers handle addresses in the local domain(s), that is those
# domains that are defined by "domainlist local_domains" above.


# This router handles aliasing using a linearly searched alias file with the
# name /etc/mail/aliases. When this configuration is installed automatically,
# the name gets inserted into this file from whatever is set in Exim's
# build-time configuration. The default path is the traditional /etc/aliases.
# If you install this configuration by hand, you need to specify the correct
# path in the "data" setting below.
#
##### NB  You must ensure that the alias file exists. It used to be the case
##### NB  that every Unix had that file, because it was the Sendmail default.
##### NB  These days, there are systems that don't have it. Your aliases
##### NB  file should at least contain an alias for "postmaster".
#
# If any of your aliases expand to pipes or files, you will need to set
# up a user and a group for these deliveries to run under. You can do
# this by uncommenting the "user" option below (changing the user name
# as appropriate) and adding a "group" option if necessary. Alternatively, you
# can specify "user" on the transports that are used. Note that the transports
# listed below are the same as are used for .forward files; you might want
# to set up different ones for pipe and file deliveries from aliases.

system_aliases:
  driver              = redirect
  allow_fail
  allow_defer
  data                = ${lookup{$local_part}lsearch{/etc/mail/aliases}}
# user                = exim
  file_transport      = address_file
  pipe_transport      = address_pipe


mail_aliases:
  driver              = redirect
  allow_fail
  allow_defer
  data                = ${lookup{$local_part@$domain}lsearch{ALIASMAP}}
  file_transport      = address_file
  pipe_transport      = address_pipe


# This router handles forwarding using traditional .forward files in users'
# home directories. If you want it also to allow mail filtering when a forward
# file starts with the string "# Exim filter" or "# Sieve filter", uncomment
# the "allow_filter" option.

# The no_verify setting means that this router is skipped when Exim is
# verifying addresses. Similarly, no_expn means that this router is skipped if
# Exim is processing an EXPN command.

# If you want this router to treat local parts with suffixes introduced by "-"
# or "+" characters as if the suffixes did not exist, uncomment the two local_
# part_suffix options. Then, for example, xxxx-foo@your.domain will be treated
# in the same way as xxxx@your.domain by this router. Because this router is
# not used for verification, if you choose to uncomment those options, then you
# will *need* to make the same change to the localuser router.  (There are
# other approaches, if this is undesirable, but they add complexity).

# The check_ancestor option means that if the forward file generates an
# address that is an ancestor of the current one, the current one gets
# passed on instead. This covers the case where A is aliased to B and B
# has a .forward file pointing to A.

# The three transports specified at the end are those that are used when
# forwarding generates a direct delivery to a file, or to a pipe, or sets
# up an auto-reply, respectively.

#userforward:
# driver = redirect
# check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
# file = $home/.forward
# allow_filter
# no_verify
# no_expn
# check_ancestor
# file_transport = address_file
# pipe_transport = address_pipe
# reply_transport = address_reply


# This router matches local user mailboxes. If the router fails, the error
# message is "Unknown user".

# If you want this router to treat local parts with suffixes introduced by "-"
# or "+" characters as if the suffixes did not exist, uncomment the two local_
# part_suffix options. Then, for example, xxxx-foo@your.domain will be treated
# in the same way as xxxx@your.domain by this router.

#localuser:
# driver = accept
# check_local_user
# local_part_suffix = +* : -*
# local_part_suffix_optional
# transport = local_delivery
# cannot_route_message = Unknown user


localuser:
  transport           = remote_lmtp
  domains             = +local_domains
  driver              = manualroute
  route_data          = ${lookup{$domain}lsearch*{LMTPMAP}}
  host_find_failed    = ignore
  host_all_ignored    = defer