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
38 # mailhubdomains - Domains for which we are the MX, but the mail is relayed
39 # elsewhere. This is designed for use with small volume or
40 # restricted machines that need to use a smarthost for mail
41 # traffic. We will relay for them based on ssl cert validation
42 # but we need to teach exim how to route the mail to them. This is
45 # Exim's wildcard mechanism is a bit odd in that to say "any address in
46 # debian.org including debian.org" you must use two patterns,
49 # Also you can only place a * before a . and as the first char in a string.
50 # Wildcards always match last so they may be used as a catchall.
52 # Further details can be found in each of the files.
54 # Usefull exim commands:
55 # exim4 -qf - Try sending all messages right now, including frozen ones
56 # exim4 -bt foo@blah - Write what exim would do if it saw the address
57 # Great for testing virtual domains and forward files
59 # Special Features for users:
60 # .forward-foo - is understood as an extension address for bar-foo@cow.com
61 # .forward-default - is understood to be a catch all for bar-*@cow.com
62 # .procmailrc - with no .forward file invokes procmail for delivery
65 # For virtual domains the first lookup is done against a linear text
66 # database called 'aliases', then .forward files are consulted. Exim
67 # filtering is available for these .forward files only. .forward-default
68 # is the universal catch all for everything not handled.
70 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
71 # will trigger things like rcpt to rate limiting or possibly a reject if
72 # enough hits are triggered.
74 # value is stored in acl_c1
76 ######################################################################
77 # MAIN CONFIGURATION SETTINGS #
78 ######################################################################
80 # These options specify the Access Control Lists (ACLs) that
81 # are used for incoming SMTP messages - after the RCPT and DATA
82 # commands, respectively.
84 acl_smtp_helo = check_helo
85 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
86 acl_smtp_data = check_message
88 # accept domain literal syntax in e-mail addresses. To actually make use of
89 # this a router is also required
90 allow_domain_literals = true
92 # This setting defines a named domain list called
93 # local_domains. It will be referenced
94 # later on by the syntax "+local_domains".
95 # Other domain and host lists may follow.
96 # @ is the local FQDN, @[] matches the IP adress of any local interface.
98 .include_if_exists /etc/exim4/local-settings.conf
100 domainlist local_domains = @ : \
103 ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
105 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
107 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
109 domainlist handled_domains = +local_domains : +virtual_domains
111 localpartlist local_only_users = lsearch;/etc/exim4/localusers
113 # Domains we relay for; that is domains that aren't considered local but we
114 # accept mail for them.
115 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
116 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
117 domainlist mailhubdomains = lsearch;/etc/exim4/manualroute
119 hostlist reservedaddrs = <%= nodeinfo['reservedaddrs'] %>
122 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
123 out = "tls_certificate = /etc/exim4/ssl/thishost.crt
124 tls_privatekey = /etc/exim4/ssl/thishost.key
125 tls_try_verify_hosts = *
126 tls_verify_certificates = /etc/exim4/ssl/ca.crt
127 tls_crl = /etc/exim4/ssl/ca.crl"
132 # The setting below causes Exim to do a reverse DNS lookup on all incoming
133 # IP calls, in order to get the true host name. If you feel this is too
134 # expensive, you can specify the networks for which a lookup is done, or
135 # remove the setting entirely.
137 dns_ipv4_lookup = !localhost
139 # If this option is set, then any process that is running as one of the
140 # listed users may pass a message to Exim and specify the sender's
141 # address using the "-f" command line option, without Exim's adding a
144 untrusted_set_sender = *
146 # Some operating systems use the "gecos" field in the system password file
147 # to hold other information in addition to users' real names. Exim looks up
148 # this field when it is creating "sender" and "from" headers. If these options
149 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
150 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
153 gecos_pattern = ^([^,:]*)
156 # This tells exim to immediately discard error messages (ie double bounces).
157 ignore_bounce_errors_after = 0s
159 timeout_frozen_after=14d
161 message_size_limit = 100M
163 smtp_accept_max = 300
164 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
165 smtp_accept_queue = 200
166 smtp_accept_queue_per_connection = 50
167 smtp_accept_reserve = 25
168 smtp_reserve_hosts = +debianhosts
170 split_spool_directory = true
171 check_spool_inodes = 200
172 check_spool_space = 20M
177 deliver_queue_load_max = 50
179 queue_list_requires_admin = false
182 if has_variable?("clamd") && clamd == "true"
183 out = "av_scanner = clamd:/var/run/clamav/clamd.ctl"
190 out = "daemon_smtp_ports = "
193 if nodeinfo['bugsmaster']
197 if not nodeinfo['mail_port'].to_s.empty?
198 ports << nodeinfo['mail_port']
201 if nodeinfo['mailrelay']
202 ports << nodeinfo['smarthost_port']
205 out += ports.uniq.sort.join(" : ")
210 remote_sort_domains = *.debian.org:*.debian.net
212 pipelining_advertise_hosts = !*
214 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
215 out = 'tls_advertise_hosts = *'
219 smtp_enforce_sync = true
221 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
223 received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
224 {${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
225 ${if and {{eq {$tls_certificate_verified}{1}}{def:tls_peerdn}}{from $tls_peerdn (verified)\n\t}}\
226 by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}\
227 (Exim $version_number)\n\t\
228 ${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
229 id $message_exim_id${if def:received_for {\n\tfor $received_for}}
233 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
234 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
235 ${if exists {/srv/$domain/mail/whitelist}{\
236 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
238 }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
239 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
240 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
241 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
242 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
243 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
244 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
246 ######################################################################
247 # ACL CONFIGURATION #
248 ######################################################################
257 if nodeinfo['mailrelay']
258 out = " accept verify = certificate"
263 # These are in HELO acl so that they are only run once. They increment a counter,
264 # so we don't want it to increment per rcpt to.
266 warn dnslists = list.dnswl.org&0.0.0.3
267 log_message = Hit on list.dnswl.org for $sender_host_address
268 set acl_c1 = ${eval:$acl_c1-30}
270 warn dnslists = list.dnswl.org&0.0.0.2
271 log_message = Hit on list.dnswl.org for $sender_host_address
272 set acl_c1 = ${eval:$acl_c1-20}
274 warn dnslists = list.dnswl.org
275 log_message = Hit on list.dnswl.org for $sender_host_address
276 set acl_c1 = ${eval:$acl_c1-10}
278 warn condition = ${if isip {$sender_helo_name}{true}{false}}
279 log_message = remote host used IP address in HELO/EHLO greeting
280 set acl_c1 = ${eval:$acl_c1+20}
282 warn !hosts = +debianhosts
283 condition = ${if eq{$host_lookup_failed}{1}}
284 set acl_c1 = ${eval:$acl_c1+20}
286 warn !hosts = +debianhosts
287 condition = ${if eq{$host_lookup_failed}{0}}
288 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}}
289 set acl_c1 = ${eval:$acl_c1+20}
291 warn !hosts = +debianhosts
292 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}}
293 set acl_c1 = ${eval:$acl_c1+20}
295 warn !hosts = +debianhosts
296 dnslists = dul.dnsbl.sorbs.net
297 set acl_c1 = ${eval:$acl_c1+15}
299 # If the sender's helo name is empty, the message will be rejected later
300 # because the helo is empty. If the rDNS lookup failed, we are already
301 # going to greylist them, so no sense worrying about it here. Finally,
302 # if rDNS does not match helo name (both lower cased first), greylist.
304 warn !hosts = +debianhosts
305 condition = ${if eq {$host_lookup_failed}{1}{no}{yes}}
306 condition = ${if def:sender_helo_name {yes}{no}}
307 condition = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
308 log_message = HELO doesn't match rDNS
309 set acl_c1 = ${eval:$acl_c1+8}
312 # matches 098325879 - looks fishy
314 warn condition = ${if and { \
315 { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
316 { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
319 log_message = non-FQDN HELO
320 set acl_c1 = ${eval:$acl_c1+12}
322 # Matches DOMAIN99.com - looks bad
324 warn condition = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
325 log_message = SHOUTING HELO
326 set acl_c1 = ${eval:$acl_c1+7}
328 # Random HELO (run of 7 consonants) (constructed by viruses). We purposefully
329 # skip matching on machines named .*smtp.*, since that's 4 already. This is a fairly
330 # naive test, so it's not worth much
332 warn condition = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
333 condition = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
334 condition = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
335 log_message = random HELO
336 set acl_c1 = ${eval:$acl_c1+5}
338 # Implicit, but simpler to just say it
341 #!!# ACL that is used after the RCPT command on the submission port
344 # Accept if the source is local SMTP (i.e. not over TCP/IP).
345 # We do this by testing for an empty sending host field.
346 accept hosts = : 127.0.0.1
350 if nodeinfo['mailrelay']
351 out = " accept verify = certificate"
356 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
357 # This is a rough pass at preventing addres harvesting or other mail blasts.
359 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
360 message = Too many bad recipients, try again later
361 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
364 ratelimit = 5 / 60m / per_rcpt / $sender_host_address
365 !hosts = +debianhosts
366 message = sorry, only 5 reports per hour for submission
368 accept domains = +local_domains
371 message = unknown user
374 accept domains = +mailhubdomains
376 message = unknown user
377 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
379 accept domains = +submission_domains
381 message = unknown user
384 deny message = relay not permitted
386 #!!# ACL that is used after the RCPT command
391 if nodeinfo['mailrelay']
392 out = " accept verify = certificate"
397 # Defer after too many bad RCPT TO's. Legit MTAs will retry later.
398 # This is a rough pass at preventing addres harvesting or other mail blasts.
400 defer log_message = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
401 message = Too many bad recipients, try again later
402 !hosts = +debianhosts
403 condition = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
405 # Dump spambots that are so stupid they say helo as our IP address
407 drop !hosts = +debianhosts
408 condition = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
409 message = HELO mismatch Forged HELO for ($sender_helo_name)
411 # Also for spambots that say helo as us or one of our domains
413 drop !hosts = +debianhosts
414 condition = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
415 condition = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
416 message = HELO mismatch Forged HELO for ($sender_helo_name)
418 # This logic gives you a list of commonly forged domains in helo to reject against
420 warn set acl_m2 = ${lookup{$sender_helo_name} \
421 nwildlsearch{/etc/exim4/helo-check} \
422 {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
424 # This is a failsafe in case DNS fails - we defer instead of hard reject if they
425 # say helo as a name in the list but we can't look them up
427 defer !hosts = +debianhosts
428 condition = ${if eq{$acl_m2}{}{no}{yes}}
429 condition = ${if eq{$sender_host_name}{}{yes}{no}}
430 condition = ${if eq{$host_lookup_failed}{1}{no}{yes}}
431 message = Access temporarily denied. Resolve failed PTR for $sender_host_address
433 # If DNS works, go ahead and reject them
435 drop !hosts = +debianhosts
436 condition = ${if and { {!eq{$acl_m2}{}}{!match{$sender_host_name}{${rxquote:$acl_m2}\N$\N}}}{yes}{no}}
437 message = HELO mismatch Forged HELO for ($sender_helo_name)
439 # disabled accounts don't even get local mail.
440 deny local_parts = lsearch;/var/lib/misc/$primary_hostname/mail-disable
441 domains = +local_domains
442 message = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
444 deny domains = +virtual_domains
445 local_parts = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
446 {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
448 hosts = !+debianhosts
449 message = mail for <$local_part@$domain> only accepted from debian.org machines
450 # Accept if the source is local SMTP (i.e. not over TCP/IP).
451 # We do this by testing for an empty sending host field.
454 deny domains = +handled_domains
455 local_parts = ^[.] : ^.*[@%!/|]
457 deny domains = !+handled_domains
458 local_parts = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
460 # forwards mail to @d.o address, even if it's a bounce from master, no reply
461 # from source address; rejecting all mail now.
462 deny recipients = mendoza@debian.org
463 hosts = 65.110.39.147 : 64.39.31.15
464 message = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
466 deny condition = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
467 sender_domains= +local_domains : debian.org : debian.net : debian.com
468 hosts = !+debianhosts
469 message = mail from <$sender_address> not allowed externally
471 deny condition = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
472 condition = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
473 condition = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
474 message = no mail should ever come from <$sender_address>
476 deny local_parts = +local_only_users
477 domains = +local_domains
478 hosts = !+debianhosts
479 message = mail for $local_part is only accepted internally
481 deny message = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
482 hosts = !+debianhosts
483 dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
485 deny !recipients = survey@popcon.debian.org
488 defer !hosts = +debianhosts
489 condition = ${if >{${eval:$acl_c1}}{0}}
490 ratelimit = 10 / 60m / per_rcpt / $sender_host_address
491 message = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
495 if has_variable?("policydweight") && policydweight == "true"
497 # Check with policyd-weight - this only works with a version after etch\'s,
498 # sadly. etch\'s version attempts to hold the socket open, since that\'s what
499 # postfix expects. Exim, on the other hand, expects the remote side to close
500 # the socket when it\'s finished sending data, so it see each transaction as
501 # an incomplete read. I\'m sure there\'s a way we could force exim to do
502 # something sick and clever to force either the interpretation or the socket
503 # closure, but I\'m fairly sure it\'s now worth it, since the backport of
504 # policyd-weight is trivial.
505 warn !hosts = +debianhosts
506 set acl_m9 = ${readsocket{inet:127.0.0.1:12525}\
507 {request=smtpd_access_policy\n\
508 protocol_state=RCPT\n\
509 protocol_name=${uc:$received_protocol}\n\
510 helo_name=$sender_helo_name\n\
511 queue_id=$message_exim_id\n\
512 sender=$sender_address\n\
513 recipient=$local_part@$domain\n\
514 recipient_count=$rcpt_count\n\
515 client_address=$sender_host_address\n\
516 client_name=$sender_host_name\n\
517 reverse_client_name=$sender_host_name\n\
518 instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
519 {20s}{\n}{socket failure}}
521 # Defer on socket error
522 defer !hosts = +debianhosts
523 condition = ${if eq{$acl_m9}{socket failure}{yes}{no}}
524 message = Cannot connect to policyd-weight. Please try again later.
526 # Set proposed action to $acl_m8 and message to $acl_m7
527 warn !hosts = +debianhosts
528 set acl_m8 = ${extract{action}{$acl_m9}}
529 set acl_m7 = ${sg{$acl_m9}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
531 # Add X-policyd-weight header line to message
532 warn !hosts = +debianhosts
534 condition = ${if eq{$acl_m8}{PREPEND}{yes}{no}}
536 # Write log message, if policyd-weight can\'t run checks
537 warn !hosts = +debianhosts
538 log_message = policyd-weight message: $acl_m7
539 condition = ${if eq{$acl_m8}{DUNNO}{yes}{no}}
541 # Deny mails which policyd-weight thinks are spam
542 deny !hosts = +debianhosts
543 message = policyd-weight said: $acl_m7
544 condition = ${if eq{$acl_m8}{550}{yes}{no}}
546 # Defer messages when policyd-weight suggests so.
547 defer !hosts = +debianhosts
548 message = policyd-weight said: $acl_m7
549 condition = ${if eq{$acl_m8}{450}{yes}{no}}
554 warn recipients = survey@popcon.debian.org
555 set acl_m1 = PopconMail
557 warn domains = rt.debian.org
559 set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if or{{match{$local_part}{[^+]+\\+\\d+}}{match{$local_part}{[^+]+\\+new}}} {RTMailRecipientHasSubaddress}}}}
561 warn domains = packages.qa.debian.org
564 warn recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
565 set acl_m1 = PTSOwner
567 warn recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
568 set acl_m1 = DBSignedMail
571 domains = packages.qa.debian.org
572 condition = ${if match{$local_part}{\N^bounces+\N}}
573 set acl_m1 = PTSListBounce
577 if has_variable?("greylistd") && greylistd == "true"
580 message = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
581 log_message = greylisted.
582 local_parts = ${if match_domain{$domain}{+virtual_domains}\
583 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
584 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
585 {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
586 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
588 !hosts = : +debianhosts : WHITELIST : \
589 ${if exists {/etc/greylistd/whitelist-hosts}\
590 {/etc/greylistd/whitelist-hosts}{}} : \
591 ${if exists {/var/lib/greylistd/whitelist-hosts}\
592 {/var/lib/greylistd/whitelist-hosts}{}}
594 domains = +handled_domains : +rcpthosts
595 condition = ${readsocket{/var/run/greylistd/socket}\
597 $sender_host_address \
599 $local_part@$domain}\
602 elsif has_variable?("postgrey") && postgrey == "true"
604 # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
605 # this adds acl_m4 if there isn\'t one (so unique per message)
608 !hosts = : +debianhosts : WHITELIST
609 condition = ${if def:acl_m4 {no}{yes}}
610 set acl_m4 = $pid.$tod_epoch.$sender_host_port
612 # and defers the message if postgrey thinks it should be defered ...
615 !hosts = : +debianhosts : WHITELIST
617 domains = +handled_domains : +rcpthosts
618 local_parts = GREYLIST_LOCAL_PARTS
619 set acl_m3 = request=smtpd_access_policy\n\
620 protocol_state=RCPT\n\
621 protocol_name=${uc:$received_protocol}\n\
622 instance=${acl_m4}\n\
623 helo_name=${sender_helo_name}\n\
624 client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
625 client_name=${sender_host_name}\n\
626 sender=${sender_address}\n\
627 recipient=$local_part@$domain\n\n
629 ${readsocket{/var/run/postgrey/socket}{$acl_m3}\
630 {5s}{}{action=DUNNO}}\
632 message = ${sg{$acl_m3}{^\\\\w+\\\\s*}{}}
633 log_message = greylisted.
634 condition = ${if eq{${uc:${substr{0}{5}{$acl_m3}}}}{DEFER}}
636 # ... or adds a header with information about how long the delay was
639 !hosts = : +debianhosts : WHITELIST
641 domains = +handled_domains : +rcpthosts
642 local_parts = GREYLIST_LOCAL_PARTS
643 condition = ${if eq{${uc:${substr_0_7:$acl_m3}}}{PREPEND}}
644 message = ${sg{$acl_m3}{^\\\\w+\\\\s*}{}}
650 accept local_parts = postmaster
651 domains = +handled_domains : +rcpthosts
653 deny log_message = <$sender_address> is blacklisted
654 senders = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
655 message = We have blacklisted <$sender_address>. Please stop mailing us
657 deny message = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
658 dnslists = ${if match_domain{$domain}{+virtual_domains}\
659 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
660 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
661 {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
662 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
663 domains = +handled_domains : +rcpthosts
664 !hosts = +debianhosts : WHITELIST
666 deny message = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
667 dnslists = ${if match_domain{$domain}{+virtual_domains}\
668 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
669 {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
670 {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
671 ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
672 domains = +handled_domains : +rcpthosts
673 !hosts = +debianhosts : WHITELIST
675 deny domains = +handled_domains : +rcpthosts
676 local_parts = ${if match_domain{$domain}{+virtual_domains}\
677 {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
678 {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
679 {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
680 ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
681 !hosts = +debianhosts : WHITELIST
682 !verify = sender/callout
684 accept domains = +mailhubdomains
686 message = unknown user
687 verify = recipient/callout=30s,defer_ok,use_sender,no_cache
689 accept domains = +handled_domains
691 message = unknown user
692 verify = recipient/defer_ok
694 accept domains = +rcpthosts
696 message = unrouteable address
699 accept hosts = +debianhosts
701 accept authenticated = *
703 deny message = relay not permitted
705 #!!# ACL that is used after the DATA command
707 require verify = header_syntax
708 message = Invalid syntax in the header
710 deny condition = ${if eq {$acl_m1}{RTMail}}
711 condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
712 {!match {${lc:$rh_Subject:]}} {\\[rt.debian.org }} \
713 {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
714 message = messages to the Request Tracker system require a subject tag or a subaddress
716 deny !hosts = +debianhosts : 217.196.43.134
717 condition = ${if eq {$acl_m1}{PTSMail}}
718 condition = ${if def:h_X-PTS-Approved:{false}{true}}
719 message = messages to the PTS require an X-PTS-Approved header
721 deny condition = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
722 message = Blackisted URI found in body
724 deny condition = ${if eq {$acl_m1}{DBSignedMail}}
725 condition = ${if and {{!match {$message_body}{PGP MESSAGE}} \
726 {!match {$message_body}{PGP SIGNED MESSAGE}} \
727 {!match {$message_body}{PGP SIGNATURE}} \
728 {!match {$header_content-type:}{multipart/signed}} \
729 {!match {$header_content-type:}{pgp}} \
732 message = Mail to this address needs to be PGP-signed
734 # RFC 822 and 2822 say that headers must be ASCII. This kinda emulates
735 # postfix's strict_7bit_headers option, but only checks a few common problem
736 # headers, as there doesn't appear to be an easy way to check them all.
738 condition = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
739 {match {$rh_To:}{[\200-\377]}}\
740 {match {$rh_From:}{[\200-\377]}}\
741 {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
742 message = improper use of 8-bit data in message header: message rejected
745 condition = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
746 message = Your mailer is not RFC 2047 compliant: message rejected
750 if has_variable?("clamd") && clamd == "true"
755 message = malware detected: $malware_name: message rejected
761 deny spam = $value/defer_ok
762 domains = +handled_domains : +rcpthosts
763 message = message got a spam score of $spam_score
764 local_parts = ${if exists {/etc/exim4/sa_users}\
765 {${if match_domain{$domain}{+virtual_domains}\
766 {${lookup{$local_part@$domain}nwildlsearch{/etc/exim4/sa_users}{$local_part}{}}}\
767 {${lookup{$local_part}lsearch{/etc/exim4/sa_users}{$local_part}{}}}}}}
769 # Check header_sender except for survey@popcon.d.o
770 deny condition = ${if eq{$acl_m1}{PopconMail}{false}{true}}
771 !verify = header_sender
772 message = No valid sender found in the From:, Sender: and Reply-to: headers
778 ######################################################################
779 # REWRITE CONFIGURATION #
780 ######################################################################
786 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
787 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
788 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
789 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
790 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
791 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
794 #!!#######################################################!!#
795 #!!# Here follow routers created from the old routers, #!!#
796 #!!# for handling non-local domains. #!!#
797 #!!#######################################################!!#
803 ######################################################################
804 # ROUTERS CONFIGURATION #
805 # Specifies how addresses are handled #
806 ######################################################################
807 # ORDER DOES MATTER #
808 # An address is passed to each in turn until it is accepted. #
809 ######################################################################
813 if nodeinfo['mailrelay']
817 domains = +mailhubdomains
818 transport = remote_smtp
819 route_data = ${lookup{$domain}lsearch{/etc/exim4/manualroute}}
820 require_files = /etc/exim4/manualroute
827 debug_print = "R: bsmtp for $local_part@$domain"
829 domains = !+local_domains
830 require_files = /etc/exim4/bsmtp
831 route_list = * ${extract{file}{\
832 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
836 # This router routes to remote hosts over SMTP by explicit IP address,
837 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
838 # require this facility, which is why it is enabled by default in Exim.
840 debug_print = "R: ipliteral for $local_part@$domain"
842 domains = !+handled_domains
843 transport = remote_smtp
844 ignore_target_hosts = +reservedaddrs
848 if not nodeinfo['smarthost'].empty?
851 debug_print = "R: smarthost for $local_part@$domain"
853 domains = !+handled_domains
854 transport = remote_smtp_smarthost
855 route_list = * ' + nodeinfo['smarthost'] + '
856 host_find_failed = defer
857 same_domain_copy_routing = yes
864 # This router routes to remote hosts over SMTP using a DNS lookup.
865 # Ignore reserved network responses, including localhost.
867 debug_print = "R: dnslookup for $local_part@$domain"
869 domains = !+handled_domains
870 transport = remote_smtp
871 ignore_target_hosts = +reservedaddrs
874 # This router handles aliasing using a traditional /etc/aliases file.
875 # If any of your aliases expand to pipes or files, you will need to set
876 # up a user and a group for these deliveries to run under. You can do
877 # this by uncommenting the "user" option below (changing the user name
878 # as appropriate) and adding a "group" option if necessary.
881 debug_print = "R: system_aliases for $local_part@$domain"
885 data = ${lookup{$local_part}lsearch*{/etc/aliases}}
886 domains = +local_domains
887 file_transport = address_file
888 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
889 pipe_transport = address_pipe
892 # This router handles forwarding using traditional .forward files.
893 # It also allows mail filtering when a forward file starts with the
894 # string "# Exim filter": to disable filtering, uncomment the "filter"
895 # option. The check_ancestor option means that if the forward file
896 # generates an address that is an ancestor of the current one, the
897 # current one gets passed on instead. This covers the case where A is
898 # aliased to B and B has a .forward file pointing to A.
900 # For standard debian setup of one group per user, it is acceptable---normal
901 # even---for .forward to be group writable. If you have everyone in one
902 # group, you should comment out the "modemask" line. Without it, the exim
903 # default of 022 will apply, which is probably what you want.
906 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
911 directory_transport = address_directory
912 domains = +local_domains
913 # filter - I have disabled filtering to force users to use .forward-foo files
914 # or procmail. This will make it easier to move mailers in the future
916 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
917 # also checks if the .forward-bar exists, if not then it uses
918 # .forward-default instead.
919 file = $home/.forward\
920 ${if eq{}{$local_part_suffix}{}{\
921 ${if exists {${home}/.forward${local_part_suffix}} \
922 {${local_part_suffix}}{-default}}\
925 file_transport = address_file
926 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
927 local_part_suffix = -*
928 local_part_suffix_optional
930 pipe_transport = address_pipe
931 reply_transport = address_reply
932 require_files = $home
933 router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
937 debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
941 directory_transport = address_directory
942 domains = +local_domains
943 # filter - I have disabled filtering to force users to use .forward-foo files
944 # or procmail. This will make it easier to move mailers in the future
946 # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
947 # also checks if the .forward-bar exists, if not then it uses
948 # .forward-default instead.
949 file = $home/.forward\
950 ${if eq{}{$local_part_suffix}{}{\
951 ${if exists {${home}/.forward${local_part_suffix}} \
952 {${local_part_suffix}}{-default}}\
955 file_transport = address_file
956 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
957 local_part_suffix = -*
958 local_part_suffix_optional
960 pipe_transport = address_pipe
961 reply_transport = address_reply
962 require_files = $home
965 # This delivers to procmail
967 debug_print = "R: procmail for $local_part@$domain"
970 domains = +local_domains
971 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
974 require_files = $local_part:$home/.procmailrc
975 transport = procmail_pipe
976 transport_current_directory = $home
978 # This driver delivers to the LDAP generated alias file.
980 debug_print = "R: ldap_aliases for $local_part@$domain"
984 data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
985 {${lookup{$local_part}cdb\
986 {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
987 domains = +local_domains
988 file_transport = address_file
989 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
990 pipe_transport = address_pipe
993 # This director matches local user mailboxes.
995 debug_print = "R: localuser for $local_part@$domain"
998 domains = +local_domains
999 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1000 # Disable if the user has never logged in
1001 require_files = $home
1002 transport = local_delivery
1005 # Now we begin the Virtual Domain configuration
1006 # Everything before here should apply only to the local domains with a
1009 # exim4 fails the router if it can't change to the user/group for delivery
1010 # during verification. So we have to seperate the cases of verifying
1011 # the virts, and delivering to them. blah.
1014 if nodeinfo['packagesmaster']
1016 # This router delivers for packages.d.o
1018 debug_print = "R: packages for $local_part@$domain"
1020 file_transport = address_file
1021 pipe_transport = address_pipe
1022 domains = packages.debian.org
1023 require_files = /org/packages.debian.org/conf/maintainer
1024 data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
1025 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1026 transport_home_directory = /org/packages.debian.org/mail
1027 transport_current_directory = /org/packages.debian.org/mail
1029 retry_use_local_part
1038 if nodeinfo['bugsmaster']
1040 # This router delivers for bugs.d.o
1042 debug_print = "R: bugs for $local_part@$domain"
1044 transport = bugs_pipe
1045 domains = bugs.debian.org
1046 cannot_route_message = Unknown or archived bug
1047 require_files = /org/bugs.debian.org/mail/run-procmail
1049 local_parts = ${if match\
1051 {\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}\
1052 {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
1053 {$local_part}fail}}fail}
1061 if nodeinfo['rtmaster']
1063 # This router delivers for rt.d.o
1064 rt_force_new_verbose:
1065 debug_print = "R: rt for $local_part+new@$domain"
1067 domains = rt.debian.org
1068 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1069 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1070 local_part_suffix = +new
1071 pipe_transport = rt_pipe
1072 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}}"
1073 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1075 # FIXME: figure out how to generalize this approach so that all of the following would work
1076 # - rt+NNNN@rt.debian.org : attach correspondence to ticket (verbose)
1077 # - rt+NNNN-quiesce@rt.debian.org : attach correspondence to ticket (quiesce)
1078 # - rt+NNNN-<action>@rt.debian.org : attach correspondence to ticket (some action)
1079 # requires modification to custom condition in \'scrips\'
1080 rt_force_new_quiesce:
1081 debug_print = "R: rt for $local_part+new-quiesce@$domain"
1083 domains = rt.debian.org
1084 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1085 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1086 local_part_suffix = +new-quiesce
1087 pipe_transport = rt_pipe
1088 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}}"
1089 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}\nX-RT-Mode: quiesce"
1092 debug_print = "R: rt for $local_part@$domain"
1094 domains = rt.debian.org
1095 require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1096 local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1097 local_part_suffix = +*
1098 local_part_suffix_optional
1099 pipe_transport = rt_pipe
1100 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}}"
1101 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1108 debug_print = "R: virt_aliases for $local_part@$domain"
1110 data = ${if exists{\
1111 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1112 {${lookup{$local_part}lsearch*{\
1113 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1115 directory_transport = address_directory
1116 cannot_route_message = Unknown user
1117 domains = +virtual_domains
1118 file_transport = address_file
1119 pipe_transport = address_pipe
1120 qualify_preserve_domain
1121 retry_use_local_part
1122 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1123 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1127 debug_print = "R: virt_direct for $local_part@$domain"
1133 directory_transport = address_directory
1134 domains = +virtual_domains
1135 file = $home/.forward-\
1136 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1138 file_transport = address_file
1139 pipe_transport = address_pipe
1140 reply_transport = address_reply
1141 retry_use_local_part
1142 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1143 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1146 # This is a senmailesque alias file lookup
1148 debug_print = "R: virt_aliases for $local_part@$domain"
1152 data = ${if exists{\
1153 ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1154 {${lookup{$local_part}lsearch*{\
1155 ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1157 directory_transport = address_directory
1158 domains = +virtual_domains
1159 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1160 cannot_route_message = Unknown user
1161 group = ${extract{group}{VDOMAINDATA}}
1162 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1163 pipe_transport = address_pipe
1164 qualify_preserve_domain
1165 retry_use_local_part
1166 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1167 transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1169 user = ${extract{user}{VDOMAINDATA}}
1171 # This is a qmailesque deliver into a directory of .forward files
1173 debug_print = "R: virt_direct for $local_part@$domain"
1179 directory_transport = address_directory
1180 domains = +virtual_domains
1181 file = $home/.forward-\
1182 ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1184 file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1185 group = ${extract{group}{VDOMAINDATA}}
1186 headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1188 pipe_transport = address_pipe
1189 reply_transport = address_reply
1190 retry_use_local_part
1191 router_home_directory = ${extract{directory}{VDOMAINDATA}}
1192 transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1194 user = ${extract{user}{VDOMAINDATA}}
1195 #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1197 ######################################################################
1198 # TRANSPORTS CONFIGURATION #
1199 ######################################################################
1200 # ORDER DOES NOT MATTER #
1201 # Only one appropriate transport is called for each delivery. #
1202 ######################################################################
1207 # This transport is used for local delivery to user mailboxes. On debian
1208 # systems group mail is used so we can write to the /var/mail
1209 # directory. (The alternative, which most other unixes use, is to deliver
1210 # as the user's own group, into a sticky-bitted directory)
1213 file = /var/mail/${local_part}
1216 no_mode_fail_narrower
1219 # This transport is used for handling pipe addresses generated by alias
1220 # or .forward files. It has a conventional name, since it is not actually
1221 # mentioned elsewhere in this configuration file. (A different name *can*
1222 # be specified via the "address_pipe_transport" option if you really want
1223 # to.) If the pipe generates any standard output, it is returned to the sender
1224 # of the message as a delivery error. Set return_fail_output instead if you
1225 # want this to happen only when the pipe fails to complete normally.
1229 current_directory = ${home}
1230 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1231 EXT=${substr_1:${local_part_suffix}}:\
1232 LOCAL=${local_part}${local_part_suffix}:\
1233 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1237 # This transport is used for handling file addresses generated by alias
1238 # or .forward files. It has a conventional name, since it is not actually
1239 # mentioned elsewhere in this configuration file.
1249 directory_mode = 0770
1250 mode_fail_narrower = false
1252 # This transport is used for handling file addresses generated by alias
1253 # or .forward files if the path ends in "/", which causes it to be treated
1254 # as a directory name rather than a file name. Each message is then delivered
1255 # to a unique file in the directory. If instead you want all such deliveries to
1256 # be in the "maildir" format that is used by some other mail software,
1257 # uncomment the final option below. If this is done, the directory specified
1258 # in the .forward or alias file is the base maildir directory.
1260 # Should you want to be able to specify either maildir or non-maildir
1261 # directory-style deliveries, then you must set up yet another transport,
1262 # called address_directory2. This is used if the path ends in "//" so should
1263 # be the one used for maildir, as the double slash suggests another level
1264 # of directory. In the absence of address_directory2, paths ending in //
1265 # are passed to address_directory.
1275 # This transport is used for handling autoreplies generated by the filtering
1276 # option of the forwardfile director. It has a conventional name, since it
1277 # is not actually mentioned elsewhere in this configuration file.
1281 # This transport is used for delivering messages over SMTP connections.
1285 connect_timeout = 1m
1288 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1289 out = " tls_certificate = /etc/exim4/ssl/thishost.crt
1290 tls_privatekey = /etc/exim4/ssl/thishost.key"
1297 if not nodeinfo['smarthost'].empty?
1299 remote_smtp_smarthost:
1300 debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
1303 out += nodeinfo['smarthost_port'].to_s + "\n"
1304 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1305 out += ' tls_tempfail_tryclear = false
1306 tls_certificate = /etc/exim4/ssl/thishost.crt
1307 tls_privatekey = /etc/exim4/ssl/thishost.key
1314 # Send the message to procmail
1317 command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1319 user = ${local_part}
1328 user = ${extract{user}{\
1329 ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1335 if nodeinfo['bugsmaster']
1339 command = /org/bugs.debian.org/mail/run-procmail
1340 environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1341 EXT=${substr_1:${local_part_suffix}}:\
1342 LOCAL=${local_part}${local_part_suffix}:\
1343 RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1354 if nodeinfo['rtmaster']
1357 debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1360 environment = EXTENSION=${substr_1:${local_part_suffix}}
1361 allow_commands = /usr/bin/rt-mailgate
1367 ######################################################################
1368 # RETRY CONFIGURATION #
1369 ######################################################################
1371 # This single retry rule applies to all domains and all errors. It specifies
1372 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1373 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1374 # hours, then retries every 8 hours until 4 days have passed since the first
1377 # Domain Error Retries
1378 # ------ ----- -------
1383 debian.org * F,2h,10m; G,16h,2h,1.5; F,14d,8h
1384 * * senders=: F,2h,10m
1385 * rcpt_4xx F,2h,5m; F,4h,10m; F,4d,15m
1386 * * F,2h,15m; G,16h,2h,1.5; F,4d,8h
1388 # End of Exim 4 configuration