1 # This is the main exim4 configuration file based on the 28.08.05 version by
3 # It is hand crafted, do not replace with anything generated by a config
5 # It is installed as part of the debian.org package -- don't edit this file
7 # The configuration file uses a set of macros and rules to generate an
8 # acceptable mail environment for debian.org machines. It deviates
9 # considerably from what could be considered a standard exim configuration.
11 # This configuration file brings in the necessary information from
12 # other databases stored in /etc/exim/ right now these are linear text
15 # This file is independent of the local host, it should not be changed
16 # per machine. primary_hostname is used in all places that require per-host
19 # The configuration files in /etc/exim are as follows:
20 # locals - This is a list of domains that are considered local. A local
21 # domain is essential one that deliveries to /var/mail
22 # will be attempted. The users available for local delivery
23 # comes from /etc/passwd and /etc/aliases. Wildcards are not
25 # virtualdomains - This is a list of all virtual domains. A virtual domain
26 # is much like a local domain, execpt that the delivery location
27 # and allowed set of users is controlled by a virtual domain
28 # alias file and not /etc/passwd. Wildcards are permitted
29 # rcpthosts - recipient hosts or relay domains. This is a list of
30 # all hosts that we mail exchange for. All domains that list
31 # this host in their MX records should be listed here. Wildcards
33 # relayhosts - Hostnames that can send any arbitarily addressed mail to
34 # us. This is primarily only usefull for emergancy 'queue
35 # flushing' operations, but should be populated with a list
36 # of trusted machines. Wildcards are not permitted
37 # The division of files is designed so that all hosts may share rcpthosts
38 # and relayhosts, these could be replicated automatically if necessary.
40 # Exim's wildcard mechanism is a bit odd in that to say "any address in
41 # debian.org including debian.org" you must use two patterns,
44 # Also you can only place a * before a . and as the first char in a string.
45 # Wildcards always match last so they may be used as a catchall.
47 # Further details can be found in each of the files.
49 # Usefull exim commands:
50 # exim4 -qf - Try sending all messages right now, including frozen ones
51 # exim4 -bt foo@blah - Write what exim would do if it saw the address
52 # Great for testing virtual domains and forward files
54 # Special Features for users:
55 # .forward-foo - is understood as an extension address for bar-foo@cow.com
56 # .forward-default - is understood to be a catch all for bar-*@cow.com
57 # .procmailrc - with no .forward file invokes procmail for delivery
60 # For virtual domains the first lookup is done against a linear text
61 # database called 'aliases', then .forward files are consulted. Exim
62 # filtering is available for these .forward files only. .forward-default
63 # is the universal catch all for everything not handled.
65 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
66 # will trigger things like rcpt to rate limiting or possibly a reject if
67 # enough hits are triggered.
69 # value is stored in acl_c1
71 ######################################################################
72 # MAIN CONFIGURATION SETTINGS #
73 ######################################################################
75 # These options specify the Access Control Lists (ACLs) that
76 # are used for incoming SMTP messages - after the RCPT and DATA
77 # commands, respectively.
79 acl_smtp_helo = check_helo
80 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
81 acl_smtp_data = check_message
83 # accept domain literal syntax in e-mail addresses. To actually make use of
84 # this a router is also required
85 allow_domain_literals = true
87 # This setting defines a named domain list called
88 # local_domains. It will be referenced
89 # later on by the syntax "+local_domains".
90 # Other domain and host lists may follow.
91 # @ is the local FQDN, @[] matches the IP adress of any local interface.
93 .include_if_exists /etc/exim4/local-auto.conf
94 .include_if_exists /etc/exim4/local-settings.conf
96 domainlist local_domains = @ : \
99 ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
101 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
103 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
105 domainlist handled_domains = +local_domains : +virtual_domains
107 localpartlist local_only_users = lsearch;/etc/exim4/localusers
109 # Domains we relay for; that is domains that aren't considered local but we
110 # accept mail for them.
111 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
112 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
114 .ifndef RESERVEDADDRS
115 RESERVEDADDRS = 0.0.0.0/8 : 127.0.0.0/8 : 10.0.0.0/8 : 169.254.0.0/16 : \
116 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : \
117 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5
120 hostlist reservedaddrs = RESERVEDADDRS
122 #system_filter = /etc/exim4/filter
123 #system_filter_file_transport = address_file
125 # The setting below causes Exim to do a reverse DNS lookup on all incoming
126 # IP calls, in order to get the true host name. If you feel this is too
127 # expensive, you can specify the networks for which a lookup is done, or
128 # remove the setting entirely.
130 dns_ipv4_lookup = !localhost
132 # If this option is set, then any process that is running as one of the
133 # listed users may pass a message to Exim and specify the sender's
134 # address using the "-f" command line option, without Exim's adding a
137 #trusted_users = mail
138 #trusted_users = mail : www-data : ${if exists{/home/qa}{qa}{}}
139 untrusted_set_sender = *
141 # Some operating systems use the "gecos" field in the system password file
142 # to hold other information in addition to users' real names. Exim looks up
143 # this field when it is creating "sender" and "from" headers. If these options
144 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
145 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
148 gecos_pattern = ^([^,:]*)
151 # This tells exim to immediately discard error messages (ie double bounces).
152 ignore_bounce_errors_after = 0s
154 timeout_frozen_after=14d
156 message_size_limit = 100M
158 smtp_accept_max = 300
159 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
160 smtp_accept_queue = 200
161 smtp_accept_queue_per_connection = 50
162 smtp_accept_reserve = 25
163 smtp_reserve_hosts = +debianhosts
165 split_spool_directory = true
166 check_spool_inodes = 200
167 check_spool_space = 20M
172 deliver_queue_load_max = 50
174 queue_list_requires_admin = false
180 .ifdef HAVE_USER_DEBBUGS
181 daemon_smtp_ports = 25 : 587
185 remote_sort_domains = *.debian.org:*.debian.net
187 pipelining_advertise_hosts = !*
188 smtp_enforce_sync = true
190 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
194 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
195 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
196 ${if exists {/srv/$domain/mail/whitelist}{\
197 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
199 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
200 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
201 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
202 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
203 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
204 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
205 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
207 ######################################################################
208 # ACL CONFIGURATION #
209 ######################################################################
215 # These are in HELO acl so that they are only run once. They increment a counter,
216 # so we don't want it to increment per rcpt to.
218 warn dnslists = list.dnswl.org&0.0.0.3
219 log_message = Hit on list.dnswl.org for $sender_host_address
220 set acl_c1 = ${eval:$acl_c1-30}
222 warn dnslists = list.dnswl.org&0.0.0.2
223 log_message = Hit on list.dnswl.org for $sender_host_address
224 set acl_c1 = ${eval:$acl_c1-20}
226 warn dnslists = list.dnswl.org
227 log_message = Hit on list.dnswl.org for $sender_host_address
228 set acl_c1 = ${eval:$acl_c1-10}
230 warn condition = ${if isip {$sender_helo_name}{true}{false}}
231 log_message = remote host used IP address in HELO/EHLO greeting
232 set acl_c1 = ${eval:$acl_c1+20}
234 warn !hosts = +debianhosts
235 condition = ${if eq{$host_lookup_failed}{1}}
236 set acl_c1 = ${eval:$acl_c1+20}
238 warn !hosts = +debianhosts
239 condition = ${if eq{$host_lookup_failed}{0}}
240 condition = ${if match{$sender_host_name}{\N(^[^\.]*[0-9]\-+[0-9]|^[^\.]*[0-9]{5,}[^\.]|^([^\.]+\.)?[0-9][^ \.]*\.[^\.]+\..+\.[a-z]|^[^\.]*[0-9]\.[^\.]*[0-9]-[0-9]|^(dyn|cable|dhcp|dialup|ppp|adsl)[^\.]*[0-9])\N}}
241 set acl_c1 = ${eval:$acl_c1+20}
243 warn !hosts = +debianhosts
244 condition = ${if match{$sender_helo_name}{\N(^[^\.]*[0-9]\-+[0-9]|^[^\.]*[0-9]{5,}[^\.]|^([^\.]+\.)?[0-9][^ \.]*\.[^\.]+\..+\.[a-z]|^[^\.]*[0-9]\.[^\.]*[0-9]-[0-9]|^(dyn|cable|dhcp|dialup|ppp|adsl)[^\.]*[0-9])\N}}
245 set acl_c1 = ${eval:$acl_c1+20}
247 warn !hosts = +debianhosts
248 dnslists = dul.dnsbl.sorbs.net
249 set acl_c1 = ${eval:$acl_c1+15}
251 # If the sender's helo name is empty, the message will be rejected later
252 # because the helo is empty. If the rDNS lookup failed, we are already
253 # going to greylist them, so no sense worrying about it here. Finally,
254 # if rDNS does not match helo name (both lower cased first), greylist.
256 warn !hosts = +debianhosts
257 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
258 condition = ${if def:sender_helo_name {yes}{no}}
259 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
260 log_message = HELO doesn't match rDNS
261 set acl_c1 = ${eval:$acl_c1+8}
264 # matches 098325879 - looks fishy
266 warn condition = ${if and { \
267 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
268 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
271 log_message = non-FQDN HELO
272 set acl_c1 = ${eval:$acl_c1+12}
274 # Matches DOMAIN99.com - looks bad
276 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
277 log_message = SHOUTING HELO
278 set acl_c1 = ${eval:$acl_c1+7}
280 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
281 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
282 # naive test, so it's not worth much
284 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
285 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
286 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
287 log_message = random HELO
288 set acl_c1 = ${eval:$acl_c1+5}
290 # Implicit, but simpler to just say it
293 #!!# ACL that is used after the RCPT command on the submission port
296 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
297 # This is a rough pass at preventing addres harvesting or other mail blasts.
299 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
300 message = Too many bad recipients, try again later
301 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
304 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
305 message = sorry, only 5 reports per hour for submission
307 accept domains = +submission_domains
309 message = unknown user
312 deny message = relay not permitted
314 #!!# ACL that is used after the RCPT command
317 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
318 # This is a rough pass at preventing addres harvesting or other mail blasts.
320 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
321 message = Too many bad recipients, try again later
322 !hosts = +debianhosts
323 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
325 # Dump spambots that are so stupid they say helo as our IP address
327 drop !hosts = +debianhosts
328 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
329 message = HELO mismatch Forged HELO for ($sender_helo_name)
331 # Also for spambots that say helo as us or one of our domains
333 drop !hosts = +debianhosts
334 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
335 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
336 message = HELO mismatch Forged HELO for ($sender_helo_name)
338 # This logic gives you a list of commonly forged domains in helo to reject against
340 warn set acl_m2 = ${lookup{$sender_helo_name} \
341 nwildlsearch{/etc/exim4/helo-check} \
342 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
344 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
345 # say helo as a name in the list but we can't look them up
347 defer !hosts = +debianhosts
348 condition = ${if eq{$acl_m2}{}{no}{yes}}
349 condition = ${if eq{$sender_host_name}{}{yes}{no}}
350 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
351 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
353 # If DNS works, go ahead and reject them
355 drop !hosts = +debianhosts
356 condition = ${if and { {!eq{$acl_m2}{}}{!match{$sender_host_name}{${rxquote:$acl_m2}\N$\N}}}{yes}{no}}
357 message = HELO mismatch Forged HELO for ($sender_helo_name)
359 # disabled accounts don't even get local mail.
360 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
361 domains = +local_domains
362 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
364 deny domains = +virtual_domains
365 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
366 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
368 hosts = !+debianhosts
369 message = mail for <$local_part@$domain> only accepted from debian.org machines
370 # Accept if the source is local SMTP (i.e. not over TCP/IP).
371 # We do this by testing for an empty sending host field.
374 deny domains = +handled_domains
375 local_parts = ^[.] : ^.*[@%!/|]
377 deny domains = !+handled_domains
378 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
380 # forwards mail to @d.o address, even if it's a bounce from master, no reply
381 # from source address; rejecting all mail now.
382 deny recipients = mendoza@debian.org
383 hosts = 65.110.39.147 : 64.39.31.15
384 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
386 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
387 sender_domains= +local_domains : debian.org : debian.net : debian.com
388 hosts = !+debianhosts
389 message = mail from <$sender_address> not allowed externally
391 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
392 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
393 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
394 message = no mail should ever come from <$sender_address>
396 deny local_parts = +local_only_users
397 domains = +local_domains
398 hosts = !+debianhosts
399 message = mail for $local_part is only accepted internally
401 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
402 hosts = !+debianhosts
403 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
405 deny !recipients = survey@popcon.debian.org
408 defer !hosts = +debianhosts
409 condition = ${if >{${eval:$acl_c1}}{0}}
410 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
411 message = slow down (no reverse dns, or dialup)
414 # Check with policyd-weight - this only works with a version after etch's,
415 # sadly. etch's version attempts to hold the socket open, since that's what
416 # postfix expects. Exim, on the other hand, expects the remote side to close
417 # the socket when it's finished sending data, so it see each transaction as
418 # an incomplete read. I'm sure there's a way we could force exim to do
419 # something sick and clever to force either the interpretation or the socket
420 # closure, but I'm fairly sure it's now worth it, since the backport of
421 # policyd-weight is trivial.
422 warn !hosts = +debianhosts
423 set acl_m9 = ${readsocket{inet:127.0.0.1:12525}\
424 {request=smtpd_access_policy\n\
425 protocol_state=RCPT\n\
426 protocol_name=${uc:$received_protocol}\n\
427 helo_name=$sender_helo_name\n\
428 queue_id=$message_exim_id\n\
429 sender=$sender_address\n\
430 recipient=$local_part@$domain\n\
431 recipient_count=$rcpt_count\n\
432 client_address=$sender_host_address\n\
433 client_name=$sender_host_name\n\
434 reverse_client_name=$sender_host_name\n\
435 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
436 {20s}{\n}{socket failure}}
438 # Defer on socket error
439 defer !hosts = +debianhosts
440 condition = ${if eq{$acl_m9}{socket failure}{yes}{no}}
441 message = Cannot connect to policyd-weight. Please try again later.
443 # Set proposed action to $acl_m8 and message to $acl_m7
444 warn !hosts = +debianhosts
445 set acl_m8 = ${extract{action}{$acl_m9}}
446 set acl_m7 = ${sg{$acl_m9}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
448 # Add X-policyd-weight header line to message
449 warn !hosts = +debianhosts
451 condition = ${if eq{$acl_m8}{PREPEND}{yes}{no}}
453 # Write log message, if policyd-weight can't run checks
454 warn !hosts = +debianhosts
455 log_message = policyd-weight message: $acl_m7
456 condition = ${if eq{$acl_m8}{DUNNO}{yes}{no}}
458 # Deny mails which policyd-weight thinks are spam
459 deny !hosts = +debianhosts
460 message = policyd-weight said: $acl_m7
461 condition = ${if eq{$acl_m8}{550}{yes}{no}}
463 # Defer messages when policyd-weight suggests so.
464 defer !hosts = +debianhosts
465 message = policyd-weight said: $acl_m7
466 condition = ${if eq{$acl_m8}{450}{yes}{no}}
469 warn recipients = survey@popcon.debian.org
470 set acl_m1 = PopconMail
472 warn domains = rt.debian.org
474 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if match{$local_part}{[^+]+\\+\\d+} {RTMailRecipientHasSubaddress}}}}
476 warn domains = packages.qa.debian.org
479 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
480 set acl_m1 = PTSOwner
482 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
483 set acl_m1 = DBSignedMail
486 domains = packages.qa.debian.org
487 condition = ${if match{$local_part}{\N^bounces+\N}}
488 set acl_m1 = PTSListBounce
490 .ifdef USE_GREYLISTING
493 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
494 log_message = greylisted.
495 local_parts = ${if match_domain{$domain}{+virtual_domains}\
496 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
497 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
498 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
499 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
501 !hosts = : +debianhosts : WHITELIST : \
502 ${if exists {/etc/greylistd/whitelist-hosts}\
503 {/etc/greylistd/whitelist-hosts}{}} : \
504 ${if exists {/var/lib/greylistd/whitelist-hosts}\
505 {/var/lib/greylistd/whitelist-hosts}{}}
507 domains = +handled_domains : +rcpthosts
508 condition = ${readsocket{/var/run/greylistd/socket}\
510 $sender_host_address \
512 $local_part@$domain}\
516 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
517 # this adds acl_m4 if there isn't one (so unique per message)
520 !hosts = : +debianhosts : WHITELIST
521 condition = ${if def:acl_m4 {no}{yes}}
522 set acl_m4 = $pid.$tod_epoch.$sender_host_port
524 # and defers the message if postgrey thinks it should be defered ...
527 !hosts = : +debianhosts : WHITELIST
529 domains = +handled_domains : +rcpthosts
530 local_parts = GREYLIST_LOCAL_PARTS
531 set acl_m3 = request=smtpd_access_policy\n\
532 protocol_state=RCPT\n\
533 protocol_name=${uc:$received_protocol}\n\
534 instance=${acl_m4}\n\
535 helo_name=${sender_helo_name}\n\
536 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
537 client_name=${sender_host_name}\n\
538 sender=${sender_address}\n\
539 recipient=$local_part@$domain\n\n
541 ${readsocket{/var/run/postgrey/socket}{$acl_m3}\
542 {5s}{}{action=DUNNO}}\
544 message = ${sg{$acl_m3}{^\\w+\\s*}{}}
545 log_message = greylisted.
546 condition = ${if eq{${uc:${substr{0}{5}{$acl_m3}}}}{DEFER}}
548 # ... or adds a header with information about how long the delay was
551 !hosts = : +debianhosts : WHITELIST
553 domains = +handled_domains : +rcpthosts
554 local_parts = GREYLIST_LOCAL_PARTS
555 condition = ${if eq{${uc:${substr_0_7:$acl_m3}}}{PREPEND}}
556 message = ${sg{$acl_m3}{^\\w+\\s*}{}}
560 accept local_parts = postmaster
561 domains = +handled_domains : +rcpthosts
563 deny log_message = <$sender_address> is blacklisted
564 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
565 message = We have blacklisted <$sender_address>. Please stop mailing us
567 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
568 dnslists = ${if match_domain{$domain}{+virtual_domains}\
569 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
570 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
571 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
572 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
573 domains = +handled_domains : +rcpthosts
574 !hosts = +debianhosts : WHITELIST
576 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
577 dnslists = ${if match_domain{$domain}{+virtual_domains}\
578 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
579 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
580 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
581 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
582 domains = +handled_domains : +rcpthosts
583 !hosts = +debianhosts : WHITELIST
585 deny domains = +handled_domains : +rcpthosts
586 local_parts = ${if match_domain{$domain}{+virtual_domains}\
587 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
588 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
589 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
590 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
591 !hosts = +debianhosts : WHITELIST
592 !verify = sender/callout
594 accept domains = +handled_domains
596 message = unknown user
597 verify = recipient/defer_ok
599 accept domains = +rcpthosts
601 message = unrouteable address
604 accept hosts = +debianhosts
606 accept authenticated = *
608 deny message = relay not permitted
610 #!!# ACL that is used after the DATA command
612 require verify = header_syntax
613 message = Invalid syntax in the header
615 deny condition = ${if eq {$acl_m1}{RTMail}}
616 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
617 {!match {${lc:$rh_Subject:]}} {\\[rt.debian.org }} \
618 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
619 message = messages to the Request Tracker system require a subject tag or a subaddress
621 deny !hosts = +debianhosts : 217.196.43.134
622 condition = ${if eq {$acl_m1}{PTSMail}}
623 condition = ${if def:h_X-PTS-Approved:{false}{true}}
624 message = messages to the PTS require an X-PTS-Approved header
626 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
627 message = Blackisted URI found in body
629 deny condition = ${if eq {$acl_m1}{DBSignedMail}}
630 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
631 {!match {$message_body}{PGP SIGNED MESSAGE}} \
632 {!match {$message_body}{PGP SIGNATURE}} \
635 message = Mail to this address needs to be PGP-signed
637 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
638 # postfix's strict_7bit_headers option, but only checks a few common problem
639 # headers, as there doesn't appear to be an easy way to check them all.
641 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
642 {match {$rh_To:}{[\200-\377]}}\
643 {match {$rh_From:}{[\200-\377]}}\
644 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
645 message = improper use of 8-bit data in message header: message rejected
648 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
649 message = Your mailer is not RFC 2047 compliant: message rejected
655 message = malware detected: $malware_name: message rejected
658 deny spam = $value/defer_ok
659 domains = +handled_domains : +rcpthosts
660 message = message got a spam score of $spam_score
661 local_parts = ${if exists {/etc/exim4/sa_users}\
662 {${if match_domain{$domain}{+virtual_domains}\
663 {${lookup{$local_part@$domain}nwildlsearch{/etc/exim4/sa_users}{$local_part}{}}}\
664 {${lookup{$local_part}lsearch{/etc/exim4/sa_users}{$local_part}{}}}}}}
666 # Check header_sender except for survey@popcon.d.o
667 deny condition = ${if eq{$acl_m1}{PopconMail}{false}{true}}
668 !verify = header_sender
669 message = No valid sender found in the From:, Sender: and Reply-to: headers
675 ######################################################################
676 # REWRITE CONFIGURATION #
677 ######################################################################
683 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
684 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
685 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
686 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
687 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
688 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
691 #!!#######################################################!!#
692 #!!# Here follow routers created from the old routers, #!!#
693 #!!# for handling non-local domains. #!!#
694 #!!#######################################################!!#
700 ######################################################################
701 # ROUTERS CONFIGURATION #
702 # Specifies how addresses are handled #
703 ######################################################################
704 # ORDER DOES MATTER #
705 # An address is passed to each in turn until it is accepted. #
706 ######################################################################
709 debug_print = "R: bsmtp for $local_part@$domain"
711 domains = !+local_domains
712 require_files = /etc/exim4/bsmtp
713 route_list = * ${extract{file}{\
714 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
718 # This router routes to remote hosts over SMTP by explicit IP address,
719 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
720 # require this facility, which is why it is enabled by default in Exim.
722 debug_print = "R: ipliteral for $local_part@$domain"
724 domains = !+handled_domains
725 transport = remote_smtp
726 ignore_target_hosts = +reservedaddrs
728 # This router routes to remote hosts over SMTP using a DNS lookup.
729 # Ignore reserved network responses, including localhost.
731 debug_print = "R: dnslookup for $local_part@$domain"
733 domains = !+handled_domains
734 transport = remote_smtp
735 ignore_target_hosts = +reservedaddrs
738 # This allows local delivery to be forced, avoiding alias files and
742 # debug_print = "R: real_local for $local_part@$domain"
745 # domains = lsearch;/etc/exim4/locals
746 # local_part_prefix = real-
747 # transport = local_delivery
749 # This router handles aliasing using a traditional /etc/aliases file.
750 # If any of your aliases expand to pipes or files, you will need to set
751 # up a user and a group for these deliveries to run under. You can do
752 # this by uncommenting the "user" option below (changing the user name
753 # as appropriate) and adding a "group" option if necessary.
756 debug_print = "R: system_aliases for $local_part@$domain"
760 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
761 domains = +local_domains
762 file_transport = address_file
763 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
764 pipe_transport = address_pipe
767 # This router handles forwarding using traditional .forward files.
768 # It also allows mail filtering when a forward file starts with the
769 # string "# Exim filter": to disable filtering, uncomment the "filter"
770 # option. The check_ancestor option means that if the forward file
771 # generates an address that is an ancestor of the current one, the
772 # current one gets passed on instead. This covers the case where A is
773 # aliased to B and B has a .forward file pointing to A.
775 # For standard debian setup of one group per user, it is acceptable---normal
776 # even---for .forward to be group writable. If you have everyone in one
777 # group, you should comment out the "modemask" line. Without it, the exim
778 # default of 022 will apply, which is probably what you want.
781 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
786 directory_transport = address_directory
787 domains = +local_domains
788 # filter - I have disabled filtering to force users to use .forward-foo files
789 # or procmail. This will make it easier to move mailers in the future
791 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
792 # also checks if the .forward-bar exists, if not then it uses
793 # .forward-default instead.
794 file = $home/.forward\
795 ${if eq{}{$local_part_suffix}{}{\
796 ${if exists {${home}/.forward${local_part_suffix}} \
797 {${local_part_suffix}}{-default}}\
800 file_transport = address_file
801 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
802 local_part_suffix = -*
803 local_part_suffix_optional
805 pipe_transport = address_pipe
806 reply_transport = address_reply
807 require_files = $home
808 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
812 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
816 directory_transport = address_directory
817 domains = +local_domains
818 # filter - I have disabled filtering to force users to use .forward-foo files
819 # or procmail. This will make it easier to move mailers in the future
821 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
822 # also checks if the .forward-bar exists, if not then it uses
823 # .forward-default instead.
824 file = $home/.forward\
825 ${if eq{}{$local_part_suffix}{}{\
826 ${if exists {${home}/.forward${local_part_suffix}} \
827 {${local_part_suffix}}{-default}}\
830 file_transport = address_file
831 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
832 local_part_suffix = -*
833 local_part_suffix_optional
835 pipe_transport = address_pipe
836 reply_transport = address_reply
837 require_files = $home
840 # This delivers to procmail
842 debug_print = "R: procmail for $local_part@$domain"
845 domains = +local_domains
846 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
849 require_files = $local_part:$home/.procmailrc
850 transport = procmail_pipe
851 transport_current_directory = $home
853 # This driver delivers to the LDAP generated alias file.
855 debug_print = "R: ldap_aliases for $local_part@$domain"
859 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
860 {${lookup{$local_part}cdb\
861 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
862 domains = +local_domains
863 file_transport = address_file
864 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
865 pipe_transport = address_pipe
868 # This director matches local user mailboxes.
870 debug_print = "R: localuser for $local_part@$domain"
873 domains = +local_domains
874 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
875 # Disable if the user has never logged in
876 require_files = $home
877 transport = local_delivery
880 # Now we begin the Virtual Domain configuration
881 # Everything before here should apply only to the local domains with a
884 # exim4 fails the router if it can't change to the user/group for delivery
885 # during verification. So we have to seperate the cases of verifying
886 # the virts, and delivering to them. blah.
888 # This router delivers for packages.d.o
890 debug_print = "R: packages for $local_part@$domain"
892 file_transport = address_file
893 pipe_transport = address_pipe
894 domains = packages.debian.org
895 require_files = /org/packages.debian.org/conf/maintainer
896 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
897 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
898 transport_home_directory = /org/packages.debian.org/mail
899 transport_current_directory = /org/packages.debian.org/mail
904 .ifdef HAVE_USER_DEBBUGS
905 # This router delivers for bugs.d.o
907 debug_print = "R: bugs for $local_part@$domain"
909 transport = bugs_pipe
910 domains = bugs.debian.org
911 cannot_route_message = Unknown or archived bug
912 require_files = /org/bugs.debian.org/mail/run-procmail
914 local_parts = ${if match\
916 {\N^(\d+)(\d{2})(?:-(?:(?:submit|maintonly|quiet|forwarded|done|close|request|submitter)|(?:unsubscribe|ignore|(?:sub(?:scribe|help|yes|approve|reject))|unsubyes|bounce|probe|approve|reject|setlistyes|setlistsilentyes).*))?$\N}\
917 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
918 {$local_part}fail}}fail}
921 # This router delivers for rt.d.o
923 debug_print = "R: rt for $local_part@$domain"
925 domains = rt.debian.org
926 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
927 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
928 local_part_suffix = +*
929 local_part_suffix_optional
930 pipe_transport = rt_pipe
931 data = "|/usr/bin/rt-mailgate --queue '${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}}' --url https://rt.debian.org/ --extension ticket --action ${if match{$local_part}{.*-comment.*}{comment}{correspond}}"
932 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
935 debug_print = "R: virt_aliases for $local_part@$domain"
938 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
939 {${lookup{$local_part}lsearch*{\
940 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
942 directory_transport = address_directory
943 cannot_route_message = Unknown user
944 domains = +virtual_domains
945 file_transport = address_file
946 pipe_transport = address_pipe
947 qualify_preserve_domain
949 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
950 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
954 debug_print = "R: virt_direct for $local_part@$domain"
960 directory_transport = address_directory
961 domains = +virtual_domains
962 file = $home/.forward-\
963 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
965 file_transport = address_file
966 pipe_transport = address_pipe
967 reply_transport = address_reply
969 router_home_directory = ${extract{directory}{VDOMAINDATA}}
970 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
973 # This is a senmailesque alias file lookup
975 debug_print = "R: virt_aliases for $local_part@$domain"
980 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
981 {${lookup{$local_part}lsearch*{\
982 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
984 directory_transport = address_directory
985 domains = +virtual_domains
986 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
987 cannot_route_message = Unknown user
988 group = ${extract{group}{VDOMAINDATA}}
989 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
990 pipe_transport = address_pipe
991 qualify_preserve_domain
993 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
994 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
996 user = ${extract{user}{VDOMAINDATA}}
998 # This is a qmailesque deliver into a directory of .forward files
1000 debug_print = "R: virt_direct for $local_part@$domain"
1006 directory_transport = address_directory
1007 domains = +virtual_domains
1008 file = $home/.forward-\
1009 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1011 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1012 group = ${extract{group}{VDOMAINDATA}}
1013 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1015 pipe_transport = address_pipe
1016 reply_transport = address_reply
1017 retry_use_local_part
1018 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1019 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1021 user = ${extract{user}{VDOMAINDATA}}
1022 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1024 ######################################################################
1025 # TRANSPORTS CONFIGURATION #
1026 ######################################################################
1027 # ORDER DOES NOT MATTER #
1028 # Only one appropriate transport is called for each delivery. #
1029 ######################################################################
1034 # This transport is used for local delivery to user mailboxes. On debian
1035 # systems group mail is used so we can write to the /var/mail
1036 # directory. (The alternative, which most other unixes use, is to deliver
1037 # as the user's own group, into a sticky-bitted directory)
1040 file = /var/mail/${local_part}
1043 no_mode_fail_narrower
1046 # This transport is used for handling pipe addresses generated by alias
1047 # or .forward files. It has a conventional name, since it is not actually
1048 # mentioned elsewhere in this configuration file. (A different name *can*
1049 # be specified via the "address_pipe_transport" option if you really want
1050 # to.) If the pipe generates any standard output, it is returned to the sender
1051 # of the message as a delivery error. Set return_fail_output instead if you
1052 # want this to happen only when the pipe fails to complete normally.
1056 current_directory = ${home}
1057 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1058 EXT=${substr_1:${local_part_suffix}}:\
1059 LOCAL=${local_part}${local_part_suffix}:\
1060 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1064 # This transport is used for handling file addresses generated by alias
1065 # or .forward files. It has a conventional name, since it is not actually
1066 # mentioned elsewhere in this configuration file.
1076 directory_mode = 0770
1077 mode_fail_narrower = false
1079 # This transport is used for handling file addresses generated by alias
1080 # or .forward files if the path ends in "/", which causes it to be treated
1081 # as a directory name rather than a file name. Each message is then delivered
1082 # to a unique file in the directory. If instead you want all such deliveries to
1083 # be in the "maildir" format that is used by some other mail software,
1084 # uncomment the final option below. If this is done, the directory specified
1085 # in the .forward or alias file is the base maildir directory.
1087 # Should you want to be able to specify either maildir or non-maildir
1088 # directory-style deliveries, then you must set up yet another transport,
1089 # called address_directory2. This is used if the path ends in "//" so should
1090 # be the one used for maildir, as the double slash suggests another level
1091 # of directory. In the absence of address_directory2, paths ending in //
1092 # are passed to address_directory.
1102 # This transport is used for handling autoreplies generated by the filtering
1103 # option of the forwardfile director. It has a conventional name, since it
1104 # is not actually mentioned elsewhere in this configuration file.
1108 # This transport is used for delivering messages over SMTP connections.
1112 connect_timeout = 1m
1115 # Send the message to procmail
1118 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1120 user = ${local_part}
1129 user = ${extract{user}{\
1130 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1134 .ifdef HAVE_USER_DEBBUGS
1137 command = /org/bugs.debian.org/mail/run-procmail
1138 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1139 EXT=${substr_1:${local_part_suffix}}:\
1140 LOCAL=${local_part}${local_part_suffix}:\
1141 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1148 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1151 environment = EXTENSION=${substr_1:${local_part_suffix}}
1152 allow_commands = /usr/bin/rt-mailgate
1155 ######################################################################
1156 # RETRY CONFIGURATION #
1157 ######################################################################
1159 # This single retry rule applies to all domains and all errors. It specifies
1160 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1161 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1162 # hours, then retries every 8 hours until 4 days have passed since the first
1165 # Domain Error Retries
1166 # ------ ----- -------
1171 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1172 * * senders=: F,2h,10m
1173 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1174 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1176 # End of Exim 4 configuration