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
9 # The configuration file uses a set of rules to generate an
10 # acceptable mail environment for debian.org machines. It deviates
11 # considerably from what could be considered a standard exim configuration.
13 # This configuration file brings in the necessary information from
14 # other databases stored in /etc/exim/ and the files distributed by ud-ldap
16 # This file is independent of the local host, it should not be changed
17 # per machine. primary_hostname is used in all places that require per-host
20 # The configuration files in /etc/exim are as follows:
21 # locals - This is a list of domains that are considered local. A local
22 # domain is essential one that deliveries to /var/mail
23 # will be attempted. The users available for local delivery
24 # comes from /etc/passwd and /etc/aliases. Wildcards are not
26 # virtualdomains - This is a list of all virtual domains. A virtual domain
27 # is much like a local domain, execpt that the delivery location
28 # and allowed set of users is controlled by a virtual domain
29 # alias file and not /etc/passwd. Wildcards are permitted
30 # rcpthosts - recipient hosts or relay domains. This is a list of
31 # all hosts that we mail exchange for. All domains that list
32 # this host in their MX records should be listed here. Wildcards
34 # relayhosts - Hostnames that can send any arbitarily addressed mail to
35 # us. This is primarily only usefull for emergancy 'queue
36 # flushing' operations, but should be populated with a list
37 # of trusted machines. Wildcards are not permitted
40 if nodeinfo['mailrelay']
42 # mailhubdomains - Domains for which we are the MX, but the mail is relayed
43 # elsewhere. This is designed for use with small volume or
44 # restricted machines that need to use a smarthost for mail
45 # traffic. We will relay for them based on ssl cert validation
46 # but we need to teach exim how to route the mail to them. This is
52 # Exim's wildcard mechanism is a bit odd in that to say "any address in
53 # debian.org including debian.org" you must use two patterns,
56 # Also you can only place a * before a . and as the first char in a string.
57 # Wildcards always match last so they may be used as a catchall.
59 # Further details can be found in each of the files.
61 # Usefull exim commands:
62 # exim4 -qf - Try sending all messages right now, including frozen ones
63 # exim4 -bt foo@blah - Write what exim would do if it saw the address
64 # Great for testing virtual domains and forward files
66 # Special Features for users:
67 # .forward-foo - is understood as an extension address for bar-foo@cow.com
68 # .forward-default - is understood to be a catch all for bar-*@cow.com
69 # .procmailrc - with no .forward file invokes procmail for delivery
72 # For virtual domains the first lookup is done against a linear text
73 # database called 'aliases', then .forward files are consulted. Exim
74 # filtering is available for these .forward files only. .forward-default
75 # is the universal catch all for everything not handled.
77 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
78 # will trigger things like rcpt to rate limiting or possibly a reject if
79 # enough hits are triggered.
81 # value is stored in acl_c1
83 ######################################################################
84 # MAIN CONFIGURATION SETTINGS #
85 ######################################################################
87 # These options specify the Access Control Lists (ACLs) that
88 # are used for incoming SMTP messages - after the RCPT and DATA
89 # commands, respectively.
91 acl_smtp_helo = check_helo
92 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
93 acl_smtp_data = check_message
95 # accept domain literal syntax in e-mail addresses. To actually make use of
96 # this a router is also required
97 allow_domain_literals = true
99 # This setting defines a named domain list called
100 # local_domains. It will be referenced
101 # later on by the syntax "+local_domains".
102 # Other domain and host lists may follow.
103 # @ is the local FQDN, @[] matches the IP adress of any local interface.
105 .include_if_exists /etc/exim4/local-settings.conf
107 domainlist local_domains = @ : \
110 ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
112 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
114 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
116 domainlist handled_domains = +local_domains : +virtual_domains
118 localpartlist local_only_users = lsearch;/etc/exim4/localusers
120 # Domains we relay for; that is domains that aren't considered local but we
121 # accept mail for them.
122 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
123 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
126 if nodeinfo['mailrelay']
128 domainlist mailhubdomains = lsearch;/etc/exim4/manualroute
134 hostlist reservedaddrs = <%= nodeinfo['reservedaddrs'] %>
137 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
138 out = "tls_certificate = /etc/exim4/ssl/thishost.crt
139 tls_privatekey = /etc/exim4/ssl/thishost.key
140 tls_try_verify_hosts = *
141 tls_verify_certificates = /etc/exim4/ssl/ca.crt
142 tls_crl = /etc/exim4/ssl/ca.crl"
147 # The setting below causes Exim to do a reverse DNS lookup on all incoming
148 # IP calls, in order to get the true host name. If you feel this is too
149 # expensive, you can specify the networks for which a lookup is done, or
150 # remove the setting entirely.
152 dns_ipv4_lookup = !localhost
154 # If this option is set, then any process that is running as one of the
155 # listed users may pass a message to Exim and specify the sender's
156 # address using the "-f" command line option, without Exim's adding a
159 untrusted_set_sender = *
161 # Some operating systems use the "gecos" field in the system password file
162 # to hold other information in addition to users' real names. Exim looks up
163 # this field when it is creating "sender" and "from" headers. If these options
164 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
165 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
168 gecos_pattern = ^([^,:]*)
171 # This tells exim to immediately discard error messages (ie double bounces).
172 ignore_bounce_errors_after = 0s
174 timeout_frozen_after=14d
176 message_size_limit = 100M
178 smtp_accept_max = 300
179 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
180 smtp_accept_queue = 200
181 smtp_accept_queue_per_connection = 50
182 smtp_accept_reserve = 25
183 smtp_reserve_hosts = +debianhosts
185 split_spool_directory = true
186 check_spool_inodes = 200
187 check_spool_space = 20M
192 deliver_queue_load_max = 50
194 queue_list_requires_admin = false
197 if has_variable?("clamd") && clamd == "true"
198 out = "av_scanner = clamd:/var/run/clamav/clamd.ctl"
205 out = "daemon_smtp_ports = "
208 if nodeinfo['bugsmaster']
212 if not nodeinfo['mail_port'].to_s.empty?
213 ports << nodeinfo['mail_port']
216 if nodeinfo['mailrelay']
217 ports << nodeinfo['smarthost_port']
220 out += ports.uniq.sort.join(" : ")
225 remote_sort_domains = *.debian.org:*.debian.net
227 pipelining_advertise_hosts = !*
229 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
230 out = 'tls_advertise_hosts = *'
234 smtp_enforce_sync = true
236 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
238 received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
239 {${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
240 ${if and {{eq {$tls_certificate_verified}{1}}{def:tls_peerdn}}{from $tls_peerdn (verified)\n\t}}\
241 by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}\
242 (Exim $version_number)\n\t\
243 ${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
244 id $message_exim_id${if def:received_for {\n\tfor $received_for}}
248 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
249 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
250 ${if exists {/srv/$domain/mail/whitelist}{\
251 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
253 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
254 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
255 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
256 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
257 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
258 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
259 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
261 ######################################################################
262 # ACL CONFIGURATION #
263 ######################################################################
272 if nodeinfo['mailrelay']
273 out = " accept verify = certificate"
278 # These are in HELO acl so that they are only run once. They increment a counter,
279 # so we don't want it to increment per rcpt to.
281 warn dnslists = list.dnswl.org&0.0.0.3
282 log_message = Hit on list.dnswl.org for $sender_host_address
283 set acl_c1 = ${eval:$acl_c1-30}
285 warn dnslists = list.dnswl.org&0.0.0.2
286 log_message = Hit on list.dnswl.org for $sender_host_address
287 set acl_c1 = ${eval:$acl_c1-20}
289 warn dnslists = list.dnswl.org
290 log_message = Hit on list.dnswl.org for $sender_host_address
291 set acl_c1 = ${eval:$acl_c1-10}
293 warn condition = ${if isip {$sender_helo_name}{true}{false}}
294 log_message = remote host used IP address in HELO/EHLO greeting
295 set acl_c1 = ${eval:$acl_c1+20}
297 warn !hosts = +debianhosts
298 condition = ${if eq{$host_lookup_failed}{1}}
299 set acl_c1 = ${eval:$acl_c1+20}
301 warn !hosts = +debianhosts
302 condition = ${if eq{$host_lookup_failed}{0}}
303 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}}
304 set acl_c1 = ${eval:$acl_c1+20}
306 warn !hosts = +debianhosts
307 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}}
308 set acl_c1 = ${eval:$acl_c1+20}
310 warn !hosts = +debianhosts
311 dnslists = dul.dnsbl.sorbs.net
312 set acl_c1 = ${eval:$acl_c1+15}
314 # If the sender's helo name is empty, the message will be rejected later
315 # because the helo is empty. If the rDNS lookup failed, we are already
316 # going to greylist them, so no sense worrying about it here. Finally,
317 # if rDNS does not match helo name (both lower cased first), greylist.
319 warn !hosts = +debianhosts
320 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
321 condition = ${if def:sender_helo_name {yes}{no}}
322 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
323 log_message = HELO doesn't match rDNS
324 set acl_c1 = ${eval:$acl_c1+8}
327 # matches 098325879 - looks fishy
329 warn condition = ${if and { \
330 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
331 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
334 log_message = non-FQDN HELO
335 set acl_c1 = ${eval:$acl_c1+12}
337 # Matches DOMAIN99.com - looks bad
339 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
340 log_message = SHOUTING HELO
341 set acl_c1 = ${eval:$acl_c1+7}
343 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
344 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
345 # naive test, so it's not worth much
347 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
348 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
349 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
350 log_message = random HELO
351 set acl_c1 = ${eval:$acl_c1+5}
353 # Implicit, but simpler to just say it
356 #!!# ACL that is used after the RCPT command on the submission port
359 # Accept if the source is local SMTP (i.e. not over TCP/IP).
360 # We do this by testing for an empty sending host field.
361 accept hosts = : 127.0.0.1
365 if nodeinfo['mailrelay']
366 out = " accept verify = certificate"
371 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
372 # This is a rough pass at preventing addres harvesting or other mail blasts.
374 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
375 message = Too many bad recipients, try again later
376 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
379 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
380 !hosts = +debianhosts
381 message = sorry, only 5 reports per hour for submission
383 accept domains = +local_domains
386 message = unknown user
391 if nodeinfo['mailrelay']
393 accept domains = +mailhubdomains
395 message = unknown user
396 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
402 accept domains = +submission_domains
404 message = unknown user
407 deny message = relay not permitted
409 #!!# ACL that is used after the RCPT command
414 if nodeinfo['mailrelay']
415 out = " accept verify = certificate"
420 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
421 # This is a rough pass at preventing addres harvesting or other mail blasts.
423 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
424 message = Too many bad recipients, try again later
425 !hosts = +debianhosts
426 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
428 # Dump spambots that are so stupid they say helo as our IP address
430 drop !hosts = +debianhosts
431 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
432 message = HELO mismatch Forged HELO for ($sender_helo_name)
434 # Also for spambots that say helo as us or one of our domains
436 drop !hosts = +debianhosts
437 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
438 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
439 message = HELO mismatch Forged HELO for ($sender_helo_name)
441 # This logic gives you a list of commonly forged domains in helo to reject against
443 warn set acl_m2 = ${lookup{$sender_helo_name} \
444 nwildlsearch{/etc/exim4/helo-check} \
445 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
447 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
448 # say helo as a name in the list but we can't look them up
450 defer !hosts = +debianhosts
451 condition = ${if eq{$acl_m2}{}{no}{yes}}
452 condition = ${if eq{$sender_host_name}{}{yes}{no}}
453 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
454 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
456 # If DNS works, go ahead and reject them
458 drop !hosts = +debianhosts
459 condition = ${if and { {!eq{$acl_m2}{}}{!match{$sender_host_name}{${rxquote:$acl_m2}\N$\N}}}{yes}{no}}
460 message = HELO mismatch Forged HELO for ($sender_helo_name)
462 # disabled accounts don't even get local mail.
463 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
464 domains = +local_domains
465 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
467 deny domains = +virtual_domains
468 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
469 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
471 hosts = !+debianhosts
472 message = mail for <$local_part@$domain> only accepted from debian.org machines
473 # Accept if the source is local SMTP (i.e. not over TCP/IP).
474 # We do this by testing for an empty sending host field.
477 deny domains = +handled_domains
478 local_parts = ^[.] : ^.*[@%!/|]
480 deny domains = !+handled_domains
481 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
483 # forwards mail to @d.o address, even if it's a bounce from master, no reply
484 # from source address; rejecting all mail now.
485 deny recipients = mendoza@debian.org
486 hosts = 65.110.39.147 : 64.39.31.15
487 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
489 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
490 sender_domains= +local_domains : debian.org : debian.net : debian.com
491 hosts = !+debianhosts
492 message = mail from <$sender_address> not allowed externally
494 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
495 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
496 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
497 message = no mail should ever come from <$sender_address>
499 deny local_parts = +local_only_users
500 domains = +local_domains
501 hosts = !+debianhosts
502 message = mail for $local_part is only accepted internally
504 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
505 hosts = !+debianhosts
506 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
508 deny !recipients = survey@popcon.debian.org
511 defer !hosts = +debianhosts
512 condition = ${if >{${eval:$acl_c1}}{0}}
513 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
514 message = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
518 if has_variable?("policydweight") && policydweight == "true"
520 # Check with policyd-weight - this only works with a version after etch\'s,
521 # sadly. etch\'s version attempts to hold the socket open, since that\'s what
522 # postfix expects. Exim, on the other hand, expects the remote side to close
523 # the socket when it\'s finished sending data, so it see each transaction as
524 # an incomplete read. I\'m sure there\'s a way we could force exim to do
525 # something sick and clever to force either the interpretation or the socket
526 # closure, but I\'m fairly sure it\'s now worth it, since the backport of
527 # policyd-weight is trivial.
528 warn !hosts = +debianhosts
529 set acl_m9 = ${readsocket{inet:127.0.0.1:12525}\
530 {request=smtpd_access_policy\n\
531 protocol_state=RCPT\n\
532 protocol_name=${uc:$received_protocol}\n\
533 helo_name=$sender_helo_name\n\
534 queue_id=$message_exim_id\n\
535 sender=$sender_address\n\
536 recipient=$local_part@$domain\n\
537 recipient_count=$rcpt_count\n\
538 client_address=$sender_host_address\n\
539 client_name=$sender_host_name\n\
540 reverse_client_name=$sender_host_name\n\
541 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
542 {20s}{\n}{socket failure}}
544 # Defer on socket error
545 defer !hosts = +debianhosts
546 condition = ${if eq{$acl_m9}{socket failure}{yes}{no}}
547 message = Cannot connect to policyd-weight. Please try again later.
549 # Set proposed action to $acl_m8 and message to $acl_m7
550 warn !hosts = +debianhosts
551 set acl_m8 = ${extract{action}{$acl_m9}}
552 set acl_m7 = ${sg{$acl_m9}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
554 # Add X-policyd-weight header line to message
555 warn !hosts = +debianhosts
557 condition = ${if eq{$acl_m8}{PREPEND}{yes}{no}}
559 # Write log message, if policyd-weight can\'t run checks
560 warn !hosts = +debianhosts
561 log_message = policyd-weight message: $acl_m7
562 condition = ${if eq{$acl_m8}{DUNNO}{yes}{no}}
564 # Deny mails which policyd-weight thinks are spam
565 deny !hosts = +debianhosts
566 message = policyd-weight said: $acl_m7
567 condition = ${if eq{$acl_m8}{550}{yes}{no}}
569 # Defer messages when policyd-weight suggests so.
570 defer !hosts = +debianhosts
571 message = policyd-weight said: $acl_m7
572 condition = ${if eq{$acl_m8}{450}{yes}{no}}
577 warn recipients = survey@popcon.debian.org
578 set acl_m1 = PopconMail
582 if nodeinfo['rtmaster']
584 warn domains = rt.debian.org
586 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if or{{match{$local_part}{[^+]+\\+\\d+}}{match{$local_part}{[^+]+\\+new}}} {RTMailRecipientHasSubaddress}}}}
593 if nodeinfo['packagesmaster']
595 warn domains = packages.qa.debian.org
598 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
599 set acl_m1 = PTSOwner
602 domains = packages.qa.debian.org
603 condition = ${if match{$local_part}{\N^bounces+\N}}
604 set acl_m1 = PTSListBounce
609 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
610 set acl_m1 = DBSignedMail
614 if has_variable?("greylistd") && greylistd == "true"
617 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
618 log_message = greylisted.
619 local_parts = ${if match_domain{$domain}{+virtual_domains}\
620 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
621 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
622 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
623 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
625 !hosts = : +debianhosts : WHITELIST : \
626 ${if exists {/etc/greylistd/whitelist-hosts}\
627 {/etc/greylistd/whitelist-hosts}{}} : \
628 ${if exists {/var/lib/greylistd/whitelist-hosts}\
629 {/var/lib/greylistd/whitelist-hosts}{}}
631 domains = +handled_domains : +rcpthosts
632 condition = ${readsocket{/var/run/greylistd/socket}\
634 $sender_host_address \
636 $local_part@$domain}\
639 elsif has_variable?("postgrey") && postgrey == "true"
641 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
642 # this adds acl_m4 if there isn\'t one (so unique per message)
645 !hosts = : +debianhosts : WHITELIST
646 condition = ${if def:acl_m4 {no}{yes}}
647 set acl_m4 = $pid.$tod_epoch.$sender_host_port
649 # and defers the message if postgrey thinks it should be defered ...
652 !hosts = : +debianhosts : WHITELIST
654 domains = +handled_domains : +rcpthosts
655 local_parts = GREYLIST_LOCAL_PARTS
656 set acl_m3 = request=smtpd_access_policy\n\
657 protocol_state=RCPT\n\
658 protocol_name=${uc:$received_protocol}\n\
659 instance=${acl_m4}\n\
660 helo_name=${sender_helo_name}\n\
661 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
662 client_name=${sender_host_name}\n\
663 sender=${sender_address}\n\
664 recipient=$local_part@$domain\n\n
666 ${readsocket{/var/run/postgrey/socket}{$acl_m3}\
667 {5s}{}{action=DUNNO}}\
669 message = ${sg{$acl_m3}{^\\\\w+\\\\s*}{}}
670 log_message = greylisted.
671 condition = ${if eq{${uc:${substr{0}{5}{$acl_m3}}}}{DEFER}}
673 # ... or adds a header with information about how long the delay was
676 !hosts = : +debianhosts : WHITELIST
678 domains = +handled_domains : +rcpthosts
679 local_parts = GREYLIST_LOCAL_PARTS
680 condition = ${if eq{${uc:${substr_0_7:$acl_m3}}}{PREPEND}}
681 message = ${sg{$acl_m3}{^\\\\w+\\\\s*}{}}
687 accept local_parts = postmaster
688 domains = +handled_domains : +rcpthosts
690 deny log_message = <$sender_address> is blacklisted
691 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
692 message = We have blacklisted <$sender_address>. Please stop mailing us
694 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
695 dnslists = ${if match_domain{$domain}{+virtual_domains}\
696 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
697 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
698 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
699 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
700 domains = +handled_domains : +rcpthosts
701 !hosts = +debianhosts : WHITELIST
703 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
704 dnslists = ${if match_domain{$domain}{+virtual_domains}\
705 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
706 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
707 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
708 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
709 domains = +handled_domains : +rcpthosts
710 !hosts = +debianhosts : WHITELIST
712 deny domains = +handled_domains : +rcpthosts
713 local_parts = ${if match_domain{$domain}{+virtual_domains}\
714 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
715 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
716 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
717 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
718 !hosts = +debianhosts : WHITELIST
719 !verify = sender/callout
723 if nodeinfo['mailrelay']
725 accept domains = +mailhubdomains
727 message = unknown user
728 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
733 accept domains = +handled_domains
735 message = unknown user
736 verify = recipient/defer_ok
738 accept domains = +rcpthosts
740 message = unrouteable address
743 accept hosts = +debianhosts
745 accept authenticated = *
747 deny message = relay not permitted
749 #!!# ACL that is used after the DATA command
751 require verify = header_syntax
752 message = Invalid syntax in the header
756 if nodeinfo['rtmaster']
758 deny condition = ${if eq {$acl_m1}{RTMail}}
759 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
760 {!match {${lc:$rh_Subject:]}} {\\[rt.debian.org }} \
761 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
762 message = messages to the Request Tracker system require a subject tag or a subaddress
769 if nodeinfo['packagesmaster']
771 deny !hosts = +debianhosts : 217.196.43.134
772 condition = ${if eq {$acl_m1}{PTSMail}}
773 condition = ${if def:h_X-PTS-Approved:{false}{true}}
774 message = messages to the PTS require an X-PTS-Approved header
779 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
780 message = Blackisted URI found in body
782 deny condition = ${if eq {$acl_m1}{DBSignedMail}}
783 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
784 {!match {$message_body}{PGP SIGNED MESSAGE}} \
785 {!match {$message_body}{PGP SIGNATURE}} \
786 {!match {$header_content-type:}{multipart/signed}} \
787 {!match {$header_content-type:}{pgp}} \
790 message = Mail to this address needs to be PGP-signed
792 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
793 # postfix's strict_7bit_headers option, but only checks a few common problem
794 # headers, as there doesn't appear to be an easy way to check them all.
796 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
797 {match {$rh_To:}{[\200-\377]}}\
798 {match {$rh_From:}{[\200-\377]}}\
799 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
800 message = improper use of 8-bit data in message header: message rejected
803 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
804 message = Your mailer is not RFC 2047 compliant: message rejected
808 if has_variable?("clamd") && clamd == "true"
813 message = malware detected: $malware_name: message rejected
819 deny spam = $value/defer_ok
820 domains = +handled_domains : +rcpthosts
821 message = message got a spam score of $spam_score
822 local_parts = ${if exists {/etc/exim4/sa_users}\
823 {${if match_domain{$domain}{+virtual_domains}\
824 {${lookup{$local_part@$domain}nwildlsearch{/etc/exim4/sa_users}{$local_part}{}}}\
825 {${lookup{$local_part}lsearch{/etc/exim4/sa_users}{$local_part}{}}}}}}
827 # Check header_sender except for survey@popcon.d.o
828 deny condition = ${if eq{$acl_m1}{PopconMail}{false}{true}}
829 !verify = header_sender
830 message = No valid sender found in the From:, Sender: and Reply-to: headers
836 ######################################################################
837 # REWRITE CONFIGURATION #
838 ######################################################################
844 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
845 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
846 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
847 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
848 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
849 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
852 #!!#######################################################!!#
853 #!!# Here follow routers created from the old routers, #!!#
854 #!!# for handling non-local domains. #!!#
855 #!!#######################################################!!#
861 ######################################################################
862 # ROUTERS CONFIGURATION #
863 # Specifies how addresses are handled #
864 ######################################################################
865 # ORDER DOES MATTER #
866 # An address is passed to each in turn until it is accepted. #
867 ######################################################################
871 if nodeinfo['mailrelay']
875 domains = +mailhubdomains
876 transport = remote_smtp
877 route_data = ${lookup{$domain}lsearch{/etc/exim4/manualroute}}
878 require_files = /etc/exim4/manualroute
885 debug_print = "R: bsmtp for $local_part@$domain"
887 domains = !+local_domains
888 require_files = /etc/exim4/bsmtp
889 route_list = * ${extract{file}{\
890 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
894 # This router routes to remote hosts over SMTP by explicit IP address,
895 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
896 # require this facility, which is why it is enabled by default in Exim.
898 debug_print = "R: ipliteral for $local_part@$domain"
900 domains = !+handled_domains
901 transport = remote_smtp
902 ignore_target_hosts = +reservedaddrs
906 if not nodeinfo['smarthost'].empty?
909 debug_print = "R: smarthost for $local_part@$domain"
911 domains = !+handled_domains
912 transport = remote_smtp_smarthost
913 route_list = * ' + nodeinfo['smarthost'] + '
914 host_find_failed = defer
915 same_domain_copy_routing = yes
922 # This router routes to remote hosts over SMTP using a DNS lookup.
923 # Ignore reserved network responses, including localhost.
925 debug_print = "R: dnslookup for $local_part@$domain"
927 domains = !+handled_domains
928 transport = remote_smtp
929 ignore_target_hosts = +reservedaddrs
932 # This router handles aliasing using a traditional /etc/aliases file.
933 # If any of your aliases expand to pipes or files, you will need to set
934 # up a user and a group for these deliveries to run under. You can do
935 # this by uncommenting the "user" option below (changing the user name
936 # as appropriate) and adding a "group" option if necessary.
939 debug_print = "R: system_aliases for $local_part@$domain"
943 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
944 domains = +local_domains
945 file_transport = address_file
946 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
947 pipe_transport = address_pipe
950 # This router handles forwarding using traditional .forward files.
951 # It also allows mail filtering when a forward file starts with the
952 # string "# Exim filter": to disable filtering, uncomment the "filter"
953 # option. The check_ancestor option means that if the forward file
954 # generates an address that is an ancestor of the current one, the
955 # current one gets passed on instead. This covers the case where A is
956 # aliased to B and B has a .forward file pointing to A.
958 # For standard debian setup of one group per user, it is acceptable---normal
959 # even---for .forward to be group writable. If you have everyone in one
960 # group, you should comment out the "modemask" line. Without it, the exim
961 # default of 022 will apply, which is probably what you want.
964 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
969 directory_transport = address_directory
970 domains = +local_domains
971 # filter - I have disabled filtering to force users to use .forward-foo files
972 # or procmail. This will make it easier to move mailers in the future
974 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
975 # also checks if the .forward-bar exists, if not then it uses
976 # .forward-default instead.
977 file = $home/.forward\
978 ${if eq{}{$local_part_suffix}{}{\
979 ${if exists {${home}/.forward${local_part_suffix}} \
980 {${local_part_suffix}}{-default}}\
983 file_transport = address_file
984 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
985 local_part_suffix = -*
986 local_part_suffix_optional
988 pipe_transport = address_pipe
989 reply_transport = address_reply
990 require_files = $home
991 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
995 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
999 directory_transport = address_directory
1000 domains = +local_domains
1001 # filter - I have disabled filtering to force users to use .forward-foo files
1002 # or procmail. This will make it easier to move mailers in the future
1004 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1005 # also checks if the .forward-bar exists, if not then it uses
1006 # .forward-default instead.
1007 file = $home/.forward\
1008 ${if eq{}{$local_part_suffix}{}{\
1009 ${if exists {${home}/.forward${local_part_suffix}} \
1010 {${local_part_suffix}}{-default}}\
1013 file_transport = address_file
1014 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1015 local_part_suffix = -*
1016 local_part_suffix_optional
1018 pipe_transport = address_pipe
1019 reply_transport = address_reply
1020 require_files = $home
1023 # This delivers to procmail
1025 debug_print = "R: procmail for $local_part@$domain"
1028 domains = +local_domains
1029 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1032 require_files = $local_part:$home/.procmailrc
1033 transport = procmail_pipe
1034 transport_current_directory = $home
1036 # This driver delivers to the LDAP generated alias file.
1038 debug_print = "R: ldap_aliases for $local_part@$domain"
1042 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
1043 {${lookup{$local_part}cdb\
1044 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
1045 domains = +local_domains
1046 file_transport = address_file
1047 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1048 pipe_transport = address_pipe
1049 retry_use_local_part
1051 # This director matches local user mailboxes.
1053 debug_print = "R: localuser for $local_part@$domain"
1056 domains = +local_domains
1057 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1058 # Disable if the user has never logged in
1059 require_files = $home
1060 transport = local_delivery
1063 # Now we begin the Virtual Domain configuration
1064 # Everything before here should apply only to the local domains with a
1067 # exim4 fails the router if it can't change to the user/group for delivery
1068 # during verification. So we have to seperate the cases of verifying
1069 # the virts, and delivering to them. blah.
1072 if nodeinfo['packagesmaster']
1074 # This router delivers for packages.d.o
1076 debug_print = "R: packages for $local_part@$domain"
1078 file_transport = address_file
1079 pipe_transport = address_pipe
1080 domains = packages.debian.org
1081 require_files = /org/packages.debian.org/conf/maintainer
1082 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
1083 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1084 transport_home_directory = /org/packages.debian.org/mail
1085 transport_current_directory = /org/packages.debian.org/mail
1087 retry_use_local_part
1096 if nodeinfo['bugsmaster']
1098 # This router delivers for bugs.d.o
1100 debug_print = "R: bugs for $local_part@$domain"
1102 transport = bugs_pipe
1103 domains = bugs.debian.org
1104 cannot_route_message = Unknown or archived bug
1105 require_files = /org/bugs.debian.org/mail/run-procmail
1107 local_parts = ${if match\
1109 {\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}\
1110 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
1111 {$local_part}fail}}fail}
1119 if nodeinfo['rtmaster']
1121 # This router delivers for rt.d.o
1122 rt_force_new_verbose:
1123 debug_print = "R: rt for $local_part+new@$domain"
1125 domains = rt.debian.org
1126 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1127 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1128 local_part_suffix = +new
1129 pipe_transport = rt_pipe
1130 data = "|/usr/bin/rt-mailgate --queue \'${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}}\' --url https://rt.debian.org/ --action ${if match{$local_part}{.*-comment.*}{comment}{correspond}}"
1131 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1133 # FIXME: figure out how to generalize this approach so that all of the following would work
1134 # - rt+NNNN@rt.debian.org : attach correspondence to ticket (verbose)
1135 # - rt+NNNN-quiesce@rt.debian.org : attach correspondence to ticket (quiesce)
1136 # - rt+NNNN-<action>@rt.debian.org : attach correspondence to ticket (some action)
1137 # requires modification to custom condition in \'scrips\'
1138 rt_force_new_quiesce:
1139 debug_print = "R: rt for $local_part+new-quiesce@$domain"
1141 domains = rt.debian.org
1142 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1143 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1144 local_part_suffix = +new-quiesce
1145 pipe_transport = rt_pipe
1146 data = "|/usr/bin/rt-mailgate --queue \'${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}}\' --url https://rt.debian.org/ --action ${if match{$local_part}{.*-comment.*}{comment}{correspond}}"
1147 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}\nX-RT-Mode: quiesce"
1150 debug_print = "R: rt for $local_part@$domain"
1152 domains = rt.debian.org
1153 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1154 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1155 local_part_suffix = +*
1156 local_part_suffix_optional
1157 pipe_transport = rt_pipe
1158 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}}"
1159 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1166 debug_print = "R: virt_aliases for $local_part@$domain"
1168 data = ${if exists{\
1169 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1170 {${lookup{$local_part}lsearch*{\
1171 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1173 directory_transport = address_directory
1174 cannot_route_message = Unknown user
1175 domains = +virtual_domains
1176 file_transport = address_file
1177 pipe_transport = address_pipe
1178 qualify_preserve_domain
1179 retry_use_local_part
1180 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1181 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1185 debug_print = "R: virt_direct for $local_part@$domain"
1191 directory_transport = address_directory
1192 domains = +virtual_domains
1193 file = $home/.forward-\
1194 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1196 file_transport = address_file
1197 pipe_transport = address_pipe
1198 reply_transport = address_reply
1199 retry_use_local_part
1200 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1201 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1204 # This is a senmailesque alias file lookup
1206 debug_print = "R: virt_aliases for $local_part@$domain"
1210 data = ${if exists{\
1211 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1212 {${lookup{$local_part}lsearch*{\
1213 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1215 directory_transport = address_directory
1216 domains = +virtual_domains
1217 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1218 cannot_route_message = Unknown user
1219 group = ${extract{group}{VDOMAINDATA}}
1220 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1221 pipe_transport = address_pipe
1222 qualify_preserve_domain
1223 retry_use_local_part
1224 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1225 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1227 user = ${extract{user}{VDOMAINDATA}}
1229 # This is a qmailesque deliver into a directory of .forward files
1231 debug_print = "R: virt_direct for $local_part@$domain"
1237 directory_transport = address_directory
1238 domains = +virtual_domains
1239 file = $home/.forward-\
1240 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1242 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1243 group = ${extract{group}{VDOMAINDATA}}
1244 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1246 pipe_transport = address_pipe
1247 reply_transport = address_reply
1248 retry_use_local_part
1249 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1250 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1252 user = ${extract{user}{VDOMAINDATA}}
1253 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1255 ######################################################################
1256 # TRANSPORTS CONFIGURATION #
1257 ######################################################################
1258 # ORDER DOES NOT MATTER #
1259 # Only one appropriate transport is called for each delivery. #
1260 ######################################################################
1265 # This transport is used for local delivery to user mailboxes. On debian
1266 # systems group mail is used so we can write to the /var/mail
1267 # directory. (The alternative, which most other unixes use, is to deliver
1268 # as the user's own group, into a sticky-bitted directory)
1271 file = /var/mail/${local_part}
1274 no_mode_fail_narrower
1277 # This transport is used for handling pipe addresses generated by alias
1278 # or .forward files. It has a conventional name, since it is not actually
1279 # mentioned elsewhere in this configuration file. (A different name *can*
1280 # be specified via the "address_pipe_transport" option if you really want
1281 # to.) If the pipe generates any standard output, it is returned to the sender
1282 # of the message as a delivery error. Set return_fail_output instead if you
1283 # want this to happen only when the pipe fails to complete normally.
1287 current_directory = ${home}
1288 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1289 EXT=${substr_1:${local_part_suffix}}:\
1290 LOCAL=${local_part}${local_part_suffix}:\
1291 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1295 # This transport is used for handling file addresses generated by alias
1296 # or .forward files. It has a conventional name, since it is not actually
1297 # mentioned elsewhere in this configuration file.
1307 directory_mode = 0770
1308 mode_fail_narrower = false
1310 # This transport is used for handling file addresses generated by alias
1311 # or .forward files if the path ends in "/", which causes it to be treated
1312 # as a directory name rather than a file name. Each message is then delivered
1313 # to a unique file in the directory. If instead you want all such deliveries to
1314 # be in the "maildir" format that is used by some other mail software,
1315 # uncomment the final option below. If this is done, the directory specified
1316 # in the .forward or alias file is the base maildir directory.
1318 # Should you want to be able to specify either maildir or non-maildir
1319 # directory-style deliveries, then you must set up yet another transport,
1320 # called address_directory2. This is used if the path ends in "//" so should
1321 # be the one used for maildir, as the double slash suggests another level
1322 # of directory. In the absence of address_directory2, paths ending in //
1323 # are passed to address_directory.
1333 # This transport is used for handling autoreplies generated by the filtering
1334 # option of the forwardfile director. It has a conventional name, since it
1335 # is not actually mentioned elsewhere in this configuration file.
1339 # This transport is used for delivering messages over SMTP connections.
1343 connect_timeout = 1m
1346 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1347 out = " tls_certificate = /etc/exim4/ssl/thishost.crt
1348 tls_privatekey = /etc/exim4/ssl/thishost.key"
1355 if not nodeinfo['smarthost'].empty?
1357 remote_smtp_smarthost:
1358 debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
1361 out += nodeinfo['smarthost_port'].to_s + "\n"
1362 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1363 out += ' tls_tempfail_tryclear = false
1364 hosts_require_tls = ' + nodeinfo['smarthost'] + '
1365 tls_certificate = /etc/exim4/ssl/thishost.crt
1366 tls_privatekey = /etc/exim4/ssl/thishost.key
1373 # Send the message to procmail
1376 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1378 user = ${local_part}
1387 user = ${extract{user}{\
1388 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1394 if nodeinfo['bugsmaster']
1398 command = /org/bugs.debian.org/mail/run-procmail
1399 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1400 EXT=${substr_1:${local_part_suffix}}:\
1401 LOCAL=${local_part}${local_part_suffix}:\
1402 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1413 if nodeinfo['rtmaster']
1416 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1419 environment = EXTENSION=${substr_1:${local_part_suffix}}
1420 allow_commands = /usr/bin/rt-mailgate
1426 ######################################################################
1427 # RETRY CONFIGURATION #
1428 ######################################################################
1430 # This single retry rule applies to all domains and all errors. It specifies
1431 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1432 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1433 # hours, then retries every 8 hours until 4 days have passed since the first
1436 # Domain Error Retries
1437 # ------ ----- -------
1442 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1443 * * senders=: F,2h,10m
1444 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1445 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1447 # End of Exim 4 configuration