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_c_scr
83 ######################################################################
84 # MAIN CONFIGURATION SETTINGS #
85 ######################################################################
89 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
91 perl_startup = do '/etc/exim4/exim_surbl.pl'
97 # These options specify the Access Control Lists (ACLs) that
98 # are used for incoming SMTP messages - after the RCPT and DATA
99 # commands, respectively.
101 acl_smtp_helo = check_helo
102 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
103 acl_smtp_data = check_message
106 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
107 out = "acl_smtp_mime = acl_check_mime"
111 acl_smtp_predata = acl_check_predata
113 # accept domain literal syntax in e-mail addresses. To actually make use of
114 # this a router is also required
115 allow_domain_literals = true
117 # This setting defines a named domain list called
118 # local_domains. It will be referenced
119 # later on by the syntax "+local_domains".
120 # Other domain and host lists may follow.
121 # @ is the local FQDN, @[] matches the IP adress of any local interface.
123 .include_if_exists /etc/exim4/local-settings.conf
125 domainlist local_domains = @ : \
128 ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
130 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
132 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
134 domainlist handled_domains = +local_domains : +virtual_domains
136 localpartlist local_only_users = lsearch;/etc/exim4/localusers
138 # Domains we relay for; that is domains that aren't considered local but we
139 # accept mail for them.
140 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
141 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
144 if nodeinfo['mailrelay']
146 domainlist mailhubdomains = lsearch;/etc/exim4/manualroute
152 hostlist reservedaddrs = <%= nodeinfo['reservedaddrs'] %>
155 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
156 out = "tls_certificate = /etc/exim4/ssl/thishost.crt
157 tls_privatekey = /etc/exim4/ssl/thishost.key
158 tls_try_verify_hosts = *
159 tls_verify_certificates = /etc/exim4/ssl/ca.crt
160 tls_crl = /etc/exim4/ssl/ca.crl"
165 # The setting below causes Exim to do a reverse DNS lookup on all incoming
166 # IP calls, in order to get the true host name. If you feel this is too
167 # expensive, you can specify the networks for which a lookup is done, or
168 # remove the setting entirely.
170 dns_ipv4_lookup = !localhost
172 # If this option is set, then any process that is running as one of the
173 # listed users may pass a message to Exim and specify the sender's
174 # address using the "-f" command line option, without Exim's adding a
177 untrusted_set_sender = *
179 # Some operating systems use the "gecos" field in the system password file
180 # to hold other information in addition to users' real names. Exim looks up
181 # this field when it is creating "sender" and "from" headers. If these options
182 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
183 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
186 gecos_pattern = ^([^,:]*)
189 # This tells exim to immediately discard error messages (ie double bounces).
190 ignore_bounce_errors_after = 0s
192 timeout_frozen_after=14d
194 message_size_limit = 100M
196 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
197 <% if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty? %>
198 smtp_accept_max = 300
199 smtp_accept_queue = 200
200 smtp_accept_queue_per_connection = 50
203 smtp_accept_queue = 20
204 smtp_accept_queue_per_connection = 10
206 smtp_accept_reserve = 25
207 smtp_reserve_hosts = +debianhosts
209 split_spool_directory = true
210 check_spool_inodes = 200
211 check_spool_space = 20M
215 <% if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty? %>
217 deliver_queue_load_max = 50
221 deliver_queue_load_max = 10
224 queue_list_requires_admin = false
227 if has_variable?("clamd") && clamd == "true"
228 out = "av_scanner = clamd:/var/run/clamav/clamd.ctl"
235 out = "daemon_smtp_ports = "
238 if nodeinfo['bugsmaster']
242 if not nodeinfo['mail_port'].to_s.empty?
243 ports << nodeinfo['mail_port']
246 if nodeinfo['mailrelay']
247 ports << nodeinfo['smarthost_port']
250 out += ports.uniq.sort.join(" : ")
255 remote_sort_domains = *.debian.org:*.debian.net
257 pipelining_advertise_hosts = !*
259 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
260 out = 'tls_advertise_hosts = *'
264 smtp_enforce_sync = true
266 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
268 received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
269 {${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
270 ${if and {{eq {$tls_certificate_verified}{1}}{def:tls_peerdn}}{from $tls_peerdn (verified)\n\t}}\
271 by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}\
272 (Exim $version_number)\n\t\
273 ${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
274 id $message_exim_id${if def:received_for {\n\tfor $received_for}}
278 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
279 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
280 ${if exists {/srv/$domain/mail/whitelist}{\
281 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
283 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
284 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
285 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
286 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
287 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
288 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
289 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
291 ######################################################################
292 # ACL CONFIGURATION #
293 ######################################################################
297 # This is a bad hack to reset the variable, by defining it be something
300 warn set acl_m_rprf = $acl_m_undefined
302 warn recipients = survey@popcon.debian.org
303 set acl_m_rprf = PopconMail
305 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
307 warn local_parts = +local_only_users
308 domains = +local_domains
309 hosts = !+debianhosts
310 set acl_m_rprf = localonly
312 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
316 if nodeinfo['rtmaster']
318 warn domains = rt.debian.org
319 set acl_m_rprf = RTMail
321 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
328 if nodeinfo['packagesmaster']
330 warn domains = packages.debian.org
331 set acl_m_rprf = PackagesMail
333 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
340 if nodeinfo['packagesqamaster']
342 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
343 set acl_m_rprf = PTSOwner
345 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
348 domains = packages.qa.debian.org
349 condition = ${if match{$local_part}{\N^bounces+\N}}
350 set acl_m_rprf = PTSListBounce
352 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
354 warn domains = packages.qa.debian.org
355 set acl_m_rprf = PTSMail
357 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
362 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
363 set acl_m_rprf = DBSignedMail
365 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
367 warn set acl_m_rprf = normal
373 warn set acl_c_scr = 0
377 if nodeinfo['mailrelay']
378 out = " accept verify = certificate"
383 # These are in HELO acl so that they are only run once. They increment a counter,
384 # so we don't want it to increment per rcpt to.
386 warn dnslists = list.dnswl.org&0.0.0.3
387 log_message = Hit on list.dnswl.org for $sender_host_address
388 set acl_c_scr = ${eval:$acl_c_scr-30}
390 warn dnslists = list.dnswl.org&0.0.0.2
391 log_message = Hit on list.dnswl.org for $sender_host_address
392 set acl_c_scr = ${eval:$acl_c_scr-20}
394 warn dnslists = list.dnswl.org
395 log_message = Hit on list.dnswl.org for $sender_host_address
396 set acl_c_scr = ${eval:$acl_c_scr-10}
398 warn condition = ${if isip {$sender_helo_name}{true}{false}}
399 log_message = remote host used IP address in HELO/EHLO greeting
400 set acl_c_scr = ${eval:$acl_c_scr+20}
402 warn !hosts = +debianhosts
403 condition = ${if eq{$host_lookup_failed}{1}}
404 set acl_c_scr = ${eval:$acl_c_scr+20}
406 warn !hosts = +debianhosts
407 condition = ${if eq{$host_lookup_failed}{0}}
408 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}}
409 set acl_c_scr = ${eval:$acl_c_scr+20}
411 warn !hosts = +debianhosts
412 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}}
413 set acl_c_scr = ${eval:$acl_c_scr+20}
415 warn !hosts = +debianhosts
416 dnslists = dul.dnsbl.sorbs.net
417 set acl_c_scr = ${eval:$acl_c_scr+15}
419 # If the sender's helo name is empty, the message will be rejected later
420 # because the helo is empty. If the rDNS lookup failed, we are already
421 # going to greylist them, so no sense worrying about it here. Finally,
422 # if rDNS does not match helo name (both lower cased first), greylist.
424 warn !hosts = +debianhosts
425 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
426 condition = ${if def:sender_helo_name {yes}{no}}
427 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
428 log_message = HELO doesn't match rDNS
429 set acl_c_scr = ${eval:$acl_c_scr+8}
432 # matches 098325879 - looks fishy
434 warn condition = ${if and { \
435 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
436 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
439 log_message = non-FQDN HELO
440 set acl_c_scr = ${eval:$acl_c_scr+12}
442 # Matches DOMAIN99.com - looks bad
444 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
445 log_message = SHOUTING HELO
446 set acl_c_scr = ${eval:$acl_c_scr+7}
448 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
449 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
450 # naive test, so it's not worth much
452 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
453 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
454 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
455 log_message = random HELO
456 set acl_c_scr = ${eval:$acl_c_scr+5}
458 # Implicit, but simpler to just say it
461 #!!# ACL that is used after the RCPT command on the submission port
464 # Accept if the source is local SMTP (i.e. not over TCP/IP).
465 # We do this by testing for an empty sending host field.
466 accept hosts = : 127.0.0.1
470 if nodeinfo['mailrelay']
471 out = " accept verify = certificate"
476 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
477 # This is a rough pass at preventing addres harvesting or other mail blasts.
479 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
480 message = Too many bad recipients, try again later
481 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
484 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
485 !hosts = +debianhosts
486 message = sorry, only 5 reports per hour for submission
488 accept domains = +local_domains
491 message = unknown user
496 if nodeinfo['mailrelay']
498 accept domains = +mailhubdomains
500 message = unknown user
501 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
507 accept domains = +submission_domains
509 message = unknown user
512 deny message = relay not permitted
514 #!!# ACL that is used after the RCPT command
519 if nodeinfo['mailrelay']
520 out = " accept verify = certificate"
525 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
526 # This is a rough pass at preventing addres harvesting or other mail blasts.
528 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
529 message = Too many bad recipients, try again later
530 !hosts = +debianhosts
531 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
533 # Dump spambots that are so stupid they say helo as our IP address
535 drop !hosts = +debianhosts
536 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
537 message = HELO mismatch Forged HELO for ($sender_helo_name)
539 # Also for spambots that say helo as us or one of our domains
541 drop !hosts = +debianhosts
542 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
543 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
544 message = HELO mismatch Forged HELO for ($sender_helo_name)
546 # This logic gives you a list of commonly forged domains in helo to reject against
548 warn set acl_m_frg = ${lookup{$sender_helo_name} \
549 nwildlsearch{/etc/exim4/helo-check} \
550 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
552 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
553 # say helo as a name in the list but we can't look them up
555 defer !hosts = +debianhosts
556 condition = ${if eq{$acl_m_frg}{}{no}{yes}}
557 condition = ${if eq{$sender_host_name}{}{yes}{no}}
558 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
559 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
561 # If DNS works, go ahead and reject them
563 drop !hosts = +debianhosts
564 condition = ${if and { {!eq{$acl_m_frg}{}}{!match{$sender_host_name}{${rxquote:$acl_m_frg}\N$\N}}}{yes}{no}}
565 message = HELO mismatch Forged HELO for ($sender_helo_name)
567 # disabled accounts don't even get local mail.
568 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
569 domains = +local_domains
570 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
572 deny domains = +virtual_domains
573 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
574 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
576 hosts = !+debianhosts
577 message = mail for <$local_part@$domain> only accepted from debian.org machines
578 # Accept if the source is local SMTP (i.e. not over TCP/IP).
579 # We do this by testing for an empty sending host field.
582 deny domains = +handled_domains
583 local_parts = ^[.] : ^.*[@%!/|]
585 deny domains = !+handled_domains
586 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
588 # forwards mail to @d.o address, even if it's a bounce from master, no reply
589 # from source address; rejecting all mail now.
590 deny recipients = mendoza@debian.org
591 hosts = 65.110.39.147 : 64.39.31.15
592 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
594 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
595 sender_domains= +local_domains : debian.org : debian.net : debian.com
596 hosts = !+debianhosts
597 message = mail from <$sender_address> not allowed externally
599 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
600 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
601 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
602 message = no mail should ever come from <$sender_address>
604 warn acl = acl_getprofile
605 condition = ${if eq{$acl_m_prf}{}}
606 set acl_m_prf = $acl_m_rprf
608 defer condition = ${if eq{$acl_m_prf}{$acl_m_rprf}{no}{yes}}
609 log_message = Only one profile at a time, please
611 warn condition = ${if eq{$acl_m_prf}{localonly}}
612 set acl_m_lrc = ${if eq{$acl_m_lrc}{}{$local_part@$domain}{$acl_m_lrc, $local_part@$domain}}
618 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
619 hosts = !+debianhosts
620 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
627 if nodeinfo['packagesmaster']
629 warn condition = ${if eq {$acl_m_prf}{PackagesMail}}
630 condition = ${if eq {$sender_address}{$local_part@$domain}}
631 message = X-Packages-FromTo-Same: yes
636 deny condition = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
639 defer !hosts = +debianhosts
640 condition = ${if >{${eval:$acl_c_scr}}{0}}
641 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
642 message = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
645 if has_variable?("policydweight") && policydweight == "true"
647 # Check with policyd-weight - this only works with a version after etch\'s,
648 # sadly. etch\'s version attempts to hold the socket open, since that\'s what
649 # postfix expects. Exim, on the other hand, expects the remote side to close
650 # the socket when it\'s finished sending data, so it see each transaction as
651 # an incomplete read. I\'m sure there\'s a way we could force exim to do
652 # something sick and clever to force either the interpretation or the socket
653 # closure, but I\'m fairly sure it\'s now worth it, since the backport of
654 # policyd-weight is trivial.
655 warn !hosts = +debianhosts
656 set acl_m_pw = ${readsocket{inet:127.0.0.1:12525}\
657 {request=smtpd_access_policy\n\
658 protocol_state=RCPT\n\
659 protocol_name=${uc:$received_protocol}\n\
660 helo_name=$sender_helo_name\n\
661 queue_id=$message_exim_id\n\
662 sender=$sender_address\n\
663 recipient=$local_part@$domain\n\
664 recipient_count=$rcpt_count\n\
665 client_address=$sender_host_address\n\
666 client_name=$sender_host_name\n\
667 reverse_client_name=$sender_host_name\n\
668 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
669 {20s}{\n}{socket failure}}
671 # Defer on socket error
672 defer !hosts = +debianhosts
673 condition = ${if eq{$acl_m_pw}{socket failure}{yes}{no}}
674 message = Cannot connect to policyd-weight. Please try again later.
676 # Set proposed action to $acl_m_act and message to $acl_m_mes
677 warn !hosts = +debianhosts
678 set acl_m_mes = ${extract{action}{$acl_m_pw}}
679 set acl_m_act = ${sg{$acl_m_pw}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
681 # Add X-policyd-weight header line to message
682 warn !hosts = +debianhosts
684 condition = ${if eq{$acl_m_act}{PREPEND}{yes}{no}}
686 # Write log message, if policyd-weight can\'t run checks
687 warn !hosts = +debianhosts
688 log_message = policyd-weight message: $acl_m_mes
689 condition = ${if eq{$acl_m_act}{DUNNO}{yes}{no}}
691 # Deny mails which policyd-weight thinks are spam
692 deny !hosts = +debianhosts
693 message = policyd-weight said: $acl_m_mes
694 condition = ${if eq{$acl_m_act}{550}{yes}{no}}
696 # Defer messages when policyd-weight suggests so.
697 defer !hosts = +debianhosts
698 message = policyd-weight said: $acl_m_mes
699 condition = ${if eq{$acl_m_act}{450}{yes}{no}}
706 if nodeinfo['rtmaster']
708 warn condition = ${if eq{$acl_m_prf}{RTMail}}
709 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if or{{match{$local_part}{\N[^+]+\+\d+\N}}{match{$local_part}{\N[^+]+\+new\N}}} {RTMailRecipientHasSubaddress}}}}
716 if has_variable?("greylistd") && greylistd == "true"
719 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
720 log_message = greylisted.
721 local_parts = ${if match_domain{$domain}{+virtual_domains}\
722 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
723 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
724 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
725 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
727 !hosts = : +debianhosts : WHITELIST : \
728 ${if exists {/etc/greylistd/whitelist-hosts}\
729 {/etc/greylistd/whitelist-hosts}{}} : \
730 ${if exists {/var/lib/greylistd/whitelist-hosts}\
731 {/var/lib/greylistd/whitelist-hosts}{}}
733 domains = +handled_domains : +rcpthosts
734 condition = ${readsocket{/var/run/greylistd/socket}\
736 $sender_host_address \
738 $local_part@$domain}\
741 elsif has_variable?("postgrey") && postgrey == "true"
743 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
744 # this adds acl_m_grey if there isn\'t one (so unique per message)
747 !hosts = : +debianhosts : WHITELIST
748 condition = ${if def:acl_m_grey {no}{yes}}
749 set acl_m_grey = $pid.$tod_epoch.$sender_host_port
751 # and defers the message if postgrey thinks it should be defered ...
754 !hosts = : +debianhosts : WHITELIST
756 domains = +handled_domains : +rcpthosts
757 local_parts = GREYLIST_LOCAL_PARTS
758 set acl_m_pgr = request=smtpd_access_policy\n\
759 protocol_state=RCPT\n\
760 protocol_name=${uc:$received_protocol}\n\
761 instance=${acl_m_grey}\n\
762 helo_name=${sender_helo_name}\n\
763 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
764 client_name=${sender_host_name}\n\
765 sender=${sender_address}\n\
766 recipient=$local_part@$domain\n\n
767 set acl_m_pgr = ${sg{\
768 ${readsocket{/var/run/postgrey/socket}{$acl_m_pgr}\
769 {5s}{}{action=DUNNO}}\
771 message = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
772 log_message = greylisted.
773 condition = ${if eq{${uc:${substr{0}{5}{$acl_m_pgr}}}}{DEFER}}
775 # ... or adds a header with information about how long the delay was
778 !hosts = : +debianhosts : WHITELIST
780 domains = +handled_domains : +rcpthosts
781 local_parts = GREYLIST_LOCAL_PARTS
782 condition = ${if eq{${uc:${substr_0_7:$acl_m_pgr}}}{PREPEND}}
783 message = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
789 accept local_parts = postmaster
790 domains = +handled_domains : +rcpthosts
792 deny log_message = <$sender_address> is blacklisted
793 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
794 message = We have blacklisted <$sender_address>. Please stop mailing us
796 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
797 dnslists = ${if match_domain{$domain}{+virtual_domains}\
798 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
799 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
800 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
801 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
802 domains = +handled_domains : +rcpthosts
803 !hosts = +debianhosts : WHITELIST
805 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
806 dnslists = ${if match_domain{$domain}{+virtual_domains}\
807 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
808 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
809 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
810 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
811 domains = +handled_domains : +rcpthosts
812 !hosts = +debianhosts : WHITELIST
814 deny domains = +handled_domains : +rcpthosts
815 local_parts = ${if match_domain{$domain}{+virtual_domains}\
816 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
817 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
818 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
819 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
820 !hosts = +debianhosts : WHITELIST
821 !verify = sender/callout
825 if nodeinfo['mailrelay']
827 accept domains = +mailhubdomains
829 message = unknown user
830 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
835 accept domains = +handled_domains
837 message = unknown user
838 verify = recipient/defer_ok
840 accept domains = +rcpthosts
842 message = unrouteable address
845 accept hosts = +debianhosts
847 accept authenticated = *
849 deny message = relay not permitted
853 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
857 deny condition = ${if <{$message_size}{256000}}
858 set acl_m_srb = ${perl{surblspamcheck}}
859 condition = ${if eq{$acl_m_srb}{false}{no}{yes}}
860 log_message = $acl_m_srb
870 deny condition = ${if eq{$acl_m_lcl}{localonly}}
871 message = mail for $acl_m_lrc is only accepted internally
876 #!!# ACL that is used after the DATA command
878 require verify = header_syntax
879 message = Invalid syntax in the header
883 if nodeinfo['rtmaster']
885 deny condition = ${if eq {$acl_m_prf}{RTMail}}
886 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
887 {!match {${lc:$rh_Subject:]}} {\N\[rt.debian.org \N}} \
888 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
889 message = messages to the Request Tracker system require a subject tag or a subaddress
896 if nodeinfo['packagesqamaster']
898 deny !hosts = +debianhosts : 217.196.43.134
899 condition = ${if eq {$acl_m_prf}{PTSMail}}
900 condition = ${if def:h_X-PTS-Approved:{false}{true}}
901 message = messages to the PTS require an X-PTS-Approved header
906 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
907 message = Blackisted URI found in body
909 deny condition = ${if eq {$acl_m_prf}{DBSignedMail}}
910 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
911 {!match {$message_body}{PGP SIGNED MESSAGE}} \
912 {!match {$message_body}{PGP SIGNATURE}} \
913 {!match {$header_content-type:}{multipart/signed}} \
914 {!match {$header_content-type:}{pgp}} \
917 message = Mail to this address needs to be PGP-signed
919 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
920 # postfix's strict_7bit_headers option, but only checks a few common problem
921 # headers, as there doesn't appear to be an easy way to check them all.
923 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
924 {match {$rh_To:}{[\200-\377]}}\
925 {match {$rh_From:}{[\200-\377]}}\
926 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
927 message = improper use of 8-bit data in message header: message rejected
930 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
931 message = Your mailer is not RFC 2047 compliant: message rejected
935 if has_variable?("clamd") && clamd == "true"
940 message = malware detected: $malware_name: message rejected
947 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
949 deny condition = ${if <{$message_size}{256000}}
950 set acl_m_srb = ${perl{surblspamcheck}}
951 condition = ${if eq{$acl_m_srb}{false}{no}{yes}}
952 log_message = $acl_m_srb
958 # Check header_sender except for survey@popcon.d.o
959 deny condition = ${if eq{$acl_m_prf}{PopconMail}{false}{true}}
960 !verify = header_sender
961 message = No valid sender found in the From:, Sender: and Reply-to: headers
965 if nodeinfo['packagesmaster']
967 deny message = Congratulations, you scored $spam_score points.
968 log_message = spam: $spam_score points.
969 condition = ${if eq {$acl_m_prf}{PackagesMail}}
971 !verify = certificate
972 !hosts = +debianhosts
973 condition = ${if <{$message_size}{256000}}
974 spam = pkg_user : true
975 condition = ${if >{$spam_score_int}{59}}
984 ######################################################################
985 # REWRITE CONFIGURATION #
986 ######################################################################
992 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
993 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
994 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
995 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
996 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
997 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
1000 #!!#######################################################!!#
1001 #!!# Here follow routers created from the old routers, #!!#
1002 #!!# for handling non-local domains. #!!#
1003 #!!#######################################################!!#
1009 ######################################################################
1010 # ROUTERS CONFIGURATION #
1011 # Specifies how addresses are handled #
1012 ######################################################################
1013 # ORDER DOES MATTER #
1014 # An address is passed to each in turn until it is accepted. #
1015 ######################################################################
1019 if nodeinfo['mailrelay']
1022 driver = manualroute
1023 domains = +mailhubdomains
1024 transport = remote_smtp
1025 route_data = ${lookup{$domain}lsearch{/etc/exim4/manualroute}}
1026 require_files = /etc/exim4/manualroute
1033 debug_print = "R: bsmtp for $local_part@$domain"
1034 driver = manualroute
1035 domains = !+local_domains
1036 require_files = /etc/exim4/bsmtp
1037 route_list = * ${extract{file}{\
1038 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1042 # This router routes to remote hosts over SMTP by explicit IP address,
1043 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
1044 # require this facility, which is why it is enabled by default in Exim.
1046 debug_print = "R: ipliteral for $local_part@$domain"
1048 domains = !+handled_domains
1049 transport = remote_smtp
1050 ignore_target_hosts = +reservedaddrs
1054 if not nodeinfo['smarthost'].empty?
1057 debug_print = "R: smarthost for $local_part@$domain"
1058 driver = manualroute
1059 domains = !+handled_domains
1060 transport = remote_smtp_smarthost
1061 route_list = * ' + nodeinfo['smarthost'] + '
1062 host_find_failed = defer
1063 same_domain_copy_routing = yes
1070 # This router routes to remote hosts over SMTP using a DNS lookup.
1071 # Ignore reserved network responses, including localhost.
1073 debug_print = "R: dnslookup for $local_part@$domain"
1075 domains = !+handled_domains
1076 transport = remote_smtp
1077 ignore_target_hosts = +reservedaddrs
1080 # This router handles aliasing using a traditional /etc/aliases file.
1081 # If any of your aliases expand to pipes or files, you will need to set
1082 # up a user and a group for these deliveries to run under. You can do
1083 # this by uncommenting the "user" option below (changing the user name
1084 # as appropriate) and adding a "group" option if necessary.
1087 debug_print = "R: system_aliases for $local_part@$domain"
1091 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
1092 domains = +local_domains
1093 file_transport = address_file
1094 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1095 pipe_transport = address_pipe
1096 retry_use_local_part
1098 # This router handles forwarding using traditional .forward files.
1099 # It also allows mail filtering when a forward file starts with the
1100 # string "# Exim filter": to disable filtering, uncomment the "filter"
1101 # option. The check_ancestor option means that if the forward file
1102 # generates an address that is an ancestor of the current one, the
1103 # current one gets passed on instead. This covers the case where A is
1104 # aliased to B and B has a .forward file pointing to A.
1106 # For standard debian setup of one group per user, it is acceptable---normal
1107 # even---for .forward to be group writable. If you have everyone in one
1108 # group, you should comment out the "modemask" line. Without it, the exim
1109 # default of 022 will apply, which is probably what you want.
1112 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1117 directory_transport = address_directory
1118 domains = +local_domains
1119 # filter - I have disabled filtering to force users to use .forward-foo files
1120 # or procmail. This will make it easier to move mailers in the future
1122 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1123 # also checks if the .forward-bar exists, if not then it uses
1124 # .forward-default instead.
1125 file = $home/.forward\
1126 ${if eq{}{$local_part_suffix}{}{\
1127 ${if exists {${home}/.forward${local_part_suffix}} \
1128 {${local_part_suffix}}{-default}}\
1131 file_transport = address_file
1132 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1133 local_part_suffix = -*
1134 local_part_suffix_optional
1136 pipe_transport = address_pipe
1137 reply_transport = address_reply
1138 require_files = $home
1139 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
1143 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1147 directory_transport = address_directory
1148 domains = +local_domains
1149 # filter - I have disabled filtering to force users to use .forward-foo files
1150 # or procmail. This will make it easier to move mailers in the future
1152 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1153 # also checks if the .forward-bar exists, if not then it uses
1154 # .forward-default instead.
1155 file = $home/.forward\
1156 ${if eq{}{$local_part_suffix}{}{\
1157 ${if exists {${home}/.forward${local_part_suffix}} \
1158 {${local_part_suffix}}{-default}}\
1161 file_transport = address_file
1162 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1163 local_part_suffix = -*
1164 local_part_suffix_optional
1166 pipe_transport = address_pipe
1167 reply_transport = address_reply
1168 require_files = $home
1171 # This delivers to procmail
1173 debug_print = "R: procmail for $local_part@$domain"
1176 domains = +local_domains
1177 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1180 require_files = $local_part:$home/.procmailrc
1181 transport = procmail_pipe
1182 transport_current_directory = $home
1184 # This driver delivers to the LDAP generated alias file.
1186 debug_print = "R: ldap_aliases for $local_part@$domain"
1190 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
1191 {${lookup{$local_part}cdb\
1192 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
1193 domains = +local_domains
1194 file_transport = address_file
1195 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1196 pipe_transport = address_pipe
1197 retry_use_local_part
1199 # This director matches local user mailboxes.
1201 debug_print = "R: localuser for $local_part@$domain"
1204 domains = +local_domains
1205 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1206 # Disable if the user has never logged in
1207 require_files = $home
1208 transport = local_delivery
1211 # Now we begin the Virtual Domain configuration
1212 # Everything before here should apply only to the local domains with a
1215 # exim4 fails the router if it can't change to the user/group for delivery
1216 # during verification. So we have to seperate the cases of verifying
1217 # the virts, and delivering to them. blah.
1220 if nodeinfo['packagesmaster']
1222 # This router delivers for packages.d.o
1224 debug_print = "R: packages for $local_part@$domain"
1226 file_transport = address_file
1227 pipe_transport = address_pipe
1228 domains = packages.debian.org
1229 require_files = /org/packages.debian.org/conf/maintainer
1230 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
1231 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1232 transport_home_directory = /org/packages.debian.org/mail
1233 transport_current_directory = /org/packages.debian.org/mail
1235 retry_use_local_part
1244 if nodeinfo['bugsmaster']
1246 # This router delivers for bugs.d.o
1248 debug_print = "R: bugs for $local_part@$domain"
1250 transport = bugs_pipe
1251 domains = bugs.debian.org
1252 cannot_route_message = Unknown or archived bug
1253 require_files = /org/bugs.debian.org/mail/run-procmail
1255 local_parts = ${if match\
1257 {\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}\
1258 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
1259 {$local_part}fail}}fail}
1267 if nodeinfo['rtmaster']
1269 # This router delivers for rt.d.o
1270 rt_force_new_verbose:
1271 debug_print = "R: rt for $local_part+new@$domain"
1273 domains = rt.debian.org
1274 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1275 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1276 local_part_suffix = +new
1277 pipe_transport = rt_pipe
1278 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}}"
1279 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1281 # FIXME: figure out how to generalize this approach so that all of the following would work
1282 # - rt+NNNN@rt.debian.org : attach correspondence to ticket (verbose)
1283 # - rt+NNNN-quiesce@rt.debian.org : attach correspondence to ticket (quiesce)
1284 # - rt+NNNN-<action>@rt.debian.org : attach correspondence to ticket (some action)
1285 # requires modification to custom condition in \'scrips\'
1286 rt_force_new_quiesce:
1287 debug_print = "R: rt for $local_part+new-quiesce@$domain"
1289 domains = rt.debian.org
1290 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1291 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1292 local_part_suffix = +new-quiesce
1293 pipe_transport = rt_pipe
1294 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}}"
1295 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}\nX-RT-Mode: quiesce"
1298 debug_print = "R: rt for $local_part@$domain"
1300 domains = rt.debian.org
1301 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1302 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1303 local_part_suffix = +*
1304 local_part_suffix_optional
1305 pipe_transport = rt_pipe
1306 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}}"
1307 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1314 debug_print = "R: virt_aliases for $local_part@$domain"
1316 data = ${if exists{\
1317 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1318 {${lookup{$local_part}lsearch*{\
1319 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1321 directory_transport = address_directory
1322 cannot_route_message = Unknown user
1323 domains = +virtual_domains
1324 file_transport = address_file
1325 pipe_transport = address_pipe
1326 qualify_preserve_domain
1327 retry_use_local_part
1328 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1329 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1333 debug_print = "R: virt_direct for $local_part@$domain"
1339 directory_transport = address_directory
1340 domains = +virtual_domains
1341 file = $home/.forward-\
1342 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1344 file_transport = address_file
1345 pipe_transport = address_pipe
1346 reply_transport = address_reply
1347 retry_use_local_part
1348 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1349 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1352 # This is a senmailesque alias file lookup
1354 debug_print = "R: virt_aliases for $local_part@$domain"
1358 data = ${if exists{\
1359 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1360 {${lookup{$local_part}lsearch*{\
1361 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1363 directory_transport = address_directory
1364 domains = +virtual_domains
1365 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1366 cannot_route_message = Unknown user
1367 group = ${extract{group}{VDOMAINDATA}}
1368 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1369 pipe_transport = address_pipe
1370 qualify_preserve_domain
1371 retry_use_local_part
1372 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1373 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1375 user = ${extract{user}{VDOMAINDATA}}
1377 # This is a qmailesque deliver into a directory of .forward files
1379 debug_print = "R: virt_direct for $local_part@$domain"
1385 directory_transport = address_directory
1386 domains = +virtual_domains
1387 file = $home/.forward-\
1388 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1390 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1391 group = ${extract{group}{VDOMAINDATA}}
1392 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1394 pipe_transport = address_pipe
1395 reply_transport = address_reply
1396 retry_use_local_part
1397 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1398 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1400 user = ${extract{user}{VDOMAINDATA}}
1401 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1403 ######################################################################
1404 # TRANSPORTS CONFIGURATION #
1405 ######################################################################
1406 # ORDER DOES NOT MATTER #
1407 # Only one appropriate transport is called for each delivery. #
1408 ######################################################################
1413 # This transport is used for local delivery to user mailboxes. On debian
1414 # systems group mail is used so we can write to the /var/mail
1415 # directory. (The alternative, which most other unixes use, is to deliver
1416 # as the user's own group, into a sticky-bitted directory)
1419 file = /var/mail/${local_part}
1422 no_mode_fail_narrower
1425 # This transport is used for handling pipe addresses generated by alias
1426 # or .forward files. It has a conventional name, since it is not actually
1427 # mentioned elsewhere in this configuration file. (A different name *can*
1428 # be specified via the "address_pipe_transport" option if you really want
1429 # to.) If the pipe generates any standard output, it is returned to the sender
1430 # of the message as a delivery error. Set return_fail_output instead if you
1431 # want this to happen only when the pipe fails to complete normally.
1435 current_directory = ${home}
1436 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1437 EXT=${substr_1:${local_part_suffix}}:\
1438 LOCAL=${local_part}${local_part_suffix}:\
1439 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1443 # This transport is used for handling file addresses generated by alias
1444 # or .forward files. It has a conventional name, since it is not actually
1445 # mentioned elsewhere in this configuration file.
1455 directory_mode = 0770
1456 mode_fail_narrower = false
1458 # This transport is used for handling file addresses generated by alias
1459 # or .forward files if the path ends in "/", which causes it to be treated
1460 # as a directory name rather than a file name. Each message is then delivered
1461 # to a unique file in the directory. If instead you want all such deliveries to
1462 # be in the "maildir" format that is used by some other mail software,
1463 # uncomment the final option below. If this is done, the directory specified
1464 # in the .forward or alias file is the base maildir directory.
1466 # Should you want to be able to specify either maildir or non-maildir
1467 # directory-style deliveries, then you must set up yet another transport,
1468 # called address_directory2. This is used if the path ends in "//" so should
1469 # be the one used for maildir, as the double slash suggests another level
1470 # of directory. In the absence of address_directory2, paths ending in //
1471 # are passed to address_directory.
1481 # This transport is used for handling autoreplies generated by the filtering
1482 # option of the forwardfile director. It has a conventional name, since it
1483 # is not actually mentioned elsewhere in this configuration file.
1487 # This transport is used for delivering messages over SMTP connections.
1491 connect_timeout = 1m
1492 delay_after_cutoff = false
1495 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1496 out = " tls_certificate = /etc/exim4/ssl/thishost.crt
1497 tls_privatekey = /etc/exim4/ssl/thishost.key"
1504 if not nodeinfo['smarthost'].empty?
1506 remote_smtp_smarthost:
1507 debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
1509 delay_after_cutoff = false
1511 out += nodeinfo['smarthost_port'].to_s + "\n"
1512 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1513 out += ' tls_tempfail_tryclear = false
1514 hosts_require_tls = ' + nodeinfo['smarthost'] + '
1515 tls_certificate = /etc/exim4/ssl/thishost.crt
1516 tls_privatekey = /etc/exim4/ssl/thishost.key
1523 # Send the message to procmail
1526 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1528 user = ${local_part}
1537 user = ${extract{user}{\
1538 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1544 if nodeinfo['bugsmaster']
1548 command = /org/bugs.debian.org/mail/run-procmail
1549 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1550 EXT=${substr_1:${local_part_suffix}}:\
1551 LOCAL=${local_part}${local_part_suffix}:\
1552 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1563 if nodeinfo['rtmaster']
1566 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1569 environment = EXTENSION=${substr_1:${local_part_suffix}}
1570 allow_commands = /usr/bin/rt-mailgate
1576 ######################################################################
1577 # RETRY CONFIGURATION #
1578 ######################################################################
1580 # This single retry rule applies to all domains and all errors. It specifies
1581 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1582 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1583 # hours, then retries every 8 hours until 4 days have passed since the first
1586 # Domain Error Retries
1587 # ------ ----- -------
1592 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1593 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1594 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1596 # End of Exim 4 configuration