2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
6 # This is the main exim4 configuration file based on the 28.08.05 version by
9 # The configuration file uses a set of rules to generate an
10 # acceptable mail environment for debian.org machines. It deviates
11 # considerably from what could be considered a standard exim configuration.
13 # This configuration file brings in the necessary information from
14 # other databases stored in /etc/exim/ and the files distributed by ud-ldap
16 # This file is independent of the local host, it should not be changed
17 # per machine. primary_hostname is used in all places that require per-host
20 # The configuration files in /etc/exim are as follows:
21 # locals - This is a list of domains that are considered local. A local
22 # domain is essential one that deliveries to /var/mail
23 # will be attempted. The users available for local delivery
24 # comes from /etc/passwd and /etc/aliases. Wildcards are not
26 # virtualdomains - This is a list of all virtual domains. A virtual domain
27 # is much like a local domain, execpt that the delivery location
28 # and allowed set of users is controlled by a virtual domain
29 # alias file and not /etc/passwd. Wildcards are permitted
30 # rcpthosts - recipient hosts or relay domains. This is a list of
31 # all hosts that we mail exchange for. All domains that list
32 # this host in their MX records should be listed here. Wildcards
34 # relayhosts - Hostnames that can send any arbitarily addressed mail to
35 # us. This is primarily only usefull for emergancy 'queue
36 # flushing' operations, but should be populated with a list
37 # of trusted machines. Wildcards are not permitted
40 if nodeinfo['mailrelay']
42 # mailhubdomains - Domains for which we are the MX, but the mail is relayed
43 # elsewhere. This is designed for use with small volume or
44 # restricted machines that need to use a smarthost for mail
45 # traffic. We will relay for them based on ssl cert validation
46 # but we need to teach exim how to route the mail to them. This is
52 # Exim's wildcard mechanism is a bit odd in that to say "any address in
53 # debian.org including debian.org" you must use two patterns,
56 # Also you can only place a * before a . and as the first char in a string.
57 # Wildcards always match last so they may be used as a catchall.
59 # Further details can be found in each of the files.
61 # Usefull exim commands:
62 # exim4 -qf - Try sending all messages right now, including frozen ones
63 # exim4 -bt foo@blah - Write what exim would do if it saw the address
64 # Great for testing virtual domains and forward files
66 # Special Features for users:
67 # .forward-foo - is understood as an extension address for bar-foo@cow.com
68 # .forward-default - is understood to be a catch all for bar-*@cow.com
69 # .procmailrc - with no .forward file invokes procmail for delivery
72 # For virtual domains the first lookup is done against a linear text
73 # database called 'aliases', then .forward files are consulted. Exim
74 # filtering is available for these .forward files only. .forward-default
75 # is the universal catch all for everything not handled.
77 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
78 # will trigger things like rcpt to rate limiting or possibly a reject if
79 # enough hits are triggered.
81 # value is stored in acl_c1
83 ######################################################################
84 # MAIN CONFIGURATION SETTINGS #
85 ######################################################################
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"
112 # accept domain literal syntax in e-mail addresses. To actually make use of
113 # this a router is also required
114 allow_domain_literals = true
116 # This setting defines a named domain list called
117 # local_domains. It will be referenced
118 # later on by the syntax "+local_domains".
119 # Other domain and host lists may follow.
120 # @ is the local FQDN, @[] matches the IP adress of any local interface.
122 .include_if_exists /etc/exim4/local-settings.conf
124 domainlist local_domains = @ : \
127 ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
129 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
131 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
133 domainlist handled_domains = +local_domains : +virtual_domains
135 localpartlist local_only_users = lsearch;/etc/exim4/localusers
137 # Domains we relay for; that is domains that aren't considered local but we
138 # accept mail for them.
139 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
140 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
143 if nodeinfo['mailrelay']
145 domainlist mailhubdomains = lsearch;/etc/exim4/manualroute
151 hostlist reservedaddrs = <%= nodeinfo['reservedaddrs'] %>
154 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
155 out = "tls_certificate = /etc/exim4/ssl/thishost.crt
156 tls_privatekey = /etc/exim4/ssl/thishost.key
157 tls_try_verify_hosts = *
158 tls_verify_certificates = /etc/exim4/ssl/ca.crt
159 tls_crl = /etc/exim4/ssl/ca.crl"
164 # The setting below causes Exim to do a reverse DNS lookup on all incoming
165 # IP calls, in order to get the true host name. If you feel this is too
166 # expensive, you can specify the networks for which a lookup is done, or
167 # remove the setting entirely.
169 dns_ipv4_lookup = !localhost
171 # If this option is set, then any process that is running as one of the
172 # listed users may pass a message to Exim and specify the sender's
173 # address using the "-f" command line option, without Exim's adding a
176 untrusted_set_sender = *
178 # Some operating systems use the "gecos" field in the system password file
179 # to hold other information in addition to users' real names. Exim looks up
180 # this field when it is creating "sender" and "from" headers. If these options
181 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
182 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
185 gecos_pattern = ^([^,:]*)
188 # This tells exim to immediately discard error messages (ie double bounces).
189 ignore_bounce_errors_after = 0s
191 timeout_frozen_after=14d
193 message_size_limit = 100M
195 smtp_accept_max = 300
196 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
197 smtp_accept_queue = 200
198 smtp_accept_queue_per_connection = 50
199 smtp_accept_reserve = 25
200 smtp_reserve_hosts = +debianhosts
202 split_spool_directory = true
203 check_spool_inodes = 200
204 check_spool_space = 20M
209 deliver_queue_load_max = 50
211 queue_list_requires_admin = false
214 if has_variable?("clamd") && clamd == "true"
215 out = "av_scanner = clamd:/var/run/clamav/clamd.ctl"
222 out = "daemon_smtp_ports = "
225 if nodeinfo['bugsmaster']
229 if not nodeinfo['mail_port'].to_s.empty?
230 ports << nodeinfo['mail_port']
233 if nodeinfo['mailrelay']
234 ports << nodeinfo['smarthost_port']
237 out += ports.uniq.sort.join(" : ")
242 remote_sort_domains = *.debian.org:*.debian.net
244 pipelining_advertise_hosts = !*
246 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
247 out = 'tls_advertise_hosts = *'
251 smtp_enforce_sync = true
253 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
255 received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
256 {${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
257 ${if and {{eq {$tls_certificate_verified}{1}}{def:tls_peerdn}}{from $tls_peerdn (verified)\n\t}}\
258 by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}\
259 (Exim $version_number)\n\t\
260 ${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
261 id $message_exim_id${if def:received_for {\n\tfor $received_for}}
265 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
266 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
267 ${if exists {/srv/$domain/mail/whitelist}{\
268 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
270 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
271 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
272 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
273 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
274 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
275 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
276 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
278 ######################################################################
279 # ACL CONFIGURATION #
280 ######################################################################
289 if nodeinfo['mailrelay']
290 out = " accept verify = certificate"
295 # These are in HELO acl so that they are only run once. They increment a counter,
296 # so we don't want it to increment per rcpt to.
298 warn dnslists = list.dnswl.org&0.0.0.3
299 log_message = Hit on list.dnswl.org for $sender_host_address
300 set acl_c1 = ${eval:$acl_c1-30}
302 warn dnslists = list.dnswl.org&0.0.0.2
303 log_message = Hit on list.dnswl.org for $sender_host_address
304 set acl_c1 = ${eval:$acl_c1-20}
306 warn dnslists = list.dnswl.org
307 log_message = Hit on list.dnswl.org for $sender_host_address
308 set acl_c1 = ${eval:$acl_c1-10}
310 warn condition = ${if isip {$sender_helo_name}{true}{false}}
311 log_message = remote host used IP address in HELO/EHLO greeting
312 set acl_c1 = ${eval:$acl_c1+20}
314 warn !hosts = +debianhosts
315 condition = ${if eq{$host_lookup_failed}{1}}
316 set acl_c1 = ${eval:$acl_c1+20}
318 warn !hosts = +debianhosts
319 condition = ${if eq{$host_lookup_failed}{0}}
320 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}}
321 set acl_c1 = ${eval:$acl_c1+20}
323 warn !hosts = +debianhosts
324 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}}
325 set acl_c1 = ${eval:$acl_c1+20}
327 warn !hosts = +debianhosts
328 dnslists = dul.dnsbl.sorbs.net
329 set acl_c1 = ${eval:$acl_c1+15}
331 # If the sender's helo name is empty, the message will be rejected later
332 # because the helo is empty. If the rDNS lookup failed, we are already
333 # going to greylist them, so no sense worrying about it here. Finally,
334 # if rDNS does not match helo name (both lower cased first), greylist.
336 warn !hosts = +debianhosts
337 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
338 condition = ${if def:sender_helo_name {yes}{no}}
339 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
340 log_message = HELO doesn't match rDNS
341 set acl_c1 = ${eval:$acl_c1+8}
344 # matches 098325879 - looks fishy
346 warn condition = ${if and { \
347 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
348 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
351 log_message = non-FQDN HELO
352 set acl_c1 = ${eval:$acl_c1+12}
354 # Matches DOMAIN99.com - looks bad
356 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
357 log_message = SHOUTING HELO
358 set acl_c1 = ${eval:$acl_c1+7}
360 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
361 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
362 # naive test, so it's not worth much
364 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
365 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
366 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
367 log_message = random HELO
368 set acl_c1 = ${eval:$acl_c1+5}
370 # Implicit, but simpler to just say it
373 #!!# ACL that is used after the RCPT command on the submission port
376 # Accept if the source is local SMTP (i.e. not over TCP/IP).
377 # We do this by testing for an empty sending host field.
378 accept hosts = : 127.0.0.1
382 if nodeinfo['mailrelay']
383 out = " accept verify = certificate"
388 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
389 # This is a rough pass at preventing addres harvesting or other mail blasts.
391 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
392 message = Too many bad recipients, try again later
393 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
396 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
397 !hosts = +debianhosts
398 message = sorry, only 5 reports per hour for submission
400 accept domains = +local_domains
403 message = unknown user
408 if nodeinfo['mailrelay']
410 accept domains = +mailhubdomains
412 message = unknown user
413 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
419 accept domains = +submission_domains
421 message = unknown user
424 deny message = relay not permitted
426 #!!# ACL that is used after the RCPT command
431 if nodeinfo['mailrelay']
432 out = " accept verify = certificate"
437 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
438 # This is a rough pass at preventing addres harvesting or other mail blasts.
440 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
441 message = Too many bad recipients, try again later
442 !hosts = +debianhosts
443 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
445 # Dump spambots that are so stupid they say helo as our IP address
447 drop !hosts = +debianhosts
448 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
449 message = HELO mismatch Forged HELO for ($sender_helo_name)
451 # Also for spambots that say helo as us or one of our domains
453 drop !hosts = +debianhosts
454 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
455 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
456 message = HELO mismatch Forged HELO for ($sender_helo_name)
458 # This logic gives you a list of commonly forged domains in helo to reject against
460 warn set acl_m2 = ${lookup{$sender_helo_name} \
461 nwildlsearch{/etc/exim4/helo-check} \
462 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
464 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
465 # say helo as a name in the list but we can't look them up
467 defer !hosts = +debianhosts
468 condition = ${if eq{$acl_m2}{}{no}{yes}}
469 condition = ${if eq{$sender_host_name}{}{yes}{no}}
470 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
471 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
473 # If DNS works, go ahead and reject them
475 drop !hosts = +debianhosts
476 condition = ${if and { {!eq{$acl_m2}{}}{!match{$sender_host_name}{${rxquote:$acl_m2}\N$\N}}}{yes}{no}}
477 message = HELO mismatch Forged HELO for ($sender_helo_name)
479 # disabled accounts don't even get local mail.
480 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
481 domains = +local_domains
482 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
484 deny domains = +virtual_domains
485 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
486 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
488 hosts = !+debianhosts
489 message = mail for <$local_part@$domain> only accepted from debian.org machines
490 # Accept if the source is local SMTP (i.e. not over TCP/IP).
491 # We do this by testing for an empty sending host field.
494 deny domains = +handled_domains
495 local_parts = ^[.] : ^.*[@%!/|]
497 deny domains = !+handled_domains
498 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
500 # forwards mail to @d.o address, even if it's a bounce from master, no reply
501 # from source address; rejecting all mail now.
502 deny recipients = mendoza@debian.org
503 hosts = 65.110.39.147 : 64.39.31.15
504 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
506 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
507 sender_domains= +local_domains : debian.org : debian.net : debian.com
508 hosts = !+debianhosts
509 message = mail from <$sender_address> not allowed externally
511 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
512 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
513 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
514 message = no mail should ever come from <$sender_address>
516 deny local_parts = +local_only_users
517 domains = +local_domains
518 hosts = !+debianhosts
519 message = mail for $local_part is only accepted internally
521 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
522 hosts = !+debianhosts
523 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
525 deny !recipients = survey@popcon.debian.org
528 defer !hosts = +debianhosts
529 condition = ${if >{${eval:$acl_c1}}{0}}
530 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
531 message = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
535 if has_variable?("policydweight") && policydweight == "true"
537 # Check with policyd-weight - this only works with a version after etch\'s,
538 # sadly. etch\'s version attempts to hold the socket open, since that\'s what
539 # postfix expects. Exim, on the other hand, expects the remote side to close
540 # the socket when it\'s finished sending data, so it see each transaction as
541 # an incomplete read. I\'m sure there\'s a way we could force exim to do
542 # something sick and clever to force either the interpretation or the socket
543 # closure, but I\'m fairly sure it\'s now worth it, since the backport of
544 # policyd-weight is trivial.
545 warn !hosts = +debianhosts
546 set acl_m9 = ${readsocket{inet:127.0.0.1:12525}\
547 {request=smtpd_access_policy\n\
548 protocol_state=RCPT\n\
549 protocol_name=${uc:$received_protocol}\n\
550 helo_name=$sender_helo_name\n\
551 queue_id=$message_exim_id\n\
552 sender=$sender_address\n\
553 recipient=$local_part@$domain\n\
554 recipient_count=$rcpt_count\n\
555 client_address=$sender_host_address\n\
556 client_name=$sender_host_name\n\
557 reverse_client_name=$sender_host_name\n\
558 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
559 {20s}{\n}{socket failure}}
561 # Defer on socket error
562 defer !hosts = +debianhosts
563 condition = ${if eq{$acl_m9}{socket failure}{yes}{no}}
564 message = Cannot connect to policyd-weight. Please try again later.
566 # Set proposed action to $acl_m8 and message to $acl_m7
567 warn !hosts = +debianhosts
568 set acl_m8 = ${extract{action}{$acl_m9}}
569 set acl_m7 = ${sg{$acl_m9}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
571 # Add X-policyd-weight header line to message
572 warn !hosts = +debianhosts
574 condition = ${if eq{$acl_m8}{PREPEND}{yes}{no}}
576 # Write log message, if policyd-weight can\'t run checks
577 warn !hosts = +debianhosts
578 log_message = policyd-weight message: $acl_m7
579 condition = ${if eq{$acl_m8}{DUNNO}{yes}{no}}
581 # Deny mails which policyd-weight thinks are spam
582 deny !hosts = +debianhosts
583 message = policyd-weight said: $acl_m7
584 condition = ${if eq{$acl_m8}{550}{yes}{no}}
586 # Defer messages when policyd-weight suggests so.
587 defer !hosts = +debianhosts
588 message = policyd-weight said: $acl_m7
589 condition = ${if eq{$acl_m8}{450}{yes}{no}}
594 warn recipients = survey@popcon.debian.org
595 set acl_m1 = PopconMail
599 if nodeinfo['rtmaster']
601 warn domains = rt.debian.org
603 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if or{{match{$local_part}{[^+]+\\+\\d+}}{match{$local_part}{[^+]+\\+new}}} {RTMailRecipientHasSubaddress}}}}
610 if nodeinfo['packagesmaster']
612 warn domains = packages.qa.debian.org
615 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
616 set acl_m1 = PTSOwner
619 domains = packages.qa.debian.org
620 condition = ${if match{$local_part}{\N^bounces+\N}}
621 set acl_m1 = PTSListBounce
626 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
627 set acl_m1 = DBSignedMail
631 if has_variable?("greylistd") && greylistd == "true"
634 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
635 log_message = greylisted.
636 local_parts = ${if match_domain{$domain}{+virtual_domains}\
637 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
638 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
639 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
640 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
642 !hosts = : +debianhosts : WHITELIST : \
643 ${if exists {/etc/greylistd/whitelist-hosts}\
644 {/etc/greylistd/whitelist-hosts}{}} : \
645 ${if exists {/var/lib/greylistd/whitelist-hosts}\
646 {/var/lib/greylistd/whitelist-hosts}{}}
648 domains = +handled_domains : +rcpthosts
649 condition = ${readsocket{/var/run/greylistd/socket}\
651 $sender_host_address \
653 $local_part@$domain}\
656 elsif has_variable?("postgrey") && postgrey == "true"
658 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
659 # this adds acl_m4 if there isn\'t one (so unique per message)
662 !hosts = : +debianhosts : WHITELIST
663 condition = ${if def:acl_m4 {no}{yes}}
664 set acl_m4 = $pid.$tod_epoch.$sender_host_port
666 # and defers the message if postgrey thinks it should be defered ...
669 !hosts = : +debianhosts : WHITELIST
671 domains = +handled_domains : +rcpthosts
672 local_parts = GREYLIST_LOCAL_PARTS
673 set acl_m3 = request=smtpd_access_policy\n\
674 protocol_state=RCPT\n\
675 protocol_name=${uc:$received_protocol}\n\
676 instance=${acl_m4}\n\
677 helo_name=${sender_helo_name}\n\
678 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
679 client_name=${sender_host_name}\n\
680 sender=${sender_address}\n\
681 recipient=$local_part@$domain\n\n
683 ${readsocket{/var/run/postgrey/socket}{$acl_m3}\
684 {5s}{}{action=DUNNO}}\
686 message = ${sg{$acl_m3}{^\\\\w+\\\\s*}{}}
687 log_message = greylisted.
688 condition = ${if eq{${uc:${substr{0}{5}{$acl_m3}}}}{DEFER}}
690 # ... or adds a header with information about how long the delay was
693 !hosts = : +debianhosts : WHITELIST
695 domains = +handled_domains : +rcpthosts
696 local_parts = GREYLIST_LOCAL_PARTS
697 condition = ${if eq{${uc:${substr_0_7:$acl_m3}}}{PREPEND}}
698 message = ${sg{$acl_m3}{^\\\\w+\\\\s*}{}}
704 accept local_parts = postmaster
705 domains = +handled_domains : +rcpthosts
707 deny log_message = <$sender_address> is blacklisted
708 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
709 message = We have blacklisted <$sender_address>. Please stop mailing us
711 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
712 dnslists = ${if match_domain{$domain}{+virtual_domains}\
713 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
714 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
715 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
716 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
717 domains = +handled_domains : +rcpthosts
718 !hosts = +debianhosts : WHITELIST
720 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
721 dnslists = ${if match_domain{$domain}{+virtual_domains}\
722 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
723 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
724 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
725 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
726 domains = +handled_domains : +rcpthosts
727 !hosts = +debianhosts : WHITELIST
729 deny domains = +handled_domains : +rcpthosts
730 local_parts = ${if match_domain{$domain}{+virtual_domains}\
731 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
732 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
733 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
734 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
735 !hosts = +debianhosts : WHITELIST
736 !verify = sender/callout
740 if nodeinfo['mailrelay']
742 accept domains = +mailhubdomains
744 message = unknown user
745 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
750 accept domains = +handled_domains
752 message = unknown user
753 verify = recipient/defer_ok
755 accept domains = +rcpthosts
757 message = unrouteable address
760 accept hosts = +debianhosts
762 accept authenticated = *
764 deny message = relay not permitted
768 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
772 deny condition = ${if <{$message_size}{256000}}
773 set acl_m5 = ${perl{surblspamcheck}}
774 condition = ${if eq{$acl_m5}{false}{no}{yes}}
775 log_message = $acl_m5
781 #!!# ACL that is used after the DATA command
783 require verify = header_syntax
784 message = Invalid syntax in the header
788 if nodeinfo['rtmaster']
790 deny condition = ${if eq {$acl_m1}{RTMail}}
791 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
792 {!match {${lc:$rh_Subject:]}} {\\[rt.debian.org }} \
793 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
794 message = messages to the Request Tracker system require a subject tag or a subaddress
801 if nodeinfo['packagesmaster']
803 deny !hosts = +debianhosts : 217.196.43.134
804 condition = ${if eq {$acl_m1}{PTSMail}}
805 condition = ${if def:h_X-PTS-Approved:{false}{true}}
806 message = messages to the PTS require an X-PTS-Approved header
811 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
812 message = Blackisted URI found in body
814 deny condition = ${if eq {$acl_m1}{DBSignedMail}}
815 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
816 {!match {$message_body}{PGP SIGNED MESSAGE}} \
817 {!match {$message_body}{PGP SIGNATURE}} \
818 {!match {$header_content-type:}{multipart/signed}} \
819 {!match {$header_content-type:}{pgp}} \
822 message = Mail to this address needs to be PGP-signed
824 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
825 # postfix's strict_7bit_headers option, but only checks a few common problem
826 # headers, as there doesn't appear to be an easy way to check them all.
828 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
829 {match {$rh_To:}{[\200-\377]}}\
830 {match {$rh_From:}{[\200-\377]}}\
831 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
832 message = improper use of 8-bit data in message header: message rejected
835 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
836 message = Your mailer is not RFC 2047 compliant: message rejected
840 if has_variable?("clamd") && clamd == "true"
845 message = malware detected: $malware_name: message rejected
851 deny spam = $value/defer_ok
852 domains = +handled_domains : +rcpthosts
853 message = message got a spam score of $spam_score
854 local_parts = ${if exists {/etc/exim4/sa_users}\
855 {${if match_domain{$domain}{+virtual_domains}\
856 {${lookup{$local_part@$domain}nwildlsearch{/etc/exim4/sa_users}{$local_part}{}}}\
857 {${lookup{$local_part}lsearch{/etc/exim4/sa_users}{$local_part}{}}}}}}
861 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
863 deny condition = ${if <{$message_size}{256000}}
864 set acl_m5 = ${perl{surblspamcheck}}
865 condition = ${if eq{$acl_m5}{false}{no}{yes}}
866 log_message = $acl_m5
871 # Check header_sender except for survey@popcon.d.o
872 deny condition = ${if eq{$acl_m1}{PopconMail}{false}{true}}
873 !verify = header_sender
874 message = No valid sender found in the From:, Sender: and Reply-to: headers
880 ######################################################################
881 # REWRITE CONFIGURATION #
882 ######################################################################
888 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
889 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
890 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
891 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
892 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
893 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
896 #!!#######################################################!!#
897 #!!# Here follow routers created from the old routers, #!!#
898 #!!# for handling non-local domains. #!!#
899 #!!#######################################################!!#
905 ######################################################################
906 # ROUTERS CONFIGURATION #
907 # Specifies how addresses are handled #
908 ######################################################################
909 # ORDER DOES MATTER #
910 # An address is passed to each in turn until it is accepted. #
911 ######################################################################
915 if nodeinfo['mailrelay']
919 domains = +mailhubdomains
920 transport = remote_smtp
921 route_data = ${lookup{$domain}lsearch{/etc/exim4/manualroute}}
922 require_files = /etc/exim4/manualroute
929 debug_print = "R: bsmtp for $local_part@$domain"
931 domains = !+local_domains
932 require_files = /etc/exim4/bsmtp
933 route_list = * ${extract{file}{\
934 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
938 # This router routes to remote hosts over SMTP by explicit IP address,
939 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
940 # require this facility, which is why it is enabled by default in Exim.
942 debug_print = "R: ipliteral for $local_part@$domain"
944 domains = !+handled_domains
945 transport = remote_smtp
946 ignore_target_hosts = +reservedaddrs
950 if not nodeinfo['smarthost'].empty?
953 debug_print = "R: smarthost for $local_part@$domain"
955 domains = !+handled_domains
956 transport = remote_smtp_smarthost
957 route_list = * ' + nodeinfo['smarthost'] + '
958 host_find_failed = defer
959 same_domain_copy_routing = yes
966 # This router routes to remote hosts over SMTP using a DNS lookup.
967 # Ignore reserved network responses, including localhost.
969 debug_print = "R: dnslookup for $local_part@$domain"
971 domains = !+handled_domains
972 transport = remote_smtp
973 ignore_target_hosts = +reservedaddrs
976 # This router handles aliasing using a traditional /etc/aliases file.
977 # If any of your aliases expand to pipes or files, you will need to set
978 # up a user and a group for these deliveries to run under. You can do
979 # this by uncommenting the "user" option below (changing the user name
980 # as appropriate) and adding a "group" option if necessary.
983 debug_print = "R: system_aliases for $local_part@$domain"
987 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
988 domains = +local_domains
989 file_transport = address_file
990 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
991 pipe_transport = address_pipe
994 # This router handles forwarding using traditional .forward files.
995 # It also allows mail filtering when a forward file starts with the
996 # string "# Exim filter": to disable filtering, uncomment the "filter"
997 # option. The check_ancestor option means that if the forward file
998 # generates an address that is an ancestor of the current one, the
999 # current one gets passed on instead. This covers the case where A is
1000 # aliased to B and B has a .forward file pointing to A.
1002 # For standard debian setup of one group per user, it is acceptable---normal
1003 # even---for .forward to be group writable. If you have everyone in one
1004 # group, you should comment out the "modemask" line. Without it, the exim
1005 # default of 022 will apply, which is probably what you want.
1008 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1013 directory_transport = address_directory
1014 domains = +local_domains
1015 # filter - I have disabled filtering to force users to use .forward-foo files
1016 # or procmail. This will make it easier to move mailers in the future
1018 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1019 # also checks if the .forward-bar exists, if not then it uses
1020 # .forward-default instead.
1021 file = $home/.forward\
1022 ${if eq{}{$local_part_suffix}{}{\
1023 ${if exists {${home}/.forward${local_part_suffix}} \
1024 {${local_part_suffix}}{-default}}\
1027 file_transport = address_file
1028 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1029 local_part_suffix = -*
1030 local_part_suffix_optional
1032 pipe_transport = address_pipe
1033 reply_transport = address_reply
1034 require_files = $home
1035 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
1039 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1043 directory_transport = address_directory
1044 domains = +local_domains
1045 # filter - I have disabled filtering to force users to use .forward-foo files
1046 # or procmail. This will make it easier to move mailers in the future
1048 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1049 # also checks if the .forward-bar exists, if not then it uses
1050 # .forward-default instead.
1051 file = $home/.forward\
1052 ${if eq{}{$local_part_suffix}{}{\
1053 ${if exists {${home}/.forward${local_part_suffix}} \
1054 {${local_part_suffix}}{-default}}\
1057 file_transport = address_file
1058 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1059 local_part_suffix = -*
1060 local_part_suffix_optional
1062 pipe_transport = address_pipe
1063 reply_transport = address_reply
1064 require_files = $home
1067 # This delivers to procmail
1069 debug_print = "R: procmail for $local_part@$domain"
1072 domains = +local_domains
1073 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1076 require_files = $local_part:$home/.procmailrc
1077 transport = procmail_pipe
1078 transport_current_directory = $home
1080 # This driver delivers to the LDAP generated alias file.
1082 debug_print = "R: ldap_aliases for $local_part@$domain"
1086 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
1087 {${lookup{$local_part}cdb\
1088 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
1089 domains = +local_domains
1090 file_transport = address_file
1091 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1092 pipe_transport = address_pipe
1093 retry_use_local_part
1095 # This director matches local user mailboxes.
1097 debug_print = "R: localuser for $local_part@$domain"
1100 domains = +local_domains
1101 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1102 # Disable if the user has never logged in
1103 require_files = $home
1104 transport = local_delivery
1107 # Now we begin the Virtual Domain configuration
1108 # Everything before here should apply only to the local domains with a
1111 # exim4 fails the router if it can't change to the user/group for delivery
1112 # during verification. So we have to seperate the cases of verifying
1113 # the virts, and delivering to them. blah.
1116 if nodeinfo['packagesmaster']
1118 # This router delivers for packages.d.o
1120 debug_print = "R: packages for $local_part@$domain"
1122 file_transport = address_file
1123 pipe_transport = address_pipe
1124 domains = packages.debian.org
1125 require_files = /org/packages.debian.org/conf/maintainer
1126 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
1127 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1128 transport_home_directory = /org/packages.debian.org/mail
1129 transport_current_directory = /org/packages.debian.org/mail
1131 retry_use_local_part
1140 if nodeinfo['bugsmaster']
1142 # This router delivers for bugs.d.o
1144 debug_print = "R: bugs for $local_part@$domain"
1146 transport = bugs_pipe
1147 domains = bugs.debian.org
1148 cannot_route_message = Unknown or archived bug
1149 require_files = /org/bugs.debian.org/mail/run-procmail
1151 local_parts = ${if match\
1153 {\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}\
1154 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
1155 {$local_part}fail}}fail}
1163 if nodeinfo['rtmaster']
1165 # This router delivers for rt.d.o
1166 rt_force_new_verbose:
1167 debug_print = "R: rt for $local_part+new@$domain"
1169 domains = rt.debian.org
1170 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1171 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1172 local_part_suffix = +new
1173 pipe_transport = rt_pipe
1174 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}}"
1175 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1177 # FIXME: figure out how to generalize this approach so that all of the following would work
1178 # - rt+NNNN@rt.debian.org : attach correspondence to ticket (verbose)
1179 # - rt+NNNN-quiesce@rt.debian.org : attach correspondence to ticket (quiesce)
1180 # - rt+NNNN-<action>@rt.debian.org : attach correspondence to ticket (some action)
1181 # requires modification to custom condition in \'scrips\'
1182 rt_force_new_quiesce:
1183 debug_print = "R: rt for $local_part+new-quiesce@$domain"
1185 domains = rt.debian.org
1186 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1187 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1188 local_part_suffix = +new-quiesce
1189 pipe_transport = rt_pipe
1190 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}}"
1191 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}\nX-RT-Mode: quiesce"
1194 debug_print = "R: rt for $local_part@$domain"
1196 domains = rt.debian.org
1197 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1198 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1199 local_part_suffix = +*
1200 local_part_suffix_optional
1201 pipe_transport = rt_pipe
1202 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}}"
1203 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1210 debug_print = "R: virt_aliases for $local_part@$domain"
1212 data = ${if exists{\
1213 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1214 {${lookup{$local_part}lsearch*{\
1215 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1217 directory_transport = address_directory
1218 cannot_route_message = Unknown user
1219 domains = +virtual_domains
1220 file_transport = address_file
1221 pipe_transport = address_pipe
1222 qualify_preserve_domain
1223 retry_use_local_part
1224 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1225 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1229 debug_print = "R: virt_direct for $local_part@$domain"
1235 directory_transport = address_directory
1236 domains = +virtual_domains
1237 file = $home/.forward-\
1238 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1240 file_transport = address_file
1241 pipe_transport = address_pipe
1242 reply_transport = address_reply
1243 retry_use_local_part
1244 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1245 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1248 # This is a senmailesque alias file lookup
1250 debug_print = "R: virt_aliases for $local_part@$domain"
1254 data = ${if exists{\
1255 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1256 {${lookup{$local_part}lsearch*{\
1257 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1259 directory_transport = address_directory
1260 domains = +virtual_domains
1261 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1262 cannot_route_message = Unknown user
1263 group = ${extract{group}{VDOMAINDATA}}
1264 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1265 pipe_transport = address_pipe
1266 qualify_preserve_domain
1267 retry_use_local_part
1268 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1269 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1271 user = ${extract{user}{VDOMAINDATA}}
1273 # This is a qmailesque deliver into a directory of .forward files
1275 debug_print = "R: virt_direct for $local_part@$domain"
1281 directory_transport = address_directory
1282 domains = +virtual_domains
1283 file = $home/.forward-\
1284 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1286 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1287 group = ${extract{group}{VDOMAINDATA}}
1288 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1290 pipe_transport = address_pipe
1291 reply_transport = address_reply
1292 retry_use_local_part
1293 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1294 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1296 user = ${extract{user}{VDOMAINDATA}}
1297 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1299 ######################################################################
1300 # TRANSPORTS CONFIGURATION #
1301 ######################################################################
1302 # ORDER DOES NOT MATTER #
1303 # Only one appropriate transport is called for each delivery. #
1304 ######################################################################
1309 # This transport is used for local delivery to user mailboxes. On debian
1310 # systems group mail is used so we can write to the /var/mail
1311 # directory. (The alternative, which most other unixes use, is to deliver
1312 # as the user's own group, into a sticky-bitted directory)
1315 file = /var/mail/${local_part}
1318 no_mode_fail_narrower
1321 # This transport is used for handling pipe addresses generated by alias
1322 # or .forward files. It has a conventional name, since it is not actually
1323 # mentioned elsewhere in this configuration file. (A different name *can*
1324 # be specified via the "address_pipe_transport" option if you really want
1325 # to.) If the pipe generates any standard output, it is returned to the sender
1326 # of the message as a delivery error. Set return_fail_output instead if you
1327 # want this to happen only when the pipe fails to complete normally.
1331 current_directory = ${home}
1332 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1333 EXT=${substr_1:${local_part_suffix}}:\
1334 LOCAL=${local_part}${local_part_suffix}:\
1335 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1339 # This transport is used for handling file addresses generated by alias
1340 # or .forward files. It has a conventional name, since it is not actually
1341 # mentioned elsewhere in this configuration file.
1351 directory_mode = 0770
1352 mode_fail_narrower = false
1354 # This transport is used for handling file addresses generated by alias
1355 # or .forward files if the path ends in "/", which causes it to be treated
1356 # as a directory name rather than a file name. Each message is then delivered
1357 # to a unique file in the directory. If instead you want all such deliveries to
1358 # be in the "maildir" format that is used by some other mail software,
1359 # uncomment the final option below. If this is done, the directory specified
1360 # in the .forward or alias file is the base maildir directory.
1362 # Should you want to be able to specify either maildir or non-maildir
1363 # directory-style deliveries, then you must set up yet another transport,
1364 # called address_directory2. This is used if the path ends in "//" so should
1365 # be the one used for maildir, as the double slash suggests another level
1366 # of directory. In the absence of address_directory2, paths ending in //
1367 # are passed to address_directory.
1377 # This transport is used for handling autoreplies generated by the filtering
1378 # option of the forwardfile director. It has a conventional name, since it
1379 # is not actually mentioned elsewhere in this configuration file.
1383 # This transport is used for delivering messages over SMTP connections.
1387 connect_timeout = 1m
1390 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1391 out = " tls_certificate = /etc/exim4/ssl/thishost.crt
1392 tls_privatekey = /etc/exim4/ssl/thishost.key"
1399 if not nodeinfo['smarthost'].empty?
1401 remote_smtp_smarthost:
1402 debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
1405 out += nodeinfo['smarthost_port'].to_s + "\n"
1406 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1407 out += ' tls_tempfail_tryclear = false
1408 hosts_require_tls = ' + nodeinfo['smarthost'] + '
1409 tls_certificate = /etc/exim4/ssl/thishost.crt
1410 tls_privatekey = /etc/exim4/ssl/thishost.key
1417 # Send the message to procmail
1420 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1422 user = ${local_part}
1431 user = ${extract{user}{\
1432 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1438 if nodeinfo['bugsmaster']
1442 command = /org/bugs.debian.org/mail/run-procmail
1443 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1444 EXT=${substr_1:${local_part_suffix}}:\
1445 LOCAL=${local_part}${local_part_suffix}:\
1446 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1457 if nodeinfo['rtmaster']
1460 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1463 environment = EXTENSION=${substr_1:${local_part_suffix}}
1464 allow_commands = /usr/bin/rt-mailgate
1470 ######################################################################
1471 # RETRY CONFIGURATION #
1472 ######################################################################
1474 # This single retry rule applies to all domains and all errors. It specifies
1475 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1476 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1477 # hours, then retries every 8 hours until 4 days have passed since the first
1480 # Domain Error Retries
1481 # ------ ----- -------
1486 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1487 * * senders=: F,2h,10m
1488 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1489 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1491 # End of Exim 4 configuration