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