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 = 300
197 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
198 smtp_accept_queue = 200
199 smtp_accept_queue_per_connection = 50
200 smtp_accept_reserve = 25
201 smtp_reserve_hosts = +debianhosts
203 split_spool_directory = true
204 check_spool_inodes = 200
205 check_spool_space = 20M
210 deliver_queue_load_max = 50
212 queue_list_requires_admin = false
215 if has_variable?("clamd") && clamd == "true"
216 out = "av_scanner = clamd:/var/run/clamav/clamd.ctl"
223 out = "daemon_smtp_ports = "
226 if nodeinfo['bugsmaster']
230 if not nodeinfo['mail_port'].to_s.empty?
231 ports << nodeinfo['mail_port']
234 if nodeinfo['mailrelay']
235 ports << nodeinfo['smarthost_port']
238 out += ports.uniq.sort.join(" : ")
243 remote_sort_domains = *.debian.org:*.debian.net
245 pipelining_advertise_hosts = !*
247 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
248 out = 'tls_advertise_hosts = *'
252 smtp_enforce_sync = true
254 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
256 received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
257 {${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
258 ${if and {{eq {$tls_certificate_verified}{1}}{def:tls_peerdn}}{from $tls_peerdn (verified)\n\t}}\
259 by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}\
260 (Exim $version_number)\n\t\
261 ${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
262 id $message_exim_id${if def:received_for {\n\tfor $received_for}}
266 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
267 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
268 ${if exists {/srv/$domain/mail/whitelist}{\
269 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
271 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
272 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
273 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
274 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
275 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
276 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
277 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
279 ######################################################################
280 # ACL CONFIGURATION #
281 ######################################################################
285 # This is a bad hack to reset the variable, by defining it be something
288 warn set acl_m_rprf = $acl_m_undefined
290 warn recipients = survey@popcon.debian.org
291 set acl_m_rprf = PopconMail
293 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
295 warn local_parts = +local_only_users
296 domains = +local_domains
297 hosts = !+debianhosts
298 set acl_m_rprf = localonly
300 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
304 if nodeinfo['rtmaster']
306 warn domains = rt.debian.org
307 set acl_m_rprf = RTMail
309 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
316 if nodeinfo['packagesmaster']
318 warn domains = packages.debian.org
319 set acl_m_rprf = PackagesMail
321 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
327 if nodeinfo['packagesqamaster']
329 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
330 set acl_m_rprf = PTSOwner
332 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
335 domains = packages.qa.debian.org
336 condition = ${if match{$local_part}{\N^bounces+\N}}
337 set acl_m_rprf = PTSListBounce
339 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
341 warn domains = packages.qa.debian.org
342 set acl_m_rprf = PTSMail
344 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
349 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
350 set acl_m_rprf = DBSignedMail
352 accept condition = ${if eq {$acl_m_rprf}{}{no}{yes}}
354 warn set acl_m_rprf = normal
360 warn set acl_c_scr = 0
364 if nodeinfo['mailrelay']
365 out = " accept verify = certificate"
370 # These are in HELO acl so that they are only run once. They increment a counter,
371 # so we don't want it to increment per rcpt to.
373 warn dnslists = list.dnswl.org&0.0.0.3
374 log_message = Hit on list.dnswl.org for $sender_host_address
375 set acl_c_scr = ${eval:$acl_c_scr-30}
377 warn dnslists = list.dnswl.org&0.0.0.2
378 log_message = Hit on list.dnswl.org for $sender_host_address
379 set acl_c_scr = ${eval:$acl_c_scr-20}
381 warn dnslists = list.dnswl.org
382 log_message = Hit on list.dnswl.org for $sender_host_address
383 set acl_c_scr = ${eval:$acl_c_scr-10}
385 warn condition = ${if isip {$sender_helo_name}{true}{false}}
386 log_message = remote host used IP address in HELO/EHLO greeting
387 set acl_c_scr = ${eval:$acl_c_scr+20}
389 warn !hosts = +debianhosts
390 condition = ${if eq{$host_lookup_failed}{1}}
391 set acl_c_scr = ${eval:$acl_c_scr+20}
393 warn !hosts = +debianhosts
394 condition = ${if eq{$host_lookup_failed}{0}}
395 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}}
396 set acl_c_scr = ${eval:$acl_c_scr+20}
398 warn !hosts = +debianhosts
399 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}}
400 set acl_c_scr = ${eval:$acl_c_scr+20}
402 warn !hosts = +debianhosts
403 dnslists = dul.dnsbl.sorbs.net
404 set acl_c_scr = ${eval:$acl_c_scr+15}
406 # If the sender's helo name is empty, the message will be rejected later
407 # because the helo is empty. If the rDNS lookup failed, we are already
408 # going to greylist them, so no sense worrying about it here. Finally,
409 # if rDNS does not match helo name (both lower cased first), greylist.
411 warn !hosts = +debianhosts
412 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
413 condition = ${if def:sender_helo_name {yes}{no}}
414 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
415 log_message = HELO doesn't match rDNS
416 set acl_c_scr = ${eval:$acl_c_scr+8}
419 # matches 098325879 - looks fishy
421 warn condition = ${if and { \
422 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
423 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
426 log_message = non-FQDN HELO
427 set acl_c_scr = ${eval:$acl_c_scr+12}
429 # Matches DOMAIN99.com - looks bad
431 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
432 log_message = SHOUTING HELO
433 set acl_c_scr = ${eval:$acl_c_scr+7}
435 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
436 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
437 # naive test, so it's not worth much
439 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
440 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
441 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
442 log_message = random HELO
443 set acl_c_scr = ${eval:$acl_c_scr+5}
445 # Implicit, but simpler to just say it
448 #!!# ACL that is used after the RCPT command on the submission port
451 # Accept if the source is local SMTP (i.e. not over TCP/IP).
452 # We do this by testing for an empty sending host field.
453 accept hosts = : 127.0.0.1
457 if nodeinfo['mailrelay']
458 out = " accept verify = certificate"
463 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
464 # This is a rough pass at preventing addres harvesting or other mail blasts.
466 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
467 message = Too many bad recipients, try again later
468 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
471 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
472 !hosts = +debianhosts
473 message = sorry, only 5 reports per hour for submission
475 accept domains = +local_domains
478 message = unknown user
483 if nodeinfo['mailrelay']
485 accept domains = +mailhubdomains
487 message = unknown user
488 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
494 accept domains = +submission_domains
496 message = unknown user
499 deny message = relay not permitted
501 #!!# ACL that is used after the RCPT command
506 if nodeinfo['mailrelay']
507 out = " accept verify = certificate"
512 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
513 # This is a rough pass at preventing addres harvesting or other mail blasts.
515 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
516 message = Too many bad recipients, try again later
517 !hosts = +debianhosts
518 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
520 # Dump spambots that are so stupid they say helo as our IP address
522 drop !hosts = +debianhosts
523 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
524 message = HELO mismatch Forged HELO for ($sender_helo_name)
526 # Also for spambots that say helo as us or one of our domains
528 drop !hosts = +debianhosts
529 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
530 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
531 message = HELO mismatch Forged HELO for ($sender_helo_name)
533 # This logic gives you a list of commonly forged domains in helo to reject against
535 warn set acl_m_frg = ${lookup{$sender_helo_name} \
536 nwildlsearch{/etc/exim4/helo-check} \
537 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
539 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
540 # say helo as a name in the list but we can't look them up
542 defer !hosts = +debianhosts
543 condition = ${if eq{$acl_m_frg}{}{no}{yes}}
544 condition = ${if eq{$sender_host_name}{}{yes}{no}}
545 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
546 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
548 # If DNS works, go ahead and reject them
550 drop !hosts = +debianhosts
551 condition = ${if and { {!eq{$acl_m_frg}{}}{!match{$sender_host_name}{${rxquote:$acl_m_frg}\N$\N}}}{yes}{no}}
552 message = HELO mismatch Forged HELO for ($sender_helo_name)
554 # disabled accounts don't even get local mail.
555 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
556 domains = +local_domains
557 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
559 deny domains = +virtual_domains
560 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
561 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
563 hosts = !+debianhosts
564 message = mail for <$local_part@$domain> only accepted from debian.org machines
565 # Accept if the source is local SMTP (i.e. not over TCP/IP).
566 # We do this by testing for an empty sending host field.
569 deny domains = +handled_domains
570 local_parts = ^[.] : ^.*[@%!/|]
572 deny domains = !+handled_domains
573 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
575 # forwards mail to @d.o address, even if it's a bounce from master, no reply
576 # from source address; rejecting all mail now.
577 deny recipients = mendoza@debian.org
578 hosts = 65.110.39.147 : 64.39.31.15
579 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
581 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
582 sender_domains= +local_domains : debian.org : debian.net : debian.com
583 hosts = !+debianhosts
584 message = mail from <$sender_address> not allowed externally
586 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
587 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
588 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
589 message = no mail should ever come from <$sender_address>
591 warn acl = acl_getprofile
592 condition = ${if eq{$acl_m_prf}{}}
593 set acl_m_prf = $acl_m_rprf
595 defer condition = ${if eq{$acl_m_prf}{$acl_m_rprf}{no}{yes}}
596 log_message = Only one profile at a time, please
598 warn condition = ${if eq{$acl_m_prf}{localonly}}
599 set acl_m_lrc = ${if eq{$acl_m_lrc}{}{$local_part@$domain}{$acl_m_lrc, $local_part@$domain}}
605 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
606 hosts = !+debianhosts
607 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
613 deny condition = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
616 defer !hosts = +debianhosts
617 condition = ${if >{${eval:$acl_c_scr}}{0}}
618 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
619 message = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
622 if has_variable?("policydweight") && policydweight == "true"
624 # Check with policyd-weight - this only works with a version after etch\'s,
625 # sadly. etch\'s version attempts to hold the socket open, since that\'s what
626 # postfix expects. Exim, on the other hand, expects the remote side to close
627 # the socket when it\'s finished sending data, so it see each transaction as
628 # an incomplete read. I\'m sure there\'s a way we could force exim to do
629 # something sick and clever to force either the interpretation or the socket
630 # closure, but I\'m fairly sure it\'s now worth it, since the backport of
631 # policyd-weight is trivial.
632 warn !hosts = +debianhosts
633 set acl_m_pw = ${readsocket{inet:127.0.0.1:12525}\
634 {request=smtpd_access_policy\n\
635 protocol_state=RCPT\n\
636 protocol_name=${uc:$received_protocol}\n\
637 helo_name=$sender_helo_name\n\
638 queue_id=$message_exim_id\n\
639 sender=$sender_address\n\
640 recipient=$local_part@$domain\n\
641 recipient_count=$rcpt_count\n\
642 client_address=$sender_host_address\n\
643 client_name=$sender_host_name\n\
644 reverse_client_name=$sender_host_name\n\
645 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
646 {20s}{\n}{socket failure}}
648 # Defer on socket error
649 defer !hosts = +debianhosts
650 condition = ${if eq{$acl_m_pw}{socket failure}{yes}{no}}
651 message = Cannot connect to policyd-weight. Please try again later.
653 # Set proposed action to $acl_m_act and message to $acl_m_mes
654 warn !hosts = +debianhosts
655 set acl_m_mes = ${extract{action}{$acl_m_pw}}
656 set acl_m_act = ${sg{$acl_m_pw}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
658 # Add X-policyd-weight header line to message
659 warn !hosts = +debianhosts
661 condition = ${if eq{$acl_m_act}{PREPEND}{yes}{no}}
663 # Write log message, if policyd-weight can\'t run checks
664 warn !hosts = +debianhosts
665 log_message = policyd-weight message: $acl_m_mes
666 condition = ${if eq{$acl_m_act}{DUNNO}{yes}{no}}
668 # Deny mails which policyd-weight thinks are spam
669 deny !hosts = +debianhosts
670 message = policyd-weight said: $acl_m_mes
671 condition = ${if eq{$acl_m_act}{550}{yes}{no}}
673 # Defer messages when policyd-weight suggests so.
674 defer !hosts = +debianhosts
675 message = policyd-weight said: $acl_m_mes
676 condition = ${if eq{$acl_m_act}{450}{yes}{no}}
683 if nodeinfo['rtmaster']
685 warn condition = ${if eq{$acl_m_prf}{RTMail}}
686 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if or{{match{$local_part}{\N[^+]+\+\d+\N}}{match{$local_part}{\N[^+]+\+new\N}}} {RTMailRecipientHasSubaddress}}}}
693 if has_variable?("greylistd") && greylistd == "true"
696 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
697 log_message = greylisted.
698 local_parts = ${if match_domain{$domain}{+virtual_domains}\
699 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
700 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
701 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
702 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
704 !hosts = : +debianhosts : WHITELIST : \
705 ${if exists {/etc/greylistd/whitelist-hosts}\
706 {/etc/greylistd/whitelist-hosts}{}} : \
707 ${if exists {/var/lib/greylistd/whitelist-hosts}\
708 {/var/lib/greylistd/whitelist-hosts}{}}
710 domains = +handled_domains : +rcpthosts
711 condition = ${readsocket{/var/run/greylistd/socket}\
713 $sender_host_address \
715 $local_part@$domain}\
718 elsif has_variable?("postgrey") && postgrey == "true"
720 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
721 # this adds acl_m_grey if there isn\'t one (so unique per message)
724 !hosts = : +debianhosts : WHITELIST
725 condition = ${if def:acl_m_grey {no}{yes}}
726 set acl_m_grey = $pid.$tod_epoch.$sender_host_port
728 # and defers the message if postgrey thinks it should be defered ...
731 !hosts = : +debianhosts : WHITELIST
733 domains = +handled_domains : +rcpthosts
734 local_parts = GREYLIST_LOCAL_PARTS
735 set acl_m_pgr = request=smtpd_access_policy\n\
736 protocol_state=RCPT\n\
737 protocol_name=${uc:$received_protocol}\n\
738 instance=${acl_m_grey}\n\
739 helo_name=${sender_helo_name}\n\
740 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
741 client_name=${sender_host_name}\n\
742 sender=${sender_address}\n\
743 recipient=$local_part@$domain\n\n
744 set acl_m_pgr = ${sg{\
745 ${readsocket{/var/run/postgrey/socket}{$acl_m_pgr}\
746 {5s}{}{action=DUNNO}}\
748 message = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
749 log_message = greylisted.
750 condition = ${if eq{${uc:${substr{0}{5}{$acl_m_pgr}}}}{DEFER}}
752 # ... or adds a header with information about how long the delay was
755 !hosts = : +debianhosts : WHITELIST
757 domains = +handled_domains : +rcpthosts
758 local_parts = GREYLIST_LOCAL_PARTS
759 condition = ${if eq{${uc:${substr_0_7:$acl_m_pgr}}}{PREPEND}}
760 message = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
766 accept local_parts = postmaster
767 domains = +handled_domains : +rcpthosts
769 deny log_message = <$sender_address> is blacklisted
770 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
771 message = We have blacklisted <$sender_address>. Please stop mailing us
773 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
774 dnslists = ${if match_domain{$domain}{+virtual_domains}\
775 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
776 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
777 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
778 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
779 domains = +handled_domains : +rcpthosts
780 !hosts = +debianhosts : WHITELIST
782 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
783 dnslists = ${if match_domain{$domain}{+virtual_domains}\
784 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
785 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
786 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
787 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
788 domains = +handled_domains : +rcpthosts
789 !hosts = +debianhosts : WHITELIST
791 deny domains = +handled_domains : +rcpthosts
792 local_parts = ${if match_domain{$domain}{+virtual_domains}\
793 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
794 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
795 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
796 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
797 !hosts = +debianhosts : WHITELIST
798 !verify = sender/callout
802 if nodeinfo['mailrelay']
804 accept domains = +mailhubdomains
806 message = unknown user
807 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
812 accept domains = +handled_domains
814 message = unknown user
815 verify = recipient/defer_ok
817 accept domains = +rcpthosts
819 message = unrouteable address
822 accept hosts = +debianhosts
824 accept authenticated = *
826 deny message = relay not permitted
830 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
834 deny condition = ${if <{$message_size}{256000}}
835 set acl_m_srb = ${perl{surblspamcheck}}
836 condition = ${if eq{$acl_m_srb}{false}{no}{yes}}
837 log_message = $acl_m_srb
847 deny condition = ${if eq{$acl_m_lcl}{localonly}}
848 message = mail for $acl_m_lrc is only accepted internally
853 #!!# ACL that is used after the DATA command
855 require verify = header_syntax
856 message = Invalid syntax in the header
860 if nodeinfo['rtmaster']
862 deny condition = ${if eq {$acl_m_prf}{RTMail}}
863 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
864 {!match {${lc:$rh_Subject:]}} {\N\[rt.debian.org \N}} \
865 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
866 message = messages to the Request Tracker system require a subject tag or a subaddress
873 if nodeinfo['packagesqamaster']
875 deny !hosts = +debianhosts : 217.196.43.134
876 condition = ${if eq {$acl_m_prf}{PTSMail}}
877 condition = ${if def:h_X-PTS-Approved:{false}{true}}
878 message = messages to the PTS require an X-PTS-Approved header
883 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
884 message = Blackisted URI found in body
886 deny condition = ${if eq {$acl_m_prf}{DBSignedMail}}
887 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
888 {!match {$message_body}{PGP SIGNED MESSAGE}} \
889 {!match {$message_body}{PGP SIGNATURE}} \
890 {!match {$header_content-type:}{multipart/signed}} \
891 {!match {$header_content-type:}{pgp}} \
894 message = Mail to this address needs to be PGP-signed
896 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
897 # postfix's strict_7bit_headers option, but only checks a few common problem
898 # headers, as there doesn't appear to be an easy way to check them all.
900 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
901 {match {$rh_To:}{[\200-\377]}}\
902 {match {$rh_From:}{[\200-\377]}}\
903 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
904 message = improper use of 8-bit data in message header: message rejected
907 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
908 message = Your mailer is not RFC 2047 compliant: message rejected
912 if has_variable?("clamd") && clamd == "true"
917 message = malware detected: $malware_name: message rejected
924 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
926 deny condition = ${if <{$message_size}{256000}}
927 set acl_m_srb = ${perl{surblspamcheck}}
928 condition = ${if eq{$acl_m_srb}{false}{no}{yes}}
929 log_message = $acl_m_srb
935 # Check header_sender except for survey@popcon.d.o
936 deny condition = ${if eq{$acl_m_prf}{PopconMail}{false}{true}}
937 !verify = header_sender
938 message = No valid sender found in the From:, Sender: and Reply-to: headers
942 if nodeinfo['packagesmaster']
944 deny message = Congratulations, you scored $spam_score points.
945 log_message = spam: $spam_score points.
946 condition = ${if eq {$acl_m_prf}{PackagesMail}}
948 !verify = certificate
949 !hosts = +debianhosts
950 condition = ${if <{$message_size}{256000}}
951 condition = ${if >{$spam_score_int}{65}}
952 spam = pkg_user : true
961 ######################################################################
962 # REWRITE CONFIGURATION #
963 ######################################################################
969 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
970 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
971 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
972 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
973 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
974 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
977 #!!#######################################################!!#
978 #!!# Here follow routers created from the old routers, #!!#
979 #!!# for handling non-local domains. #!!#
980 #!!#######################################################!!#
986 ######################################################################
987 # ROUTERS CONFIGURATION #
988 # Specifies how addresses are handled #
989 ######################################################################
990 # ORDER DOES MATTER #
991 # An address is passed to each in turn until it is accepted. #
992 ######################################################################
996 if nodeinfo['mailrelay']
1000 domains = +mailhubdomains
1001 transport = remote_smtp
1002 route_data = ${lookup{$domain}lsearch{/etc/exim4/manualroute}}
1003 require_files = /etc/exim4/manualroute
1010 debug_print = "R: bsmtp for $local_part@$domain"
1011 driver = manualroute
1012 domains = !+local_domains
1013 require_files = /etc/exim4/bsmtp
1014 route_list = * ${extract{file}{\
1015 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1019 # This router routes to remote hosts over SMTP by explicit IP address,
1020 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
1021 # require this facility, which is why it is enabled by default in Exim.
1023 debug_print = "R: ipliteral for $local_part@$domain"
1025 domains = !+handled_domains
1026 transport = remote_smtp
1027 ignore_target_hosts = +reservedaddrs
1031 if not nodeinfo['smarthost'].empty?
1034 debug_print = "R: smarthost for $local_part@$domain"
1035 driver = manualroute
1036 domains = !+handled_domains
1037 transport = remote_smtp_smarthost
1038 route_list = * ' + nodeinfo['smarthost'] + '
1039 host_find_failed = defer
1040 same_domain_copy_routing = yes
1047 # This router routes to remote hosts over SMTP using a DNS lookup.
1048 # Ignore reserved network responses, including localhost.
1050 debug_print = "R: dnslookup for $local_part@$domain"
1052 domains = !+handled_domains
1053 transport = remote_smtp
1054 ignore_target_hosts = +reservedaddrs
1057 # This router handles aliasing using a traditional /etc/aliases file.
1058 # If any of your aliases expand to pipes or files, you will need to set
1059 # up a user and a group for these deliveries to run under. You can do
1060 # this by uncommenting the "user" option below (changing the user name
1061 # as appropriate) and adding a "group" option if necessary.
1064 debug_print = "R: system_aliases for $local_part@$domain"
1068 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
1069 domains = +local_domains
1070 file_transport = address_file
1071 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1072 pipe_transport = address_pipe
1073 retry_use_local_part
1075 # This router handles forwarding using traditional .forward files.
1076 # It also allows mail filtering when a forward file starts with the
1077 # string "# Exim filter": to disable filtering, uncomment the "filter"
1078 # option. The check_ancestor option means that if the forward file
1079 # generates an address that is an ancestor of the current one, the
1080 # current one gets passed on instead. This covers the case where A is
1081 # aliased to B and B has a .forward file pointing to A.
1083 # For standard debian setup of one group per user, it is acceptable---normal
1084 # even---for .forward to be group writable. If you have everyone in one
1085 # group, you should comment out the "modemask" line. Without it, the exim
1086 # default of 022 will apply, which is probably what you want.
1089 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1094 directory_transport = address_directory
1095 domains = +local_domains
1096 # filter - I have disabled filtering to force users to use .forward-foo files
1097 # or procmail. This will make it easier to move mailers in the future
1099 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1100 # also checks if the .forward-bar exists, if not then it uses
1101 # .forward-default instead.
1102 file = $home/.forward\
1103 ${if eq{}{$local_part_suffix}{}{\
1104 ${if exists {${home}/.forward${local_part_suffix}} \
1105 {${local_part_suffix}}{-default}}\
1108 file_transport = address_file
1109 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1110 local_part_suffix = -*
1111 local_part_suffix_optional
1113 pipe_transport = address_pipe
1114 reply_transport = address_reply
1115 require_files = $home
1116 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
1120 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1124 directory_transport = address_directory
1125 domains = +local_domains
1126 # filter - I have disabled filtering to force users to use .forward-foo files
1127 # or procmail. This will make it easier to move mailers in the future
1129 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1130 # also checks if the .forward-bar exists, if not then it uses
1131 # .forward-default instead.
1132 file = $home/.forward\
1133 ${if eq{}{$local_part_suffix}{}{\
1134 ${if exists {${home}/.forward${local_part_suffix}} \
1135 {${local_part_suffix}}{-default}}\
1138 file_transport = address_file
1139 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1140 local_part_suffix = -*
1141 local_part_suffix_optional
1143 pipe_transport = address_pipe
1144 reply_transport = address_reply
1145 require_files = $home
1148 # This delivers to procmail
1150 debug_print = "R: procmail for $local_part@$domain"
1153 domains = +local_domains
1154 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1157 require_files = $local_part:$home/.procmailrc
1158 transport = procmail_pipe
1159 transport_current_directory = $home
1161 # This driver delivers to the LDAP generated alias file.
1163 debug_print = "R: ldap_aliases for $local_part@$domain"
1167 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
1168 {${lookup{$local_part}cdb\
1169 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
1170 domains = +local_domains
1171 file_transport = address_file
1172 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1173 pipe_transport = address_pipe
1174 retry_use_local_part
1176 # This director matches local user mailboxes.
1178 debug_print = "R: localuser for $local_part@$domain"
1181 domains = +local_domains
1182 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1183 # Disable if the user has never logged in
1184 require_files = $home
1185 transport = local_delivery
1188 # Now we begin the Virtual Domain configuration
1189 # Everything before here should apply only to the local domains with a
1192 # exim4 fails the router if it can't change to the user/group for delivery
1193 # during verification. So we have to seperate the cases of verifying
1194 # the virts, and delivering to them. blah.
1197 if nodeinfo['packagesmaster']
1199 # This router delivers for packages.d.o
1201 debug_print = "R: packages for $local_part@$domain"
1203 file_transport = address_file
1204 pipe_transport = address_pipe
1205 domains = packages.debian.org
1206 require_files = /org/packages.debian.org/conf/maintainer
1207 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
1208 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1209 transport_home_directory = /org/packages.debian.org/mail
1210 transport_current_directory = /org/packages.debian.org/mail
1212 retry_use_local_part
1221 if nodeinfo['bugsmaster']
1223 # This router delivers for bugs.d.o
1225 debug_print = "R: bugs for $local_part@$domain"
1227 transport = bugs_pipe
1228 domains = bugs.debian.org
1229 cannot_route_message = Unknown or archived bug
1230 require_files = /org/bugs.debian.org/mail/run-procmail
1232 local_parts = ${if match\
1234 {\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}\
1235 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
1236 {$local_part}fail}}fail}
1244 if nodeinfo['rtmaster']
1246 # This router delivers for rt.d.o
1247 rt_force_new_verbose:
1248 debug_print = "R: rt for $local_part+new@$domain"
1250 domains = rt.debian.org
1251 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1252 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1253 local_part_suffix = +new
1254 pipe_transport = rt_pipe
1255 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}}"
1256 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1258 # FIXME: figure out how to generalize this approach so that all of the following would work
1259 # - rt+NNNN@rt.debian.org : attach correspondence to ticket (verbose)
1260 # - rt+NNNN-quiesce@rt.debian.org : attach correspondence to ticket (quiesce)
1261 # - rt+NNNN-<action>@rt.debian.org : attach correspondence to ticket (some action)
1262 # requires modification to custom condition in \'scrips\'
1263 rt_force_new_quiesce:
1264 debug_print = "R: rt for $local_part+new-quiesce@$domain"
1266 domains = rt.debian.org
1267 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1268 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1269 local_part_suffix = +new-quiesce
1270 pipe_transport = rt_pipe
1271 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}}"
1272 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}\nX-RT-Mode: quiesce"
1275 debug_print = "R: rt for $local_part@$domain"
1277 domains = rt.debian.org
1278 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1279 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1280 local_part_suffix = +*
1281 local_part_suffix_optional
1282 pipe_transport = rt_pipe
1283 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}}"
1284 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1291 debug_print = "R: virt_aliases for $local_part@$domain"
1293 data = ${if exists{\
1294 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1295 {${lookup{$local_part}lsearch*{\
1296 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1298 directory_transport = address_directory
1299 cannot_route_message = Unknown user
1300 domains = +virtual_domains
1301 file_transport = address_file
1302 pipe_transport = address_pipe
1303 qualify_preserve_domain
1304 retry_use_local_part
1305 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1306 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1310 debug_print = "R: virt_direct for $local_part@$domain"
1316 directory_transport = address_directory
1317 domains = +virtual_domains
1318 file = $home/.forward-\
1319 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1321 file_transport = address_file
1322 pipe_transport = address_pipe
1323 reply_transport = address_reply
1324 retry_use_local_part
1325 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1326 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1329 # This is a senmailesque alias file lookup
1331 debug_print = "R: virt_aliases for $local_part@$domain"
1335 data = ${if exists{\
1336 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1337 {${lookup{$local_part}lsearch*{\
1338 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1340 directory_transport = address_directory
1341 domains = +virtual_domains
1342 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1343 cannot_route_message = Unknown user
1344 group = ${extract{group}{VDOMAINDATA}}
1345 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1346 pipe_transport = address_pipe
1347 qualify_preserve_domain
1348 retry_use_local_part
1349 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1350 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1352 user = ${extract{user}{VDOMAINDATA}}
1354 # This is a qmailesque deliver into a directory of .forward files
1356 debug_print = "R: virt_direct for $local_part@$domain"
1362 directory_transport = address_directory
1363 domains = +virtual_domains
1364 file = $home/.forward-\
1365 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1367 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1368 group = ${extract{group}{VDOMAINDATA}}
1369 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1371 pipe_transport = address_pipe
1372 reply_transport = address_reply
1373 retry_use_local_part
1374 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1375 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1377 user = ${extract{user}{VDOMAINDATA}}
1378 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1380 ######################################################################
1381 # TRANSPORTS CONFIGURATION #
1382 ######################################################################
1383 # ORDER DOES NOT MATTER #
1384 # Only one appropriate transport is called for each delivery. #
1385 ######################################################################
1390 # This transport is used for local delivery to user mailboxes. On debian
1391 # systems group mail is used so we can write to the /var/mail
1392 # directory. (The alternative, which most other unixes use, is to deliver
1393 # as the user's own group, into a sticky-bitted directory)
1396 file = /var/mail/${local_part}
1399 no_mode_fail_narrower
1402 # This transport is used for handling pipe addresses generated by alias
1403 # or .forward files. It has a conventional name, since it is not actually
1404 # mentioned elsewhere in this configuration file. (A different name *can*
1405 # be specified via the "address_pipe_transport" option if you really want
1406 # to.) If the pipe generates any standard output, it is returned to the sender
1407 # of the message as a delivery error. Set return_fail_output instead if you
1408 # want this to happen only when the pipe fails to complete normally.
1412 current_directory = ${home}
1413 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1414 EXT=${substr_1:${local_part_suffix}}:\
1415 LOCAL=${local_part}${local_part_suffix}:\
1416 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1420 # This transport is used for handling file addresses generated by alias
1421 # or .forward files. It has a conventional name, since it is not actually
1422 # mentioned elsewhere in this configuration file.
1432 directory_mode = 0770
1433 mode_fail_narrower = false
1435 # This transport is used for handling file addresses generated by alias
1436 # or .forward files if the path ends in "/", which causes it to be treated
1437 # as a directory name rather than a file name. Each message is then delivered
1438 # to a unique file in the directory. If instead you want all such deliveries to
1439 # be in the "maildir" format that is used by some other mail software,
1440 # uncomment the final option below. If this is done, the directory specified
1441 # in the .forward or alias file is the base maildir directory.
1443 # Should you want to be able to specify either maildir or non-maildir
1444 # directory-style deliveries, then you must set up yet another transport,
1445 # called address_directory2. This is used if the path ends in "//" so should
1446 # be the one used for maildir, as the double slash suggests another level
1447 # of directory. In the absence of address_directory2, paths ending in //
1448 # are passed to address_directory.
1458 # This transport is used for handling autoreplies generated by the filtering
1459 # option of the forwardfile director. It has a conventional name, since it
1460 # is not actually mentioned elsewhere in this configuration file.
1464 # This transport is used for delivering messages over SMTP connections.
1468 connect_timeout = 1m
1469 delay_after_cutoff = false
1472 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1473 out = " tls_certificate = /etc/exim4/ssl/thishost.crt
1474 tls_privatekey = /etc/exim4/ssl/thishost.key"
1481 if not nodeinfo['smarthost'].empty?
1483 remote_smtp_smarthost:
1484 debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
1486 delay_after_cutoff = false
1488 out += nodeinfo['smarthost_port'].to_s + "\n"
1489 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1490 out += ' tls_tempfail_tryclear = false
1491 hosts_require_tls = ' + nodeinfo['smarthost'] + '
1492 tls_certificate = /etc/exim4/ssl/thishost.crt
1493 tls_privatekey = /etc/exim4/ssl/thishost.key
1500 # Send the message to procmail
1503 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1505 user = ${local_part}
1514 user = ${extract{user}{\
1515 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1521 if nodeinfo['bugsmaster']
1525 command = /org/bugs.debian.org/mail/run-procmail
1526 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1527 EXT=${substr_1:${local_part_suffix}}:\
1528 LOCAL=${local_part}${local_part_suffix}:\
1529 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1540 if nodeinfo['rtmaster']
1543 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1546 environment = EXTENSION=${substr_1:${local_part_suffix}}
1547 allow_commands = /usr/bin/rt-mailgate
1553 ######################################################################
1554 # RETRY CONFIGURATION #
1555 ######################################################################
1557 # This single retry rule applies to all domains and all errors. It specifies
1558 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1559 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1560 # hours, then retries every 8 hours until 4 days have passed since the first
1563 # Domain Error Retries
1564 # ------ ----- -------
1569 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1570 * * senders=: F,2h,10m
1571 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1572 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1574 # End of Exim 4 configuration