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