make it easier to exclude some checks based on profile; whitespace tidy
[mirror/dsa-puppet.git] / modules / exim / templates / eximconf.erb
1 ##
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
4 ##
5
6 # This is the main exim4 configuration file based on the 28.08.05 version by
7 # ametzler
8
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.
12
13 # This configuration file brings in the necessary information from
14 # other databases stored in /etc/exim/ and the files distributed by ud-ldap
15
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 
18 # settings.
19
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
25 #           permitted.
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 #  relayhosts - Hostnames that can send any arbitarily addressed mail to
31 #           us. This is primarily only usefull for emergancy 'queue
32 #           flushing' operations, but should be populated with a list
33 #           of trusted machines. Wildcards are not permitted
34 #  bsmtp_domains - Domains that we deliver locally via bsmtp
35 <%=
36 out = ""
37 if nodeinfo['mailrelay']
38   out = '
39 #  mailhubdomains - Domains for which we are the MX, but the mail is relayed
40 #           elsewhere.  This is designed for use with small volume or
41 #           restricted machines that need to use a smarthost for mail
42 #           traffic.  We will relay for them based on ssl cert validation
43 #           but we need to teach exim how to route the mail to them.  This is
44 #           that list.
45 '
46 end
47 out
48 %>
49 # Exim's wildcard mechanism is a bit odd in that to say "any address in
50 # debian.org including debian.org" you must use two patterns,
51 #   *.debian.org
52 #   debian.org
53 # Also you can only place a * before a . and as the first char in a string.
54 # Wildcards always match last so they may be used as a catchall.
55
56 # Further details can be found in each of the files.
57
58 # Usefull exim commands:
59 #  exim4 -qf  - Try sending all messages right now, including frozen ones
60 #  exim4 -bt foo@blah - Write what exim would do if it saw the address
61 #                      Great for testing virtual domains and forward files
62
63 # Special Features for users:
64 # .forward-foo - is understood as an extension address for bar-foo@cow.com
65 # .forward-default - is understood to be a catch all for bar-*@cow.com
66 # .procmailrc - with no .forward file invokes procmail for delivery
67 #               automatically.
68
69 # For virtual domains the first lookup is done against a linear text
70 # database called 'aliases', then .forward files are consulted. Exim
71 # filtering is available for these .forward files only. .forward-default
72 # is the universal catch all for everything not handled.
73
74 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
75 # will trigger things like rcpt to rate limiting or possibly a reject if
76 # enough hits are triggered.
77 #
78 # value is stored in acl_c_scr
79
80 ######################################################################
81 #                    MAIN CONFIGURATION SETTINGS                     #
82 ######################################################################
83
84 <%=
85 out=''
86 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
87   out = "
88 perl_startup = do '/etc/exim4/exim_surbl.pl'
89 "
90 end
91 out
92 %>
93
94 # These options specify the Access Control Lists (ACLs) that
95 # are used for incoming SMTP messages - after the RCPT and DATA
96 # commands, respectively.
97
98 acl_smtp_helo = check_helo
99 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
100 acl_smtp_data = check_message
101 <%=
102 out=''
103 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
104   out = "acl_smtp_mime = acl_check_mime"
105 end
106 out
107 %>
108 acl_smtp_predata = acl_check_predata
109
110 # accept domain literal syntax in e-mail addresses. To actually make use of
111 # this a router is also required
112 allow_domain_literals = true
113
114 # This setting defines a named domain list called
115 # local_domains. It will be referenced
116 # later on by the syntax "+local_domains".
117 # Other domain and host lists may follow.
118 # @ is the local FQDN, @[] matches the IP adress of any local interface.
119
120 domainlist local_domains = @ : \
121     @[] : \
122     localhost : \
123     ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
124
125 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
126
127 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
128
129 domainlist bsmtp_domains = ${if exists {/etc/exim4/bsmtp}{partial-lsearch;/etc/exim4/bsmtp}{}}
130
131 domainlist handled_domains = +local_domains : +virtual_domains : +bsmtp_domains
132
133 localpartlist local_only_users = lsearch;/etc/exim4/localusers
134
135 localpartlist postmasterish = postmaster : abuse : hostmaster : root
136
137 # Domains we relay for; that is domains that aren't considered local but we 
138 # accept mail for them.
139 hostlist debianhosts = 127.0.0.1 : /var/lib/misc/thishost/debianhosts
140 <%=
141 out = ""
142 if nodeinfo['mailrelay']
143   out = '
144 domainlist mailhubdomains = lsearch;/etc/exim4/manualroute
145 '
146 end
147 out
148 %>
149
150 hostlist reservedaddrs = <%= nodeinfo['reservedaddrs'] %>
151
152 <%= out = ""
153 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
154 out = "tls_certificate = /etc/exim4/ssl/thishost.crt
155 tls_privatekey = /etc/exim4/ssl/thishost.key
156 tls_try_verify_hosts = *
157 tls_verify_certificates = /etc/exim4/ssl/ca.crt
158 tls_crl = /etc/exim4/ssl/ca.crl"
159 end
160 out
161 %>
162
163 # The setting below causes Exim to do a reverse DNS lookup on all incoming
164 # IP calls, in order to get the true host name. If you feel this is too
165 # expensive, you can specify the networks for which a lookup is done, or
166 # remove the setting entirely.
167 host_lookup = *
168 # dns_ipv4_lookup = !localhost (disabled upon sgrans request, zobel, 2010-03-16)
169
170 # If this option is set, then any process that is running as one of the
171 # listed users may pass a message to Exim and specify the sender's
172 # address using the "-f" command line option, without Exim's adding a
173 # "Sender" header.
174
175 untrusted_set_sender = *
176
177 # Some operating systems use the "gecos" field in the system password file
178 # to hold other information in addition to users' real names. Exim looks up
179 # this field when it is creating "sender" and "from" headers. If these options
180 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
181 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
182 # by the pattern.
183
184 gecos_pattern = ^([^,:]*)
185 gecos_name = $1
186
187 # This tells exim to immediately discard error messages (ie double bounces).
188 ignore_bounce_errors_after = 0s
189 auto_thaw = 1d
190 timeout_frozen_after=14d
191
192 message_size_limit = 100M
193 message_logs = false
194 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
195 <% if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty? %>
196 smtp_accept_max = 300
197 smtp_accept_queue = 200
198 smtp_accept_queue_per_connection = 50
199 smtp_accept_reserve = 25
200 <% else %>
201 smtp_accept_max = 30
202 smtp_accept_queue = 20
203 smtp_accept_queue_per_connection = 10
204 smtp_accept_reserve = 5
205 <% end %>
206 smtp_reserve_hosts = +debianhosts
207
208 split_spool_directory = true
209 check_spool_inodes = 200
210 check_spool_space  = 20M
211
212 delay_warning =
213
214 <% if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty? %>
215 queue_run_max = 50
216 deliver_queue_load_max = 50
217 queue_only_load = 35
218 smtp_load_reserve = 20
219 <% else %>
220 queue_run_max = 5
221 deliver_queue_load_max = 10
222 queue_only_load = 5
223 <% end %>
224 queue_list_requires_admin = false
225
226 <%= out  = ""
227 if has_variable?("clamd") && clamd == "true"
228   out = "av_scanner = clamd:/var/run/clamav/clamd.ctl"
229 end
230 out
231 %>
232
233 <%= 
234 ports = []
235 out = "daemon_smtp_ports = "
236 ports << 25
237
238 if nodeinfo['bugsmaster'] or nodeinfo['bugsmx']
239   ports << 587
240 end
241
242 if not nodeinfo['mail_port'].to_s.empty?
243   ports << nodeinfo['mail_port']
244 end
245
246 if nodeinfo['mailrelay']
247   ports << nodeinfo['smarthost_port']
248 end
249
250 out += ports.uniq.sort.join(" : ")
251 out
252 %>
253
254 admin_groups = adm
255 remote_sort_domains = *.debian.org:*.debian.net
256
257 pipelining_advertise_hosts = !*
258 <%= out = ""
259 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
260 out = 'tls_advertise_hosts = *'
261 end
262 out
263 %>
264 smtp_enforce_sync = true
265
266 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
267
268 received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}\
269                                  {${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}\
270                                  ${if and {{eq {$tls_certificate_verified}{1}}{def:tls_peerdn}}{from $tls_peerdn (verified)\n\t}}\
271                                  by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}\
272                                  (Exim $version_number)\n\t\
273                                  ${if def:sender_address {(envelope-from <$sender_address>)\n\t}}\
274                                  id $message_exim_id${if def:received_for {\n\tfor $received_for}}
275
276 # macro definitions.
277 # Do not wrap!
278 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
279 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
280                ${if exists {/srv/$domain/mail/whitelist}{\
281                 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
282                 }{}}\
283                }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
284 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
285                        {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
286                        {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
287                        {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
288                        ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
289 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
290
291 ######################################################################
292 #                        ACL CONFIGURATION                           #
293 ######################################################################
294 begin acl
295
296 acl_spamlovers:
297   # There are a few profiles that don't want much smtp time checking of
298   # mail.  It's easier to track them in one place
299
300   accept  condition      = ${if eq {$acl_m_prf}{PopconMail}}
301   accept  condition      = ${if eq {$acl_m_prf}{BugsMail}}
302   deny
303
304 acl_getprofile:
305   # This is a bad hack to reset the variable, by defining it be something
306   # never referenced.
307
308   warn    set acl_m_rprf = $acl_m_undefined
309
310   warn    recipients     = survey@popcon.debian.org
311           set acl_m_rprf = PopconMail
312
313   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
314
315   warn    local_parts    = +local_only_users
316           domains        = +local_domains
317           hosts          = !+debianhosts
318           set acl_m_rprf = localonly
319
320   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
321
322 <%=
323 out=''
324 if nodeinfo['rtmaster']
325   out='
326   warn    domains        = rt.debian.org
327           set acl_m_rprf = RTMail
328
329   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
330 '
331 end
332 out
333 %>
334 <%=
335 out = ''
336 if nodeinfo['bugsmaster']
337   out = '
338   warn    domains        = bugs.debian.org
339           set acl_m_rprf = BugsMail
340
341   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
342 '
343 end
344 out
345 %>
346 <%=
347 out = ''
348 if nodeinfo['packagesmaster']
349   out = '
350   warn    domains        = packages.debian.org
351           set acl_m_rprf = PackagesMail
352
353   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
354 '
355 end
356 out
357 %>
358 <%=
359 out = ''
360 if nodeinfo['packagesqamaster']
361   out='
362   warn    recipients     = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
363           set acl_m_rprf = PTSOwner
364
365   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
366
367   warn    senders        = :
368           domains        = packages.qa.debian.org
369           condition      = ${if match{$local_part}{\N^bounces+\N}}
370           set acl_m_rprf = PTSListBounce
371
372   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
373
374   warn    domains        = packages.qa.debian.org
375           set acl_m_rprf = PTSMail
376
377   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
378 '
379 end
380 out
381 %>
382   warn    recipients     = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
383           set acl_m_rprf = DBSignedMail
384
385   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
386
387   warn    domains        = +virtual_domains
388           condition      = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/contentinspectionaction}}}}
389           condition      = ${if eq{${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/contentinspectionaction}}}{$value}{}}}{markup}}
390           log_message    = $local_part@$domain: markup
391           set acl_m_rprf = markup
392
393   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
394
395   warn    condition      = ${if eq{${lookup{$local_part}cdb{/var/lib/misc/${primary_hostname}/mail-contentinspectionaction.cdb}{$value}{}}}{markup}}
396           log_message    = $local_part@$domain: markup
397           set acl_m_rprf = markup
398
399   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
400
401   warn    condition      = ${if eq{${lookup{$local_part}cdb{/var/lib/misc/${primary_hostname}/mail-contentinspectionaction.cdb}{$value}{}}}{blackhole}}
402           log_message    = $local_part@$domain: blackhole
403           set acl_m_rprf = blackhole
404
405   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
406
407   warn    domains        = +virtual_domains
408           condition      = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/contentinspectionaction}}}}
409           condition      = ${if eq{${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/contentinspectionaction}}}{$value}{}}}{blackhole}}
410           log_message    = $local_part@$domain: blackhole
411           set acl_m_rprf = blackhole
412
413   accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
414
415   warn    set acl_m_rprf = normal
416
417   accept
418
419 check_helo:
420
421   warn    set acl_c_scr    = 0
422
423 <%= 
424 out = ""
425 if nodeinfo['mailrelay']
426   out = "  accept  verify   = certificate"
427 end
428 out
429 %>
430
431 <%= 
432 if nodeinfo['smarthost'].empty?
433   out = '
434   # These are in HELO acl so that they are only run once.  They increment a counter,
435   # so we don\'t want it to increment per rcpt to.
436
437   warn    dnslists       = list.dnswl.org&0.0.0.3
438           log_message    = Hit on list.dnswl.org for $sender_host_address
439           set acl_c_scr  = ${eval:$acl_c_scr-30}
440
441   warn    dnslists       = list.dnswl.org&0.0.0.2
442           log_message    = Hit on list.dnswl.org for $sender_host_address
443           set acl_c_scr  = ${eval:$acl_c_scr-20}
444
445   warn    dnslists       = list.dnswl.org
446           log_message    = Hit on list.dnswl.org for $sender_host_address
447           set acl_c_scr  = ${eval:$acl_c_scr-10}
448
449   warn    condition      = ${if isip {$sender_helo_name}{true}{false}}
450           log_message    = remote host used IP address in HELO/EHLO greeting
451           set acl_c_scr  = ${eval:$acl_c_scr+20}
452
453   warn    !hosts         = +debianhosts
454           condition      = ${if eq{$host_lookup_failed}{1}}
455           set acl_c_scr  = ${eval:$acl_c_scr+20}
456
457   warn    !hosts         = +debianhosts
458           condition      = ${if eq{$host_lookup_failed}{0}}
459           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}}
460           set acl_c_scr  = ${eval:$acl_c_scr+20}
461
462   warn    !hosts         = +debianhosts
463           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}}
464           set acl_c_scr  = ${eval:$acl_c_scr+20}
465
466   warn    !hosts         = +debianhosts
467           dnslists       = dul.dnsbl.sorbs.net
468           set acl_c_scr  = ${eval:$acl_c_scr+15}
469
470   # If the sender\'s helo name is empty, the message will be rejected later
471   # because the helo is empty.  If the rDNS lookup failed, we are already
472   # going to greylist them, so no sense worrying about it here.  Finally,
473   # if rDNS does not match helo name (both lower cased first), greylist.
474
475   warn    !hosts         = +debianhosts
476           condition      = ${if eq {$host_lookup_failed}{1}{no}{yes}}
477           condition      = ${if def:sender_helo_name {yes}{no}}
478           condition      = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
479           log_message    = HELO doesn\'t match rDNS
480           set acl_c_scr  = ${eval:$acl_c_scr+8}
481
482   # Regexes of doom
483   # matches 098325879 - looks fishy
484
485   warn condition        = ${if and { \
486                                      { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
487                                      { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
488                                     } \
489                             }
490        log_message      = non-FQDN HELO
491        set acl_c_scr    = ${eval:$acl_c_scr+12}
492
493   # Matches DOMAIN99.com - looks bad
494
495   warn condition       = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
496        log_message     = SHOUTING HELO
497        set acl_c_scr   = ${eval:$acl_c_scr+7}
498
499   # Random HELO (run of 7 consonants) (constructed by viruses).  We purposefully
500   # skip matching on machines named .*smtp.*, since that\'s 4 already.  This is a fairly
501   # naive test, so it\'s not worth much
502
503   warn condition       = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
504        condition       = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
505        condition       = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
506        log_message     = random HELO
507        set acl_c_scr   = ${eval:$acl_c_scr+5}
508 '
509 else
510   out = '
511   drop !hosts          = +debianhosts
512        log_message     = mail from non-d.o host
513        message         = Interesting.  I doubt that should have happened.
514 '
515 end
516 out
517 %>
518
519   # Implicit, but simpler to just say it
520   accept
521
522 #!!# ACL that is used after the RCPT command on the submission port
523 check_submission:
524
525   # Accept if the source is local SMTP (i.e. not over TCP/IP).
526   # We do this by testing for an empty sending host field.
527   accept  hosts = : 127.0.0.1
528
529 <%= 
530 out = ""
531 if nodeinfo['mailrelay']
532   out = "  accept  verify   = certificate"
533 end
534 out
535 %>
536
537   # Defer after too many bad RCPT TO's.  Legit MTAs will retry later.
538   # This is a rough pass at preventing addres harvesting or other mail blasts.
539
540   defer  log_message   = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
541          message       = Too many bad recipients, try again later
542          condition     = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
543
544   defer
545           ratelimit      = 5 / 60m / per_rcpt / $sender_host_address
546           !hosts         = +debianhosts
547           message        = sorry, only 5 reports per hour for submission
548
549   accept  domains  = +local_domains
550           hosts    = +debianhosts
551           endpass
552           verify   = recipient
553
554 <%=
555 out = ""
556 if nodeinfo['mailrelay']
557   out = '
558   accept  domains  = +mailhubdomains
559           endpass
560           verify   = recipient/callout=30s,defer_ok,use_sender,no_cache
561 '
562 end
563 out
564 %>
565
566   accept  domains  = +submission_domains
567           endpass
568           verify   = recipient
569
570   deny    message = relay not permitted
571
572 #!!# ACL that is used after the RCPT command
573 check_recipient:
574
575 <%=
576 out = ""
577 if nodeinfo['mailrelay']
578   out = "  accept  verify   = certificate"
579 end
580 out
581 %>
582
583   warn    acl           = acl_getprofile
584           condition     = ${if eq{$acl_m_prf}{}}
585           set acl_m_prf = $acl_m_rprf
586
587   defer   condition     = ${if eq{$acl_m_prf}{$acl_m_rprf}{no}{yes}}
588           log_message   = Only one profile at a time, please
589
590   # Defer after too many bad RCPT TO's.  Legit MTAs will retry later.
591   # This is a rough pass at preventing addres harvesting or other mail blasts.
592
593   defer  log_message   = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
594          !acl          = acl_spamlovers
595          message       = Too many bad recipients, try again later
596          !hosts        = +debianhosts
597          condition     = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
598
599   # Dump spambots that are so stupid they say helo as our IP address
600
601   drop   !hosts        = +debianhosts
602          !acl          = acl_spamlovers
603          condition     = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
604          message       = HELO mismatch Forged HELO for ($sender_helo_name)
605
606   # Also for spambots that say helo as us or one of our domains
607
608   drop   !hosts        = +debianhosts
609          !acl          = acl_spamlovers
610          condition     = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
611          condition     = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
612          message       = HELO mismatch Forged HELO for ($sender_helo_name)
613
614   # This logic gives you a list of commonly forged domains in helo to reject against
615
616   warn set acl_m_frg   = ${lookup{$sender_helo_name} \
617                            nwildlsearch{/etc/exim4/helo-check} \
618                           {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
619
620   # This is a failsafe in case DNS fails - we defer instead of hard reject if they 
621   # say helo as a name in the list but we can't look them up
622
623   defer  !hosts        = +debianhosts
624          !acl          = acl_spamlovers
625          condition     = ${if eq{$acl_m_frg}{}{no}{yes}}
626          condition     = ${if eq{$sender_host_name}{}{yes}{no}}
627          condition     = ${if eq{$host_lookup_failed}{1}{no}{yes}}
628          message       = Access temporarily denied. Resolve failed PTR for $sender_host_address
629
630   # If DNS works, go ahead and reject them
631
632   drop   !hosts        = +debianhosts
633          !acl          = acl_spamlovers
634          condition     = ${if and { {!eq{$acl_m_frg}{}}{!match{$sender_host_name}{${rxquote:$acl_m_frg}\N$\N}}}{yes}{no}}
635          message       = HELO mismatch Forged HELO for ($sender_helo_name)
636
637   # disabled accounts don't even get local mail.
638   deny   local_parts   = lsearch;/var/lib/misc/$primary_hostname/mail-disable
639          domains       = +local_domains
640          message       = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
641
642   deny   domains       = +virtual_domains
643          local_parts   = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
644                                      {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
645                                      {}}
646          hosts         = !+debianhosts
647          message       = mail for <$local_part@$domain> only accepted from debian.org machines
648   # Accept if the source is local SMTP (i.e. not over TCP/IP).
649   # We do this by testing for an empty sending host field.
650   accept  hosts = :
651   
652   deny    domains       = +handled_domains
653           local_parts   = ^[.] : ^.*[@%!/|]
654   
655   deny    domains       = !+handled_domains
656           local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
657
658 # forwards mail to @d.o address, even if it's a bounce from master, no reply
659 # from source address; rejecting all mail now.
660   deny    recipients    = mendoza@debian.org
661           hosts         = 65.110.39.147 : 64.39.31.15
662           message       = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
663
664   deny    condition     = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
665           sender_domains= +local_domains : debian.org : debian.net : debian.com
666           hosts         = !+debianhosts
667           message       = mail from <$sender_address> not allowed externally
668
669   deny    condition     = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
670           condition     = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
671           condition     = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
672           message       = no mail should ever come from <$sender_address>
673
674   warn    condition     = ${if eq{$acl_m_prf}{localonly}}
675           set acl_m_lrc = ${if eq{$acl_m_lrc}{}{$local_part@$domain}{$acl_m_lrc, $local_part@$domain}}
676
677 <%=
678 out=''
679 if 0 == 1:
680 out='
681   deny    message  = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
682           hosts    = !+debianhosts
683           dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
684 '
685 end
686 out
687 %>
688 <%=
689 out=''
690 if nodeinfo['packagesmaster']
691   out='
692   warn    condition      = ${if eq {$acl_m_prf}{PackagesMail}}
693           condition      = ${if eq {$sender_address}{$local_part@$domain}}
694           message        = X-Packages-FromTo-Same: yes
695 '
696 end
697 out
698 %>
699   deny    condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
700           !verify        = sender
701
702   defer   !hosts         = +debianhosts
703           condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
704           condition      = ${if >{${eval:$acl_c_scr+0}}{0}}
705           ratelimit      = 10 / 60m / per_rcpt / $sender_host_address
706           message        = slow down (no reverse dns, mismatched ehlo, dialup, or in blacklists)
707 <%=
708 out = ""
709 if has_variable?("policydweight") && policydweight == "true"
710 out = '
711   # Check with policyd-weight - this only works with a version after etch\'s,
712   # sadly.  etch\'s version attempts to hold the socket open, since that\'s what
713   # postfix expects.  Exim, on the other hand, expects the remote side to close
714   # the socket when it\'s finished sending data, so it see each transaction as
715   # an incomplete read.  I\'m sure there\'s a way we could force exim to do
716   # something sick and clever to force either the interpretation or the socket
717   # closure, but I\'m fairly sure it\'s now worth it, since the backport of
718   # policyd-weight is trivial.
719   warn  !hosts         = +debianhosts
720         condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
721         set acl_m_pw   = ${readsocket{inet:127.0.0.1:12525}\
722                           {request=smtpd_access_policy\n\
723                            protocol_state=RCPT\n\
724                            protocol_name=${uc:$received_protocol}\n\
725                            helo_name=$sender_helo_name\n\
726                            queue_id=$message_exim_id\n\
727                            sender=$sender_address\n\
728                            recipient=$local_part@$domain\n\
729                            recipient_count=$rcpt_count\n\
730                            client_address=$sender_host_address\n\
731                            client_name=$sender_host_name\n\
732                            reverse_client_name=$sender_host_name\n\
733                            instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
734                           {20s}{\n}{socket failure}}
735
736   # Defer on socket error
737   defer !hosts         = +debianhosts
738         condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
739         condition      = ${if eq{$acl_m_pw}{socket failure}{yes}{no}}
740         message        = Cannot connect to policyd-weight. Please try again later.
741
742   # Set proposed action to $acl_m_act and message to $acl_m_mes
743   warn  !hosts         = +debianhosts
744         condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
745         set acl_m_mes  = ${extract{action}{$acl_m_pw}}
746         set acl_m_act  = ${sg{$acl_m_pw}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
747
748   # Add X-policyd-weight header line to message
749   warn  !hosts         = +debianhosts
750         condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
751         message        = $acl_m_mes
752         condition      = ${if eq{$acl_m_act}{PREPEND}{yes}{no}}
753
754   # Write log message, if policyd-weight can\'t run checks
755   warn  !hosts         = +debianhosts
756         condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
757         log_message    = policyd-weight message: $acl_m_mes
758         condition      = ${if eq{$acl_m_act}{DUNNO}{yes}{no}}
759
760   # Deny mails which policyd-weight thinks are spam
761   deny  !hosts         = +debianhosts
762         condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
763         message        = policyd-weight said: $acl_m_mes
764         condition      = ${if eq{$acl_m_act}{550}{yes}{no}}
765
766   # Defer messages when policyd-weight suggests so.
767   defer  !hosts         = +debianhosts
768          condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
769          message        = policyd-weight said: $acl_m_mes
770          condition      = ${if eq{$acl_m_act}{450}{yes}{no}}
771 '
772 end
773 out
774 %>
775 <%=
776 out=''
777 if nodeinfo['rtmaster']
778   out='
779   warn    condition     = ${if eq{$acl_m_prf}{RTMail}}
780           set acl_m12   = ${if def:acl_m12 {$acl_m12} {${if or{{match{$local_part}{\N[^+]+\+\d+\N}}{match{$local_part}{\N[^+]+\+new\N}}} {RTMailRecipientHasSubaddress}}}}
781 '
782 end
783 out
784 %>
785 <%=
786 out = ""
787 if has_variable?("greylistd") && greylistd == "true"
788   out = '
789   defer
790     message  = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
791     log_message = greylisted.
792     local_parts    = ${if match_domain{$domain}{+virtual_domains}\
793                      {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
794                      {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
795                      {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
796                      ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
797     !senders       = :
798     !hosts         = : +debianhosts : WHITELIST : \
799                      ${if exists {/etc/greylistd/whitelist-hosts}\
800                                  {/etc/greylistd/whitelist-hosts}{}} : \
801                      ${if exists {/var/lib/greylistd/whitelist-hosts}\
802                                  {/var/lib/greylistd/whitelist-hosts}{}} 
803     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
804     !authenticated = *
805     domains        = +handled_domains
806     condition      = ${readsocket{/var/run/greylistd/socket}\
807                                  {--grey \
808                                   $sender_host_address \
809                                   $sender_address \
810                                   $local_part@$domain}\
811                                  {5s}{}{false}}
812 '
813 elsif has_variable?("postgrey") && postgrey == "true"
814   out = '
815   # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
816   # this adds acl_m_grey if there isn\'t one (so unique per message)
817   warn
818     !senders       = :
819     !hosts         = : +debianhosts : WHITELIST
820     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
821     condition      = ${if def:acl_m_grey {no}{yes}}
822     set acl_m_grey = $pid.$tod_epoch.$sender_host_port
823
824   # and defers the message if postgrey thinks it should be defered ...
825   defer
826     !senders       = :
827     !hosts         = : +debianhosts : WHITELIST
828     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
829     !authenticated = *
830     domains        = +handled_domains
831     local_parts    = GREYLIST_LOCAL_PARTS
832     set acl_m_pgr  = request=smtpd_access_policy\n\
833                      protocol_state=RCPT\n\
834                      protocol_name=${uc:$received_protocol}\n\
835                      instance=${acl_m_grey}\n\
836                      helo_name=${sender_helo_name}\n\
837                      client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
838                      client_name=${sender_host_name}\n\
839                      sender=${sender_address}\n\
840                      recipient=$local_part@$domain\n\n
841     set acl_m_pgr  = ${sg{\
842                          ${readsocket{/var/run/postgrey/socket}{$acl_m_pgr}\
843                                {5s}{}{action=DUNNO}}\
844                      }{action=}{}}
845     message        = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
846     log_message    = greylisted.
847     condition      = ${if eq{${uc:${substr{0}{5}{$acl_m_pgr}}}}{DEFER}}
848
849  # ... or adds a header with information about how long the delay was
850  warn
851     !senders       = :
852     !hosts         = : +debianhosts : WHITELIST
853     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
854     !authenticated = *
855     domains        = +handled_domains
856     local_parts    = GREYLIST_LOCAL_PARTS
857     condition      = ${if eq{${uc:${substr_0_7:$acl_m_pgr}}}{PREPEND}}
858     message        = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
859 '
860 end
861 out
862 %>
863
864   accept  local_parts   = +postmasterish
865           domains       = +handled_domains
866
867   deny    hosts        = ${if exists{/etc/exim4/host_blacklist}{/etc/exim4/host_blacklist}{}}
868           message      = I'm terribly sorry, but it seems you have been blacklisted
869           log_message  = blacklisted IP
870
871   deny   log_message   = <$sender_address> is blacklisted
872          senders       = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
873          message       = We have blacklisted <$sender_address>.  Please stop mailing us
874
875 <%= 
876 out = ""
877 if nodeinfo['smarthost'].empty?
878   out = '
879   deny    message  = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
880           dnslists = ${if match_domain{$domain}{+virtual_domains}\
881                      {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
882                      {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
883                      {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
884                      ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
885           domains       = +handled_domains
886           !hosts        = +debianhosts : WHITELIST
887 '
888 end
889 out
890 %>
891
892   deny    message  = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
893           dnslists = ${if match_domain{$domain}{+virtual_domains}\
894                      {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
895                      {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
896                      {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
897                      ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
898           domains       = +handled_domains
899           !hosts        = +debianhosts : WHITELIST
900
901 <%= 
902 out = ""
903 if nodeinfo['smarthost'].empty?
904   out = '
905   deny    domains  = +handled_domains
906           local_parts   = ${if match_domain{$domain}{+virtual_domains}\
907                            {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
908                            {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
909                            {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
910                            ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
911           !hosts   = +debianhosts : WHITELIST
912           !verify  = sender/callout=90s,maxwait=300s
913 '
914 end
915 out
916 %>
917
918 <%=
919 out = ""
920 if nodeinfo['mailrelay']
921   out = '
922   accept  domains  = +mailhubdomains
923           endpass
924           verify   = recipient/callout=30s,defer_ok,use_sender,no_cache
925 '
926 end
927 out
928 %>
929   accept  domains  = +handled_domains
930           endpass
931           verify   = recipient/defer_ok
932
933   accept  hosts         = +debianhosts
934
935   accept  authenticated = *
936
937   deny    message = relay not permitted
938
939 <%=
940 out=''
941 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
942 out='
943 acl_check_mime:
944
945  discard condition     = ${if <{$message_size}{256000}}
946          condition     = ${if eq {$acl_m_prf}{blackhole}}
947          set acl_m_srb = ${perl{surblspamcheck}}
948          condition     = ${if eq{$acl_m_srb}{false}{no}{yes}}
949          log_message   = discarded surbl message for $recipients
950
951   deny   condition     = ${if <{$message_size}{256000}}
952          condition     = ${if eq {$acl_m_prf}{markup}{no}{yes}}
953          condition     = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
954          set acl_m_srb = ${perl{surblspamcheck}}
955          condition     = ${if eq{$acl_m_srb}{false}{no}{yes}}
956          log_message   = $acl_m_srb
957          message       = $acl_m_srb
958
959   warn   condition     = ${if <{$message_size}{256000}}
960          condition     = ${if eq {$acl_m_prf}{markup}}
961          set acl_m_srb = ${perl{surblspamcheck}}
962          condition     = ${if eq{$acl_m_srb}{false}{no}{yes}}
963          message       = X-Surbl-Hit: $primary_hostname: $acl_m_srb
964
965   accept
966 '
967 end
968 out
969 %>
970
971 acl_check_predata:
972   deny   condition     = ${if eq{$acl_m_prf}{localonly}}
973          message       = mail for $acl_m_lrc is only accepted internally
974
975   accept
976
977
978 #!!# ACL that is used after the DATA command
979 check_message:
980 <%=
981 out=''
982 if nodeinfo['rtmaster']
983   out='
984   deny    condition = ${if eq {$acl_m_prf}{RTMail}}
985           condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
986                                {!match {${lc:$rh_Subject:]}} {\N\[rt.debian.org \N}} \
987                                {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
988           message  = messages to the Request Tracker system require a subject tag or a subaddress
989 '
990 end
991 out
992 %>
993 <%=
994 out=''
995 if nodeinfo['packagesqamaster']
996   out='
997   deny    !hosts  = +debianhosts : 217.196.43.134
998           condition = ${if eq {$acl_m_prf}{PTSMail}}
999           condition = ${if def:h_X-PTS-Approved:{false}{true}}
1000           message   = messages to the PTS require an X-PTS-Approved header
1001 '
1002 end
1003 out
1004 %>
1005   deny    condition      = ${if eq {$acl_m_prf}{DBSignedMail}}
1006           condition      = ${if and {{!match {$message_body}{PGP MESSAGE}}              \
1007                                      {!match {$message_body}{PGP SIGNED MESSAGE}}       \
1008                                      {!match {$message_body}{PGP SIGNATURE}}            \
1009                                      {!match {$header_content-type:}{multipart/signed}} \
1010                                      {!match {$header_content-type:}{pgp}}              \
1011                                     }                                                   \
1012                             }
1013           message        = Mail to this address needs to be PGP-signed
1014
1015   accept verify  = certificate
1016
1017   deny    condition = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
1018           !verify   = header_syntax
1019           message   = Invalid syntax in the header
1020
1021 # RFC 822 and 2822 say that headers must be ASCII.  This kinda emulates
1022 # postfix's strict_7bit_headers option, but only checks a few common problem
1023 # headers, as there doesn't appear to be an easy way to check them all.
1024   deny
1025           condition       = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
1026                                  {match {$rh_To:}{[\200-\377]}}\
1027                                  {match {$rh_From:}{[\200-\377]}}\
1028                                  {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
1029           condition       = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
1030           message         = improper use of 8-bit data in message header: message rejected
1031
1032   deny
1033           condition       = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
1034           condition       = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
1035           message         = Your mailer is not RFC 2047 compliant: message rejected
1036
1037 <%=
1038 out = ""
1039 if has_variable?("clamd") && clamd == "true"
1040 out = '
1041   discard condition       = ${if eq {$acl_m_prf}{blackhole}}
1042           demime          = *
1043           malware         = */defer_ok
1044           log_message     = discarded malware message for $recipients
1045
1046   deny    condition       = ${if eq {$acl_m_prf}{markup}{no}{yes}}
1047           condition       = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
1048           demime          = *
1049           malware         = */defer_ok
1050           message         = malware detected: $malware_name: message rejected
1051
1052   warn    condition       = ${if eq {$acl_m_prf}{markup}}
1053           demime          = *
1054           malware         = */defer_ok
1055           message         = X-malware detected: $malware_name
1056 '
1057 end
1058 out
1059 %>
1060 <%=
1061 out=''
1062 if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty?
1063 out='
1064  discard condition     = ${if <{$message_size}{256000}}
1065          condition     = ${if eq {$acl_m_prf}{blackhole}}
1066          set acl_m_srb = ${perl{surblspamcheck}}
1067          condition     = ${if eq{$acl_m_srb}{false}{no}{yes}}
1068          log_message   = discarded surbl message for $recipients
1069
1070   deny   condition     = ${if <{$message_size}{256000}}
1071          condition     = ${if eq {$acl_m_prf}{markup}{no}{yes}}
1072          condition     = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
1073          set acl_m_srb = ${perl{surblspamcheck}}
1074          condition     = ${if eq{$acl_m_srb}{false}{no}{yes}}
1075          log_message   = $acl_m_srb
1076          message       = $acl_m_srb
1077
1078   warn   condition     = ${if <{$message_size}{256000}}
1079          condition     = ${if eq {$acl_m_prf}{markup}}
1080          set acl_m_srb = ${perl{surblspamcheck}}
1081          condition     = ${if eq{$acl_m_srb}{false}{no}{yes}}
1082          message       = X-Surbl-Hit: $primary_hostname: $acl_m_srb
1083
1084 '
1085 end
1086 out
1087 %>
1088   # Check header_sender except for survey@popcon.d.o
1089   deny    condition    = ${if eq{$acl_m_prf}{PopconMail}{false}{true}}
1090           !verify      = header_sender
1091           message      = No valid sender found in the From:, Sender: and Reply-to: headers
1092
1093 <%=
1094 out = ""
1095 if nodeinfo['packagesmaster']
1096   out = '
1097   deny  message        = Congratulations, you scored $spam_score points.
1098         log_message    = spam: $spam_score points.
1099         condition      = ${if eq {$acl_m_prf}{PackagesMail}}
1100         !authenticated = *
1101         !verify        = certificate
1102         !hosts         = +debianhosts
1103         condition      = ${if <{$message_size}{256000}}
1104         spam           = pkg_user : true
1105         condition      = ${if >{$spam_score_int}{59}}
1106 '
1107 end
1108 out
1109 %>
1110   accept
1111
1112
1113
1114 ######################################################################
1115 #                      REWRITE CONFIGURATION                         #
1116 ######################################################################
1117
1118
1119
1120 begin rewrite
1121
1122 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
1123 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
1124 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
1125 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
1126 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
1127 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
1128
1129
1130 #!!#######################################################!!#
1131 #!!# Here follow routers created from the old routers,   #!!#
1132 #!!# for handling non-local domains.                     #!!#
1133 #!!#######################################################!!#
1134
1135 begin routers
1136
1137
1138
1139 ######################################################################
1140 #                      ROUTERS CONFIGURATION                         #
1141 #                Specifies how addresses are handled                 #
1142 ######################################################################
1143 #                          ORDER DOES MATTER                         #
1144 #     An address is passed to each in turn until it is accepted.     #
1145 ######################################################################
1146
1147 <%=
1148 out = ""
1149 if nodeinfo['mailrelay']
1150   out = '
1151 relay_manualroute:
1152   driver = manualroute
1153   domains = +mailhubdomains
1154   transport = remote_smtp
1155   route_data = ${lookup{$domain}lsearch{/etc/exim4/manualroute}}
1156   require_files = /etc/exim4/manualroute
1157 '
1158 end
1159 out
1160 %>
1161
1162 bsmtp:
1163   debug_print = "R: bsmtp for $local_part@$domain"
1164   driver = manualroute
1165   domains = +bsmtp_domains
1166   require_files = /etc/exim4/bsmtp
1167   route_list = * ${extract{file}{\
1168                    ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1169                      {$value}fail}}}
1170   transport = bsmtp
1171
1172 # This router routes to remote hosts over SMTP by explicit IP address,
1173 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
1174 # require this facility, which is why it is enabled by default in Exim.
1175 ipliteral:
1176   debug_print = "R: ipliteral for $local_part@$domain"
1177   driver = ipliteral
1178   domains = !+handled_domains
1179   transport = remote_smtp
1180   ignore_target_hosts = +reservedaddrs
1181
1182 <%=
1183 out = ""
1184 if not nodeinfo['smarthost'].empty?
1185 out = '
1186 smarthost:
1187   debug_print = "R: smarthost for $local_part@$domain"
1188   driver = manualroute
1189   domains = !+handled_domains
1190   transport = remote_smtp_smarthost
1191   route_list = * ' + nodeinfo['smarthost']
1192   if nodeinfo['smarthost'] == 'mailout.debian.org'
1193     out += '/MX'
1194   end
1195   out += '
1196   host_find_failed = defer
1197   same_domain_copy_routing = yes
1198   no_more
1199 '
1200 end
1201 out
1202 %>
1203
1204 # This router routes to remote hosts over SMTP using a DNS lookup.
1205 # Ignore reserved network responses, including localhost.
1206 dnslookup:
1207   debug_print = "R: dnslookup for $local_part@$domain"
1208   driver = dnslookup
1209   domains = !+handled_domains
1210   transport = remote_smtp
1211   ignore_target_hosts = +reservedaddrs
1212   no_more
1213
1214 postmasterish:
1215   debug_print = "R: postmasterish for $local_part@$domain"
1216   driver = redirect
1217   verify = false
1218   unseen = true
1219   expn = true
1220   local_parts = +postmasterish
1221   domains = +handled_domains
1222   data = debian-admin@debian.org
1223   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1224
1225 # This router handles aliasing using a traditional /etc/aliases file.
1226 # If any of your aliases expand to pipes or files, you will need to set
1227 # up a user and a group for these deliveries to run under. You can do
1228 # this by uncommenting the "user" option below (changing the user name
1229 # as appropriate) and adding a "group" option if necessary.
1230
1231 system_aliases:
1232   debug_print = "R: system_aliases for $local_part@$domain"
1233   driver = redirect
1234   allow_defer
1235   allow_fail
1236   data = ${lookup{$local_part}lsearch*{/etc/aliases}}
1237   domains = +local_domains
1238   file_transport = address_file
1239   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1240   pipe_transport = address_pipe
1241   retry_use_local_part
1242
1243 # This router handles forwarding using traditional .forward files.
1244 # It also allows mail filtering when a forward file starts with the 
1245 # string "# Exim filter": to disable filtering, uncomment the "filter" 
1246 # option. The check_ancestor option means that if the forward file 
1247 # generates an address that is an ancestor of the current one, the 
1248 # current one gets passed on instead. This covers the case where A is 
1249 # aliased to B and B has a .forward file pointing to A.
1250
1251 # For standard debian setup of one group per user, it is acceptable---normal
1252 # even---for .forward to be group writable. If you have everyone in one
1253 # group, you should comment out the "modemask" line. Without it, the exim
1254 # default of 022 will apply, which is probably what you want.
1255
1256 userforward_verify:
1257   debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1258   driver = redirect
1259   check_ancestor
1260   user = Debian-exim
1261   no_check_local_user
1262   directory_transport = address_directory
1263   domains = +local_domains
1264   # filter - I have disabled filtering to force users to use .forward-foo files
1265   # or procmail. This will make it easier to move mailers in the future
1266   #
1267   # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1268   # also checks if the .forward-bar exists, if not then it uses
1269   # .forward-default instead.
1270   file = $home/.forward\
1271          ${if eq{}{$local_part_suffix}{}{\
1272            ${if exists {${home}/.forward${local_part_suffix}} \
1273              {${local_part_suffix}}{-default}}\
1274            }\
1275           }
1276   file_transport = address_file
1277   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1278   local_part_suffix = -*
1279   local_part_suffix_optional
1280   modemask = 002
1281   pipe_transport = address_pipe
1282   reply_transport = address_reply
1283   require_files = $home
1284   router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
1285   verify_only
1286
1287 userforward:
1288   debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
1289   driver = redirect
1290   check_ancestor
1291   check_local_user
1292   directory_transport = address_directory
1293   domains = +local_domains
1294   # filter - I have disabled filtering to force users to use .forward-foo files
1295   # or procmail. This will make it easier to move mailers in the future
1296   #
1297   # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
1298   # also checks if the .forward-bar exists, if not then it uses
1299   # .forward-default instead.
1300   file = $home/.forward\
1301          ${if eq{}{$local_part_suffix}{}{\
1302            ${if exists {${home}/.forward${local_part_suffix}} \
1303              {${local_part_suffix}}{-default}}\
1304            }\
1305           }
1306   file_transport = address_file
1307   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1308   local_part_suffix = -*
1309   local_part_suffix_optional
1310   modemask = 002
1311   pipe_transport = address_pipe
1312   reply_transport = address_reply
1313   require_files = $home
1314   no_verify
1315
1316 # This delivers to procmail
1317 procmail:
1318   debug_print = "R: procmail for $local_part@$domain"
1319   driver = accept
1320   check_local_user
1321   domains = +local_domains
1322   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1323   local_part_suffix = -*
1324   local_part_suffix_optional
1325   no_verify
1326   no_expn
1327   require_files = $local_part:$home/.procmailrc
1328   transport = procmail_pipe
1329   transport_current_directory = $home
1330   
1331 # This driver delivers to the LDAP generated alias file.
1332 ldap_aliases:
1333   debug_print = "R: ldap_aliases for $local_part@$domain"
1334   driver = redirect
1335   allow_defer
1336   allow_fail
1337   data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
1338              {${lookup{$local_part}cdb\
1339                {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
1340   domains = +local_domains
1341   file_transport = address_file
1342   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1343   pipe_transport = address_pipe
1344   retry_use_local_part
1345   
1346 # This director matches local user mailboxes.
1347 localuser:
1348   debug_print = "R: localuser for $local_part@$domain"
1349   driver = accept
1350   check_local_user
1351   domains = +local_domains
1352   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1353   # Disable if the user has never logged in
1354   require_files = $home
1355   transport = local_delivery
1356   no_more
1357
1358 # Now we begin the Virtual Domain configuration
1359 # Everything before here should apply only to the local domains with a 
1360 # domains= rule
1361
1362 # exim4 fails the router if it can't change to the user/group for delivery
1363 # during verification.  So we have to seperate the cases of verifying
1364 # the virts, and delivering to them.  blah.
1365 <%=
1366 out = ""
1367 if nodeinfo['packagesmaster']
1368   out = '
1369 # This router delivers for packages.d.o
1370 packages:
1371   debug_print = "R: packages for $local_part@$domain"
1372   driver = redirect
1373   file_transport = address_file
1374   pipe_transport = address_pipe
1375   domains = packages.debian.org
1376   require_files = /org/packages.debian.org/conf/maintainer
1377   data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
1378   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1379   transport_home_directory = /org/packages.debian.org/mail
1380   transport_current_directory = /org/packages.debian.org/mail
1381   check_ancestor
1382   retry_use_local_part
1383   no_more
1384 '
1385 end
1386 out
1387 %>
1388
1389 <%=
1390 out = ""
1391 if nodeinfo['bugsmaster'] or nodeinfo['bugsmx']
1392   domain = 'bugs.debian.org'
1393   if nodeinfo['bugsmaster']
1394     domain = 'bugs-master.debian.org'
1395   end
1396   out = '
1397 # This router delivers for bugs.d.o
1398 bugs:
1399   debug_print = "R: bugs for $local_part@$domain"
1400   driver = accept
1401   transport = bugs_pipe
1402   domains = ' + domain + '
1403   cannot_route_message = Unknown or archived bug
1404   require_files = /org/bugs.debian.org/mail/run-procmail
1405   no_more
1406   local_parts = ${if match\
1407                   {$local_part}\
1408                   {\N^(\d+)(\d{2})(?:-(?:(?:submit|maintonly|quiet|forwarded|done|close|request|submitter)|(?:unsubscribe|ignore|help|(?:sub(?:scribe|help|yes|approve|reject))|unsubyes|bounce|probe|approve|reject|setlistyes|setlistsilentyes).*))?$\N}\
1409                {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
1410                {$local_part}fail}}fail}
1411 '
1412 end
1413 out
1414 %>
1415
1416 <%=
1417 out = ""
1418 if nodeinfo['rtmaster']
1419   out = '
1420 # This router delivers for rt.d.o
1421 rt_force_new_verbose:
1422   debug_print = "R: rt for $local_part+new@$domain"
1423   driver = redirect
1424   domains = rt.debian.org
1425   require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1426   local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1427   local_part_suffix = +new
1428   pipe_transport = rt_pipe
1429   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}}"
1430   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1431
1432 # FIXME: figure out how to generalize this approach so that all of the following would work
1433 # - rt+NNNN@rt.debian.org          : attach correspondence to ticket (verbose)
1434 # - rt+NNNN-quiesce@rt.debian.org  : attach correspondence to ticket (quiesce)
1435 # - rt+NNNN-<action>@rt.debian.org : attach correspondence to ticket (some action)
1436 # requires modification to custom condition in \'scrips\'
1437 rt_force_new_quiesce:
1438   debug_print = "R: rt for $local_part+new-quiesce@$domain"
1439   driver = redirect
1440   domains = rt.debian.org
1441   require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1442   local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1443   local_part_suffix = +new-quiesce
1444   pipe_transport = rt_pipe
1445   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}}"
1446   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}\nX-RT-Mode: quiesce"
1447
1448 rt_otherwise:
1449   debug_print = "R: rt for $local_part@$domain"
1450   driver = redirect
1451   domains = rt.debian.org
1452   require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
1453   local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
1454   local_part_suffix = +*
1455   local_part_suffix_optional
1456   pipe_transport = rt_pipe
1457   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}}"
1458   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1459 '
1460 end
1461 out
1462 %>
1463
1464 virt_direct_verify:
1465   debug_print = "R: virt_direct for $local_part@$domain"
1466   driver = redirect
1467   no_check_local_user
1468   user = Debian-exim
1469   allow_filter
1470   modemask = 002
1471   directory_transport = address_directory
1472   domains = +virtual_domains
1473   file = $home/.forward-\
1474               ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1475                    {default}}
1476   file_transport = address_file
1477   pipe_transport = address_pipe
1478   reply_transport = address_reply
1479   retry_use_local_part
1480   router_home_directory = ${extract{directory}{VDOMAINDATA}}
1481   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1482   verify_only
1483
1484 # This is a senmailesque alias file lookup
1485 virt_aliases:
1486   debug_print = "R: virt_aliases for $local_part@$domain"
1487   driver = redirect
1488   allow_defer
1489   allow_fail
1490   data = ${if exists{\
1491            ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
1492            {${lookup{$local_part}lsearch*{\
1493               ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
1494            }}}}
1495   directory_transport = address_directory
1496   domains = +virtual_domains
1497   file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1498   cannot_route_message = Unknown user
1499   group = ${extract{group}{VDOMAINDATA}}
1500   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1501   pipe_transport = address_pipe
1502   qualify_preserve_domain
1503   retry_use_local_part
1504   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1505   transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1506   user = ${extract{user}{VDOMAINDATA}}
1507   
1508 # This is a qmailesque deliver into a directory of .forward files
1509 virt_direct:
1510   debug_print = "R: virt_direct for $local_part@$domain"
1511   driver = redirect
1512   allow_filter
1513   allow_fail
1514   allow_defer
1515   no_check_local_user
1516   directory_transport = address_directory
1517   domains = +virtual_domains
1518   file = $home/.forward-\
1519               ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1520                    {default}}
1521   file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1522   group = ${extract{group}{VDOMAINDATA}}
1523   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1524   modemask = 002
1525   pipe_transport = address_pipe
1526   reply_transport = address_reply
1527   retry_use_local_part
1528   router_home_directory = ${extract{directory}{VDOMAINDATA}}
1529   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1530   no_verify
1531   user = ${extract{user}{VDOMAINDATA}}
1532   #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1533
1534 ######################################################################
1535 #                      TRANSPORTS CONFIGURATION                      #
1536 ######################################################################
1537 #                       ORDER DOES NOT MATTER                        #
1538 #     Only one appropriate transport is called for each delivery.    #
1539 ######################################################################
1540
1541
1542 begin transports
1543
1544 # This transport is used for local delivery to user mailboxes. On debian
1545 # systems group mail is used so we can write to the /var/mail
1546 # directory. (The alternative, which most other unixes use, is to deliver
1547 # as the user's own group, into a sticky-bitted directory)
1548 local_delivery:
1549   driver = appendfile
1550   file = /var/mail/${local_part}
1551   group = mail
1552   mode = 0660
1553   no_mode_fail_narrower
1554   return_path_add
1555   
1556 # This transport is used for handling pipe addresses generated by alias
1557 # or .forward files. It has a conventional name, since it is not actually
1558 # mentioned elsewhere in this configuration file. (A different name *can*
1559 # be specified via the "address_pipe_transport" option if you really want
1560 # to.) If the pipe generates any standard output, it is returned to the sender
1561 # of the message as a delivery error. Set return_fail_output instead if you
1562 # want this to happen only when the pipe fails to complete normally.
1563
1564 address_pipe:
1565   driver = pipe
1566   current_directory = ${home}
1567   environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1568                  EXT=${substr_1:${local_part_suffix}}:\
1569                  LOCAL=${local_part}${local_part_suffix}:\
1570                  RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1571   return_output
1572   return_path_add
1573
1574 # This transport is used for handling file addresses generated by alias
1575 # or .forward files. It has a conventional name, since it is not actually
1576 # mentioned elsewhere in this configuration file.
1577
1578 address_file:
1579   driver = appendfile
1580   return_path_add
1581
1582 address_file_group:
1583   driver = appendfile
1584   return_path_add
1585   mode = 0660
1586   directory_mode = 0770
1587   mode_fail_narrower = false
1588
1589 # This transport is used for handling file addresses generated by alias
1590 # or .forward files if the path ends in "/", which causes it to be treated
1591 # as a directory name rather than a file name. Each message is then delivered
1592 # to a unique file in the directory. If instead you want all such deliveries to
1593 # be in the "maildir" format that is used by some other mail software,
1594 # uncomment the final option below. If this is done, the directory specified
1595 # in the .forward or alias file is the base maildir directory.
1596 #
1597 # Should you want to be able to specify either maildir or non-maildir
1598 # directory-style deliveries, then you must set up yet another transport,
1599 # called address_directory2. This is used if the path ends in "//" so should
1600 # be the one used for maildir, as the double slash suggests another level
1601 # of directory. In the absence of address_directory2, paths ending in //
1602 # are passed to address_directory.
1603
1604 address_directory:
1605   driver = appendfile
1606   check_string = 
1607   maildir_format
1608   message_prefix = ""
1609   message_suffix = ""
1610   return_path_add
1611
1612 # This transport is used for handling autoreplies generated by the filtering
1613 # option of the forwardfile director. It has a conventional name, since it
1614 # is not actually mentioned elsewhere in this configuration file.
1615 address_reply:
1616   driver = autoreply
1617
1618 # This transport is used for delivering messages over SMTP connections.
1619
1620 remote_smtp:
1621   driver = smtp
1622   connect_timeout = 1m
1623   delay_after_cutoff = false
1624 <%=
1625 out = ""
1626 if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1627   out = "  tls_certificate = /etc/exim4/ssl/thishost.crt
1628   tls_privatekey = /etc/exim4/ssl/thishost.key"
1629 end
1630 out
1631 %>
1632
1633 <%=
1634 out = ""
1635 if not nodeinfo['smarthost'].empty?
1636 out = '
1637 remote_smtp_smarthost:
1638   debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
1639   driver = smtp
1640   delay_after_cutoff = false
1641   port = '
1642   out += nodeinfo['smarthost_port'].to_s + "\n"
1643   if has_variable?("exim_ssl_certs") && exim_ssl_certs == "true"
1644     out += '  tls_tempfail_tryclear = false
1645   hosts_require_tls = ' + nodeinfo['smarthost'] + '
1646   tls_certificate = /etc/exim4/ssl/thishost.crt
1647   tls_privatekey = /etc/exim4/ssl/thishost.key
1648 '
1649   end
1650 end
1651 out
1652 %>
1653
1654 # Send the message to procmail
1655 procmail_pipe:
1656   driver = pipe
1657   command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1658   return_path_add
1659   user = ${local_part}
1660
1661 bsmtp:
1662   driver = appendfile
1663   batch_max = 100
1664   file = ${host}
1665   message_prefix = 
1666   message_suffix = 
1667   use_bsmtp
1668   user = ${extract{user}{\
1669                    ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1670                      {$value}fail}\
1671                    }}
1672
1673 <%=
1674 out = ""
1675 if nodeinfo['bugsmaster'] or nodeinfo['bugsmx']
1676   out = '
1677 bugs_pipe:
1678   driver = pipe
1679   command = /org/bugs.debian.org/mail/run-procmail
1680   environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1681                  EXT=${substr_1:${local_part_suffix}}:\
1682                  LOCAL=${local_part}${local_part_suffix}:\
1683                  RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1684   return_path_add
1685   return_output
1686   user = debbugs
1687 '
1688 end
1689 out
1690 %>
1691
1692 <%=
1693 out = ""
1694 if nodeinfo['rtmaster']
1695   out = '
1696 rt_pipe:
1697   debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1698   driver = pipe
1699   return_fail_output
1700   environment = EXTENSION=${substr_1:${local_part_suffix}}
1701   allow_commands = /usr/bin/rt-mailgate
1702 '
1703 end
1704 out
1705 %>
1706
1707 ######################################################################
1708 #                      RETRY CONFIGURATION                           #
1709 ######################################################################
1710
1711 # This single retry rule applies to all domains and all errors. It specifies
1712 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1713 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1714 # hours, then retries every 8 hours until 4 days have passed since the first
1715 # failed delivery.
1716
1717 # Domain               Error       Retries
1718 # ------               -----       -------
1719
1720
1721 begin retry
1722
1723 debian.org             *           F,2h,10m; G,16h,2h,1.5; F,14d,8h
1724 *                      * senders=: F,2h,10m
1725 *                      rcpt_4xx    F,2h,5m;  F,4h,10m; F,4d,15m
1726 *                      *           F,2h,15m; G,16h,2h,1.5; F,4d,8h
1727
1728 # End of Exim 4 configuration