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