2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
6 # This is the main exim4 configuration file based on the 28.08.05 version by
8 # It is hand crafted, do not replace with anything generated by a config
10 # It is installed as part of the debian.org package -- don't edit this file
12 # The configuration file uses a set of macros and rules to generate an
13 # acceptable mail environment for debian.org machines. It deviates
14 # considerably from what could be considered a standard exim configuration.
16 # This configuration file brings in the necessary information from
17 # other databases stored in /etc/exim/ right now these are linear text
20 # This file is independent of the local host, it should not be changed
21 # per machine. primary_hostname is used in all places that require per-host
24 # The configuration files in /etc/exim are as follows:
25 # locals - This is a list of domains that are considered local. A local
26 # domain is essential one that deliveries to /var/mail
27 # will be attempted. The users available for local delivery
28 # comes from /etc/passwd and /etc/aliases. Wildcards are not
30 # virtualdomains - This is a list of all virtual domains. A virtual domain
31 # is much like a local domain, execpt that the delivery location
32 # and allowed set of users is controlled by a virtual domain
33 # alias file and not /etc/passwd. Wildcards are permitted
34 # rcpthosts - recipient hosts or relay domains. This is a list of
35 # all hosts that we mail exchange for. All domains that list
36 # this host in their MX records should be listed here. Wildcards
38 # relayhosts - Hostnames that can send any arbitarily addressed mail to
39 # us. This is primarily only usefull for emergancy 'queue
40 # flushing' operations, but should be populated with a list
41 # of trusted machines. Wildcards are not permitted
42 # The division of files is designed so that all hosts may share rcpthosts
43 # and relayhosts, these could be replicated automatically if necessary.
45 # Exim's wildcard mechanism is a bit odd in that to say "any address in
46 # debian.org including debian.org" you must use two patterns,
49 # Also you can only place a * before a . and as the first char in a string.
50 # Wildcards always match last so they may be used as a catchall.
52 # Further details can be found in each of the files.
54 # Usefull exim commands:
55 # exim4 -qf - Try sending all messages right now, including frozen ones
56 # exim4 -bt foo@blah - Write what exim would do if it saw the address
57 # Great for testing virtual domains and forward files
59 # Special Features for users:
60 # .forward-foo - is understood as an extension address for bar-foo@cow.com
61 # .forward-default - is understood to be a catch all for bar-*@cow.com
62 # .procmailrc - with no .forward file invokes procmail for delivery
65 # For virtual domains the first lookup is done against a linear text
66 # database called 'aliases', then .forward files are consulted. Exim
67 # filtering is available for these .forward files only. .forward-default
68 # is the universal catch all for everything not handled.
70 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
71 # will trigger things like rcpt to rate limiting or possibly a reject if
72 # enough hits are triggered.
74 # value is stored in acl_c1
76 ######################################################################
77 # MAIN CONFIGURATION SETTINGS #
78 ######################################################################
80 # These options specify the Access Control Lists (ACLs) that
81 # are used for incoming SMTP messages - after the RCPT and DATA
82 # commands, respectively.
84 acl_smtp_helo = check_helo
85 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
86 acl_smtp_data = check_message
88 # accept domain literal syntax in e-mail addresses. To actually make use of
89 # this a router is also required
90 allow_domain_literals = true
92 # This setting defines a named domain list called
93 # local_domains. It will be referenced
94 # later on by the syntax "+local_domains".
95 # Other domain and host lists may follow.
96 # @ is the local FQDN, @[] matches the IP adress of any local interface.
98 .include_if_exists /etc/exim4/local-auto.conf
99 .include_if_exists /etc/exim4/local-settings.conf
101 domainlist local_domains = @ : \
104 ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
106 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
108 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
110 domainlist handled_domains = +local_domains : +virtual_domains
112 localpartlist local_only_users = lsearch;/etc/exim4/localusers
114 # Domains we relay for; that is domains that aren't considered local but we
115 # accept mail for them.
116 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
117 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
119 .ifndef RESERVEDADDRS
120 RESERVEDADDRS = 0.0.0.0/8 : 127.0.0.0/8 : 10.0.0.0/8 : 169.254.0.0/16 : \
121 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : \
122 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5
125 hostlist reservedaddrs = RESERVEDADDRS
127 #system_filter = /etc/exim4/filter
128 #system_filter_file_transport = address_file
130 # The setting below causes Exim to do a reverse DNS lookup on all incoming
131 # IP calls, in order to get the true host name. If you feel this is too
132 # expensive, you can specify the networks for which a lookup is done, or
133 # remove the setting entirely.
135 dns_ipv4_lookup = !localhost
137 # If this option is set, then any process that is running as one of the
138 # listed users may pass a message to Exim and specify the sender's
139 # address using the "-f" command line option, without Exim's adding a
142 #trusted_users = mail
143 #trusted_users = mail : www-data : ${if exists{/home/qa}{qa}{}}
144 untrusted_set_sender = *
146 # Some operating systems use the "gecos" field in the system password file
147 # to hold other information in addition to users' real names. Exim looks up
148 # this field when it is creating "sender" and "from" headers. If these options
149 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
150 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
153 gecos_pattern = ^([^,:]*)
156 # This tells exim to immediately discard error messages (ie double bounces).
157 ignore_bounce_errors_after = 0s
159 timeout_frozen_after=14d
161 message_size_limit = 100M
163 smtp_accept_max = 300
164 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
165 smtp_accept_queue = 200
166 smtp_accept_queue_per_connection = 50
167 smtp_accept_reserve = 25
168 smtp_reserve_hosts = +debianhosts
170 split_spool_directory = true
171 check_spool_inodes = 200
172 check_spool_space = 20M
177 deliver_queue_load_max = 50
179 queue_list_requires_admin = false
185 .ifdef HAVE_USER_DEBBUGS
186 daemon_smtp_ports = 25 : 587
190 remote_sort_domains = *.debian.org:*.debian.net
192 pipelining_advertise_hosts = !*
193 smtp_enforce_sync = true
195 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
199 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
200 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
201 ${if exists {/srv/$domain/mail/whitelist}{\
202 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
204 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
205 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
206 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
207 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
208 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
209 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
210 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
212 ######################################################################
213 # ACL CONFIGURATION #
214 ######################################################################
220 # These are in HELO acl so that they are only run once. They increment a counter,
221 # so we don't want it to increment per rcpt to.
223 warn dnslists = list.dnswl.org&0.0.0.3
224 log_message = Hit on list.dnswl.org for $sender_host_address
225 set acl_c1 = ${eval:$acl_c1-30}
227 warn dnslists = list.dnswl.org&0.0.0.2
228 log_message = Hit on list.dnswl.org for $sender_host_address
229 set acl_c1 = ${eval:$acl_c1-20}
231 warn dnslists = list.dnswl.org
232 log_message = Hit on list.dnswl.org for $sender_host_address
233 set acl_c1 = ${eval:$acl_c1-10}
235 warn condition = ${if isip {$sender_helo_name}{true}{false}}
236 log_message = remote host used IP address in HELO/EHLO greeting
237 set acl_c1 = ${eval:$acl_c1+20}
239 warn !hosts = +debianhosts
240 condition = ${if eq{$host_lookup_failed}{1}}
241 set acl_c1 = ${eval:$acl_c1+20}
243 warn !hosts = +debianhosts
244 condition = ${if eq{$host_lookup_failed}{0}}
245 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}}
246 set acl_c1 = ${eval:$acl_c1+20}
248 warn !hosts = +debianhosts
249 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}}
250 set acl_c1 = ${eval:$acl_c1+20}
252 warn !hosts = +debianhosts
253 dnslists = dul.dnsbl.sorbs.net
254 set acl_c1 = ${eval:$acl_c1+15}
256 # If the sender's helo name is empty, the message will be rejected later
257 # because the helo is empty. If the rDNS lookup failed, we are already
258 # going to greylist them, so no sense worrying about it here. Finally,
259 # if rDNS does not match helo name (both lower cased first), greylist.
261 warn !hosts = +debianhosts
262 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
263 condition = ${if def:sender_helo_name {yes}{no}}
264 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
265 log_message = HELO doesn't match rDNS
266 set acl_c1 = ${eval:$acl_c1+8}
269 # matches 098325879 - looks fishy
271 warn condition = ${if and { \
272 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
273 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
276 log_message = non-FQDN HELO
277 set acl_c1 = ${eval:$acl_c1+12}
279 # Matches DOMAIN99.com - looks bad
281 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
282 log_message = SHOUTING HELO
283 set acl_c1 = ${eval:$acl_c1+7}
285 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
286 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
287 # naive test, so it's not worth much
289 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
290 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
291 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
292 log_message = random HELO
293 set acl_c1 = ${eval:$acl_c1+5}
295 # Implicit, but simpler to just say it
298 #!!# ACL that is used after the RCPT command on the submission port
301 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
302 # This is a rough pass at preventing addres harvesting or other mail blasts.
304 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
305 message = Too many bad recipients, try again later
306 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
309 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
310 message = sorry, only 5 reports per hour for submission
312 accept domains = +submission_domains
314 message = unknown user
317 deny message = relay not permitted
319 #!!# ACL that is used after the RCPT command
322 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
323 # This is a rough pass at preventing addres harvesting or other mail blasts.
325 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
326 message = Too many bad recipients, try again later
327 !hosts = +debianhosts
328 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
330 # Dump spambots that are so stupid they say helo as our IP address
332 drop !hosts = +debianhosts
333 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
334 message = HELO mismatch Forged HELO for ($sender_helo_name)
336 # Also for spambots that say helo as us or one of our domains
338 drop !hosts = +debianhosts
339 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
340 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
341 message = HELO mismatch Forged HELO for ($sender_helo_name)
343 # This logic gives you a list of commonly forged domains in helo to reject against
345 warn set acl_m2 = ${lookup{$sender_helo_name} \
346 nwildlsearch{/etc/exim4/helo-check} \
347 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
349 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
350 # say helo as a name in the list but we can't look them up
352 defer !hosts = +debianhosts
353 condition = ${if eq{$acl_m2}{}{no}{yes}}
354 condition = ${if eq{$sender_host_name}{}{yes}{no}}
355 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
356 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
358 # If DNS works, go ahead and reject them
360 drop !hosts = +debianhosts
361 condition = ${if and { {!eq{$acl_m2}{}}{!match{$sender_host_name}{${rxquote:$acl_m2}\N$\N}}}{yes}{no}}
362 message = HELO mismatch Forged HELO for ($sender_helo_name)
364 # disabled accounts don't even get local mail.
365 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
366 domains = +local_domains
367 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
369 deny domains = +virtual_domains
370 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
371 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
373 hosts = !+debianhosts
374 message = mail for <$local_part@$domain> only accepted from debian.org machines
375 # Accept if the source is local SMTP (i.e. not over TCP/IP).
376 # We do this by testing for an empty sending host field.
379 deny domains = +handled_domains
380 local_parts = ^[.] : ^.*[@%!/|]
382 deny domains = !+handled_domains
383 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
385 # forwards mail to @d.o address, even if it's a bounce from master, no reply
386 # from source address; rejecting all mail now.
387 deny recipients = mendoza@debian.org
388 hosts = 65.110.39.147 : 64.39.31.15
389 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
391 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
392 sender_domains= +local_domains : debian.org : debian.net : debian.com
393 hosts = !+debianhosts
394 message = mail from <$sender_address> not allowed externally
396 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
397 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
398 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
399 message = no mail should ever come from <$sender_address>
401 deny local_parts = +local_only_users
402 domains = +local_domains
403 hosts = !+debianhosts
404 message = mail for $local_part is only accepted internally
406 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
407 hosts = !+debianhosts
408 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
410 deny !recipients = survey@popcon.debian.org
413 defer !hosts = +debianhosts
414 condition = ${if >{${eval:$acl_c1}}{0}}
415 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
416 message = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
419 # Check with policyd-weight - this only works with a version after etch's,
420 # sadly. etch's version attempts to hold the socket open, since that's what
421 # postfix expects. Exim, on the other hand, expects the remote side to close
422 # the socket when it's finished sending data, so it see each transaction as
423 # an incomplete read. I'm sure there's a way we could force exim to do
424 # something sick and clever to force either the interpretation or the socket
425 # closure, but I'm fairly sure it's now worth it, since the backport of
426 # policyd-weight is trivial.
427 warn !hosts = +debianhosts
428 set acl_m9 = ${readsocket{inet:127.0.0.1:12525}\
429 {request=smtpd_access_policy\n\
430 protocol_state=RCPT\n\
431 protocol_name=${uc:$received_protocol}\n\
432 helo_name=$sender_helo_name\n\
433 queue_id=$message_exim_id\n\
434 sender=$sender_address\n\
435 recipient=$local_part@$domain\n\
436 recipient_count=$rcpt_count\n\
437 client_address=$sender_host_address\n\
438 client_name=$sender_host_name\n\
439 reverse_client_name=$sender_host_name\n\
440 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
441 {20s}{\n}{socket failure}}
443 # Defer on socket error
444 defer !hosts = +debianhosts
445 condition = ${if eq{$acl_m9}{socket failure}{yes}{no}}
446 message = Cannot connect to policyd-weight. Please try again later.
448 # Set proposed action to $acl_m8 and message to $acl_m7
449 warn !hosts = +debianhosts
450 set acl_m8 = ${extract{action}{$acl_m9}}
451 set acl_m7 = ${sg{$acl_m9}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
453 # Add X-policyd-weight header line to message
454 warn !hosts = +debianhosts
456 condition = ${if eq{$acl_m8}{PREPEND}{yes}{no}}
458 # Write log message, if policyd-weight can't run checks
459 warn !hosts = +debianhosts
460 log_message = policyd-weight message: $acl_m7
461 condition = ${if eq{$acl_m8}{DUNNO}{yes}{no}}
463 # Deny mails which policyd-weight thinks are spam
464 deny !hosts = +debianhosts
465 message = policyd-weight said: $acl_m7
466 condition = ${if eq{$acl_m8}{550}{yes}{no}}
468 # Defer messages when policyd-weight suggests so.
469 defer !hosts = +debianhosts
470 message = policyd-weight said: $acl_m7
471 condition = ${if eq{$acl_m8}{450}{yes}{no}}
474 warn recipients = survey@popcon.debian.org
475 set acl_m1 = PopconMail
477 warn domains = rt.debian.org
479 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if match{$local_part}{[^+]+\\+\\d+} {RTMailRecipientHasSubaddress}}}}
481 warn domains = packages.qa.debian.org
484 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
485 set acl_m1 = PTSOwner
487 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
488 set acl_m1 = DBSignedMail
491 domains = packages.qa.debian.org
492 condition = ${if match{$local_part}{\N^bounces+\N}}
493 set acl_m1 = PTSListBounce
495 .ifdef USE_GREYLISTING
498 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
499 log_message = greylisted.
500 local_parts = ${if match_domain{$domain}{+virtual_domains}\
501 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
502 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
503 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
504 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
506 !hosts = : +debianhosts : WHITELIST : \
507 ${if exists {/etc/greylistd/whitelist-hosts}\
508 {/etc/greylistd/whitelist-hosts}{}} : \
509 ${if exists {/var/lib/greylistd/whitelist-hosts}\
510 {/var/lib/greylistd/whitelist-hosts}{}}
512 domains = +handled_domains : +rcpthosts
513 condition = ${readsocket{/var/run/greylistd/socket}\
515 $sender_host_address \
517 $local_part@$domain}\
521 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
522 # this adds acl_m4 if there isn't one (so unique per message)
525 !hosts = : +debianhosts : WHITELIST
526 condition = ${if def:acl_m4 {no}{yes}}
527 set acl_m4 = $pid.$tod_epoch.$sender_host_port
529 # and defers the message if postgrey thinks it should be defered ...
532 !hosts = : +debianhosts : WHITELIST
534 domains = +handled_domains : +rcpthosts
535 local_parts = GREYLIST_LOCAL_PARTS
536 set acl_m3 = request=smtpd_access_policy\n\
537 protocol_state=RCPT\n\
538 protocol_name=${uc:$received_protocol}\n\
539 instance=${acl_m4}\n\
540 helo_name=${sender_helo_name}\n\
541 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
542 client_name=${sender_host_name}\n\
543 sender=${sender_address}\n\
544 recipient=$local_part@$domain\n\n
546 ${readsocket{/var/run/postgrey/socket}{$acl_m3}\
547 {5s}{}{action=DUNNO}}\
549 message = ${sg{$acl_m3}{^\\w+\\s*}{}}
550 log_message = greylisted.
551 condition = ${if eq{${uc:${substr{0}{5}{$acl_m3}}}}{DEFER}}
553 # ... or adds a header with information about how long the delay was
556 !hosts = : +debianhosts : WHITELIST
558 domains = +handled_domains : +rcpthosts
559 local_parts = GREYLIST_LOCAL_PARTS
560 condition = ${if eq{${uc:${substr_0_7:$acl_m3}}}{PREPEND}}
561 message = ${sg{$acl_m3}{^\\w+\\s*}{}}
565 accept local_parts = postmaster
566 domains = +handled_domains : +rcpthosts
568 deny log_message = <$sender_address> is blacklisted
569 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
570 message = We have blacklisted <$sender_address>. Please stop mailing us
572 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
573 dnslists = ${if match_domain{$domain}{+virtual_domains}\
574 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
575 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
576 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
577 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
578 domains = +handled_domains : +rcpthosts
579 !hosts = +debianhosts : WHITELIST
581 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
582 dnslists = ${if match_domain{$domain}{+virtual_domains}\
583 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
584 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
585 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
586 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
587 domains = +handled_domains : +rcpthosts
588 !hosts = +debianhosts : WHITELIST
590 deny domains = +handled_domains : +rcpthosts
591 local_parts = ${if match_domain{$domain}{+virtual_domains}\
592 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
593 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
594 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
595 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
596 !hosts = +debianhosts : WHITELIST
597 !verify = sender/callout
599 accept domains = +handled_domains
601 message = unknown user
602 verify = recipient/defer_ok
604 accept domains = +rcpthosts
606 message = unrouteable address
609 accept hosts = +debianhosts
611 accept authenticated = *
613 deny message = relay not permitted
615 #!!# ACL that is used after the DATA command
617 require verify = header_syntax
618 message = Invalid syntax in the header
620 deny condition = ${if eq {$acl_m1}{RTMail}}
621 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
622 {!match {${lc:$rh_Subject:]}} {\\[rt.debian.org }} \
623 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
624 message = messages to the Request Tracker system require a subject tag or a subaddress
626 deny !hosts = +debianhosts : 217.196.43.134
627 condition = ${if eq {$acl_m1}{PTSMail}}
628 condition = ${if def:h_X-PTS-Approved:{false}{true}}
629 message = messages to the PTS require an X-PTS-Approved header
631 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
632 message = Blackisted URI found in body
634 deny condition = ${if eq {$acl_m1}{DBSignedMail}}
635 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
636 {!match {$message_body}{PGP SIGNED MESSAGE}} \
637 {!match {$message_body}{PGP SIGNATURE}} \
638 {!match {$header_content-type:}{multipart/signed}} \
639 {!match {$header_content-type:}{pgp}} \
642 message = Mail to this address needs to be PGP-signed
644 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
645 # postfix's strict_7bit_headers option, but only checks a few common problem
646 # headers, as there doesn't appear to be an easy way to check them all.
648 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
649 {match {$rh_To:}{[\200-\377]}}\
650 {match {$rh_From:}{[\200-\377]}}\
651 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
652 message = improper use of 8-bit data in message header: message rejected
655 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
656 message = Your mailer is not RFC 2047 compliant: message rejected
662 message = malware detected: $malware_name: message rejected
665 deny spam = $value/defer_ok
666 domains = +handled_domains : +rcpthosts
667 message = message got a spam score of $spam_score
668 local_parts = ${if exists {/etc/exim4/sa_users}\
669 {${if match_domain{$domain}{+virtual_domains}\
670 {${lookup{$local_part@$domain}nwildlsearch{/etc/exim4/sa_users}{$local_part}{}}}\
671 {${lookup{$local_part}lsearch{/etc/exim4/sa_users}{$local_part}{}}}}}}
673 # Check header_sender except for survey@popcon.d.o
674 deny condition = ${if eq{$acl_m1}{PopconMail}{false}{true}}
675 !verify = header_sender
676 message = No valid sender found in the From:, Sender: and Reply-to: headers
682 ######################################################################
683 # REWRITE CONFIGURATION #
684 ######################################################################
690 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
691 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
692 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
693 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
694 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
695 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
698 #!!#######################################################!!#
699 #!!# Here follow routers created from the old routers, #!!#
700 #!!# for handling non-local domains. #!!#
701 #!!#######################################################!!#
707 ######################################################################
708 # ROUTERS CONFIGURATION #
709 # Specifies how addresses are handled #
710 ######################################################################
711 # ORDER DOES MATTER #
712 # An address is passed to each in turn until it is accepted. #
713 ######################################################################
716 debug_print = "R: bsmtp for $local_part@$domain"
718 domains = !+local_domains
719 require_files = /etc/exim4/bsmtp
720 route_list = * ${extract{file}{\
721 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
725 # This router routes to remote hosts over SMTP by explicit IP address,
726 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
727 # require this facility, which is why it is enabled by default in Exim.
729 debug_print = "R: ipliteral for $local_part@$domain"
731 domains = !+handled_domains
732 transport = remote_smtp
733 ignore_target_hosts = +reservedaddrs
735 # This router routes to remote hosts over SMTP using a DNS lookup.
736 # Ignore reserved network responses, including localhost.
738 debug_print = "R: dnslookup for $local_part@$domain"
740 domains = !+handled_domains
741 transport = remote_smtp
742 ignore_target_hosts = +reservedaddrs
745 # This allows local delivery to be forced, avoiding alias files and
749 # debug_print = "R: real_local for $local_part@$domain"
752 # domains = lsearch;/etc/exim4/locals
753 # local_part_prefix = real-
754 # transport = local_delivery
756 # This router handles aliasing using a traditional /etc/aliases file.
757 # If any of your aliases expand to pipes or files, you will need to set
758 # up a user and a group for these deliveries to run under. You can do
759 # this by uncommenting the "user" option below (changing the user name
760 # as appropriate) and adding a "group" option if necessary.
763 debug_print = "R: system_aliases for $local_part@$domain"
767 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
768 domains = +local_domains
769 file_transport = address_file
770 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
771 pipe_transport = address_pipe
774 # This router handles forwarding using traditional .forward files.
775 # It also allows mail filtering when a forward file starts with the
776 # string "# Exim filter": to disable filtering, uncomment the "filter"
777 # option. The check_ancestor option means that if the forward file
778 # generates an address that is an ancestor of the current one, the
779 # current one gets passed on instead. This covers the case where A is
780 # aliased to B and B has a .forward file pointing to A.
782 # For standard debian setup of one group per user, it is acceptable---normal
783 # even---for .forward to be group writable. If you have everyone in one
784 # group, you should comment out the "modemask" line. Without it, the exim
785 # default of 022 will apply, which is probably what you want.
788 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
793 directory_transport = address_directory
794 domains = +local_domains
795 # filter - I have disabled filtering to force users to use .forward-foo files
796 # or procmail. This will make it easier to move mailers in the future
798 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
799 # also checks if the .forward-bar exists, if not then it uses
800 # .forward-default instead.
801 file = $home/.forward\
802 ${if eq{}{$local_part_suffix}{}{\
803 ${if exists {${home}/.forward${local_part_suffix}} \
804 {${local_part_suffix}}{-default}}\
807 file_transport = address_file
808 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
809 local_part_suffix = -*
810 local_part_suffix_optional
812 pipe_transport = address_pipe
813 reply_transport = address_reply
814 require_files = $home
815 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
819 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
823 directory_transport = address_directory
824 domains = +local_domains
825 # filter - I have disabled filtering to force users to use .forward-foo files
826 # or procmail. This will make it easier to move mailers in the future
828 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
829 # also checks if the .forward-bar exists, if not then it uses
830 # .forward-default instead.
831 file = $home/.forward\
832 ${if eq{}{$local_part_suffix}{}{\
833 ${if exists {${home}/.forward${local_part_suffix}} \
834 {${local_part_suffix}}{-default}}\
837 file_transport = address_file
838 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
839 local_part_suffix = -*
840 local_part_suffix_optional
842 pipe_transport = address_pipe
843 reply_transport = address_reply
844 require_files = $home
847 # This delivers to procmail
849 debug_print = "R: procmail for $local_part@$domain"
852 domains = +local_domains
853 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
856 require_files = $local_part:$home/.procmailrc
857 transport = procmail_pipe
858 transport_current_directory = $home
860 # This driver delivers to the LDAP generated alias file.
862 debug_print = "R: ldap_aliases for $local_part@$domain"
866 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
867 {${lookup{$local_part}cdb\
868 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
869 domains = +local_domains
870 file_transport = address_file
871 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
872 pipe_transport = address_pipe
875 # This director matches local user mailboxes.
877 debug_print = "R: localuser for $local_part@$domain"
880 domains = +local_domains
881 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
882 # Disable if the user has never logged in
883 require_files = $home
884 transport = local_delivery
887 # Now we begin the Virtual Domain configuration
888 # Everything before here should apply only to the local domains with a
891 # exim4 fails the router if it can't change to the user/group for delivery
892 # during verification. So we have to seperate the cases of verifying
893 # the virts, and delivering to them. blah.
895 # This router delivers for packages.d.o
897 debug_print = "R: packages for $local_part@$domain"
899 file_transport = address_file
900 pipe_transport = address_pipe
901 domains = packages.debian.org
902 require_files = /org/packages.debian.org/conf/maintainer
903 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
904 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
905 transport_home_directory = /org/packages.debian.org/mail
906 transport_current_directory = /org/packages.debian.org/mail
911 .ifdef HAVE_USER_DEBBUGS
912 # This router delivers for bugs.d.o
914 debug_print = "R: bugs for $local_part@$domain"
916 transport = bugs_pipe
917 domains = bugs.debian.org
918 cannot_route_message = Unknown or archived bug
919 require_files = /org/bugs.debian.org/mail/run-procmail
921 local_parts = ${if match\
923 {\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}\
924 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
925 {$local_part}fail}}fail}
928 # This router delivers for rt.d.o
930 debug_print = "R: rt for $local_part@$domain"
932 domains = rt.debian.org
933 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
934 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
935 local_part_suffix = +*
936 local_part_suffix_optional
937 pipe_transport = rt_pipe
938 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}}"
939 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
942 debug_print = "R: virt_aliases for $local_part@$domain"
945 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
946 {${lookup{$local_part}lsearch*{\
947 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
949 directory_transport = address_directory
950 cannot_route_message = Unknown user
951 domains = +virtual_domains
952 file_transport = address_file
953 pipe_transport = address_pipe
954 qualify_preserve_domain
956 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
957 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
961 debug_print = "R: virt_direct for $local_part@$domain"
967 directory_transport = address_directory
968 domains = +virtual_domains
969 file = $home/.forward-\
970 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
972 file_transport = address_file
973 pipe_transport = address_pipe
974 reply_transport = address_reply
976 router_home_directory = ${extract{directory}{VDOMAINDATA}}
977 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
980 # This is a senmailesque alias file lookup
982 debug_print = "R: virt_aliases for $local_part@$domain"
987 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
988 {${lookup{$local_part}lsearch*{\
989 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
991 directory_transport = address_directory
992 domains = +virtual_domains
993 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
994 cannot_route_message = Unknown user
995 group = ${extract{group}{VDOMAINDATA}}
996 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
997 pipe_transport = address_pipe
998 qualify_preserve_domain
1000 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1001 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1003 user = ${extract{user}{VDOMAINDATA}}
1005 # This is a qmailesque deliver into a directory of .forward files
1007 debug_print = "R: virt_direct for $local_part@$domain"
1013 directory_transport = address_directory
1014 domains = +virtual_domains
1015 file = $home/.forward-\
1016 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1018 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1019 group = ${extract{group}{VDOMAINDATA}}
1020 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1022 pipe_transport = address_pipe
1023 reply_transport = address_reply
1024 retry_use_local_part
1025 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1026 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1028 user = ${extract{user}{VDOMAINDATA}}
1029 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1031 ######################################################################
1032 # TRANSPORTS CONFIGURATION #
1033 ######################################################################
1034 # ORDER DOES NOT MATTER #
1035 # Only one appropriate transport is called for each delivery. #
1036 ######################################################################
1041 # This transport is used for local delivery to user mailboxes. On debian
1042 # systems group mail is used so we can write to the /var/mail
1043 # directory. (The alternative, which most other unixes use, is to deliver
1044 # as the user's own group, into a sticky-bitted directory)
1047 file = /var/mail/${local_part}
1050 no_mode_fail_narrower
1053 # This transport is used for handling pipe addresses generated by alias
1054 # or .forward files. It has a conventional name, since it is not actually
1055 # mentioned elsewhere in this configuration file. (A different name *can*
1056 # be specified via the "address_pipe_transport" option if you really want
1057 # to.) If the pipe generates any standard output, it is returned to the sender
1058 # of the message as a delivery error. Set return_fail_output instead if you
1059 # want this to happen only when the pipe fails to complete normally.
1063 current_directory = ${home}
1064 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1065 EXT=${substr_1:${local_part_suffix}}:\
1066 LOCAL=${local_part}${local_part_suffix}:\
1067 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1071 # This transport is used for handling file addresses generated by alias
1072 # or .forward files. It has a conventional name, since it is not actually
1073 # mentioned elsewhere in this configuration file.
1083 directory_mode = 0770
1084 mode_fail_narrower = false
1086 # This transport is used for handling file addresses generated by alias
1087 # or .forward files if the path ends in "/", which causes it to be treated
1088 # as a directory name rather than a file name. Each message is then delivered
1089 # to a unique file in the directory. If instead you want all such deliveries to
1090 # be in the "maildir" format that is used by some other mail software,
1091 # uncomment the final option below. If this is done, the directory specified
1092 # in the .forward or alias file is the base maildir directory.
1094 # Should you want to be able to specify either maildir or non-maildir
1095 # directory-style deliveries, then you must set up yet another transport,
1096 # called address_directory2. This is used if the path ends in "//" so should
1097 # be the one used for maildir, as the double slash suggests another level
1098 # of directory. In the absence of address_directory2, paths ending in //
1099 # are passed to address_directory.
1109 # This transport is used for handling autoreplies generated by the filtering
1110 # option of the forwardfile director. It has a conventional name, since it
1111 # is not actually mentioned elsewhere in this configuration file.
1115 # This transport is used for delivering messages over SMTP connections.
1119 connect_timeout = 1m
1122 # Send the message to procmail
1125 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1127 user = ${local_part}
1136 user = ${extract{user}{\
1137 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1141 .ifdef HAVE_USER_DEBBUGS
1144 command = /org/bugs.debian.org/mail/run-procmail
1145 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1146 EXT=${substr_1:${local_part_suffix}}:\
1147 LOCAL=${local_part}${local_part_suffix}:\
1148 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1155 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1158 environment = EXTENSION=${substr_1:${local_part_suffix}}
1159 allow_commands = /usr/bin/rt-mailgate
1162 ######################################################################
1163 # RETRY CONFIGURATION #
1164 ######################################################################
1166 # This single retry rule applies to all domains and all errors. It specifies
1167 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1168 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1169 # hours, then retries every 8 hours until 4 days have passed since the first
1172 # Domain Error Retries
1173 # ------ ----- -------
1178 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1179 * * senders=: F,2h,10m
1180 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1181 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1183 # End of Exim 4 configuration