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