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