add puppet disclaimer
[mirror/dsa-puppet.git] / modules / exim / files / common / exim4.conf
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 # It is hand crafted, do not replace with anything generated by a config
9 # tool!
10 # It is installed as part of the debian.org package -- don't edit this file
11
12 # The configuration file uses a set of macros and rules to generate an
13 # acceptable mail environment for debian.org machines. It deviates
14 # considerably from what could be considered a standard exim configuration.
15
16 # This configuration file brings in the necessary information from
17 # other databases stored in /etc/exim/ right now these are linear text
18 # databases.
19
20 # This file is independent of the local host, it should not be changed
21 # per machine. primary_hostname is used in all places that require per-host 
22 # settings.
23
24 # The configuration files in /etc/exim are as follows:
25 #  locals - This is a list of domains that are considered local. A local
26 #           domain is essential one that deliveries to /var/mail
27 #           will be attempted. The users available for local delivery
28 #           comes from /etc/passwd and /etc/aliases. Wildcards are not
29 #           permitted.
30 #  virtualdomains - This is a list of all virtual domains. A virtual domain
31 #           is much like a local domain, execpt that the delivery location
32 #           and allowed set of users is controlled by a virtual domain
33 #           alias file and not /etc/passwd. Wildcards are permitted
34 #  rcpthosts - recipient hosts or relay domains. This is a list of
35 #           all hosts that we mail exchange for. All domains that list
36 #           this host in their MX records should be listed here. Wildcards
37 #           are permitted.
38 #  relayhosts - Hostnames that can send any arbitarily addressed mail to
39 #           us. This is primarily only usefull for emergancy 'queue
40 #           flushing' operations, but should be populated with a list
41 #           of trusted machines. Wildcards are not permitted
42 # The division of files is designed so that all hosts may share rcpthosts
43 # and relayhosts, these could be replicated automatically if necessary.
44
45 # Exim's wildcard mechanism is a bit odd in that to say "any address in
46 # debian.org including debian.org" you must use two patterns,
47 #   *.debian.org
48 #   debian.org
49 # Also you can only place a * before a . and as the first char in a string.
50 # Wildcards always match last so they may be used as a catchall.
51
52 # Further details can be found in each of the files.
53
54 # Usefull exim commands:
55 #  exim4 -qf  - Try sending all messages right now, including frozen ones
56 #  exim4 -bt foo@blah - Write what exim would do if it saw the address
57 #                      Great for testing virtual domains and forward files
58
59 # Special Features for users:
60 # .forward-foo - is understood as an extension address for bar-foo@cow.com
61 # .forward-default - is understood to be a catch all for bar-*@cow.com
62 # .procmailrc - with no .forward file invokes procmail for delivery
63 #               automatically.
64
65 # For virtual domains the first lookup is done against a linear text
66 # database called 'aliases', then .forward files are consulted. Exim
67 # filtering is available for these .forward files only. .forward-default
68 # is the universal catch all for everything not handled.
69
70 # Heuristic check (none bad enough to cause a hard reject, but in aggregate
71 # will trigger things like rcpt to rate limiting or possibly a reject if
72 # enough hits are triggered.
73 #
74 # value is stored in acl_c1
75
76 ######################################################################
77 #                    MAIN CONFIGURATION SETTINGS                     #
78 ######################################################################
79
80 # These options specify the Access Control Lists (ACLs) that
81 # are used for incoming SMTP messages - after the RCPT and DATA
82 # commands, respectively.
83
84 acl_smtp_helo = check_helo
85 acl_smtp_rcpt = ${if ={$interface_port}{587} {check_submission}{check_recipient}}
86 acl_smtp_data = check_message
87
88 # accept domain literal syntax in e-mail addresses. To actually make use of
89 # this a router is also required
90 allow_domain_literals = true
91
92 # This setting defines a named domain list called
93 # local_domains. It will be referenced
94 # later on by the syntax "+local_domains".
95 # Other domain and host lists may follow.
96 # @ is the local FQDN, @[] matches the IP adress of any local interface.
97
98 .include_if_exists /etc/exim4/local-auto.conf
99 .include_if_exists /etc/exim4/local-settings.conf
100
101 domainlist local_domains = @ : \
102     @[] : \
103     localhost : \
104     ${if exists {/etc/exim4/locals}{lsearch;/etc/exim4/locals}}
105
106 domainlist virtual_domains = partial-lsearch;/etc/exim4/virtualdomains
107
108 domainlist submission_domains = ${if exists {/etc/exim4/submission-domains}{/etc/exim4/submission-domains}{}}
109
110 domainlist handled_domains = +local_domains : +virtual_domains
111
112 localpartlist local_only_users = lsearch;/etc/exim4/localusers
113
114 # Domains we relay for; that is domains that aren't considered local but we 
115 # accept mail for them.
116 domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
117 hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
118
119 .ifndef RESERVEDADDRS
120 RESERVEDADDRS = 0.0.0.0/8 : 127.0.0.0/8 : 10.0.0.0/8 : 169.254.0.0/16 : \
121                 172.16.0.0/12 : 192.0.0.0/17 : 192.168.0.0/16 : \
122                 224.0.0.0/4 : 240.0.0.0/5 : 248.0.0.0/5
123 .endif
124
125 hostlist reservedaddrs = RESERVEDADDRS
126
127 #system_filter = /etc/exim4/filter
128 #system_filter_file_transport = address_file
129
130 # The setting below causes Exim to do a reverse DNS lookup on all incoming
131 # IP calls, in order to get the true host name. If you feel this is too
132 # expensive, you can specify the networks for which a lookup is done, or
133 # remove the setting entirely.
134 host_lookup = *
135 dns_ipv4_lookup = !localhost
136
137 # If this option is set, then any process that is running as one of the
138 # listed users may pass a message to Exim and specify the sender's
139 # address using the "-f" command line option, without Exim's adding a
140 # "Sender" header.
141
142 #trusted_users = mail
143 #trusted_users = mail : www-data : ${if exists{/home/qa}{qa}{}}
144 untrusted_set_sender = *
145
146 # Some operating systems use the "gecos" field in the system password file
147 # to hold other information in addition to users' real names. Exim looks up
148 # this field when it is creating "sender" and "from" headers. If these options
149 # are set, exim uses "gecos_pattern" to parse the gecos field, and then
150 # expands "gecos_name" as the user's name. $1 etc refer to sub-fields matched
151 # by the pattern.
152
153 gecos_pattern = ^([^,:]*)
154 gecos_name = $1
155
156 # This tells exim to immediately discard error messages (ie double bounces).
157 ignore_bounce_errors_after = 0s
158 auto_thaw = 1d
159 timeout_frozen_after=14d
160
161 message_size_limit = 100M
162 message_logs = false
163 smtp_accept_max = 300
164 smtp_accept_max_per_host = ${if match_ip {$sender_host_address}{+debianhosts}{0}{7}}
165 smtp_accept_queue = 200
166 smtp_accept_queue_per_connection = 50
167 smtp_accept_reserve = 25
168 smtp_reserve_hosts = +debianhosts
169
170 split_spool_directory = true
171 check_spool_inodes = 200
172 check_spool_space  = 20M
173
174 delay_warning =
175
176 queue_run_max = 50
177 deliver_queue_load_max = 50
178 queue_only_load = 15
179 queue_list_requires_admin = false
180
181 .ifdef CLAMAV
182 av_scanner = CLAMAV
183 .endif
184
185 .ifdef HAVE_USER_DEBBUGS
186 daemon_smtp_ports = 25 : 587
187 .endif
188
189 admin_groups = adm
190 remote_sort_domains = *.debian.org:*.debian.net
191
192 pipelining_advertise_hosts = !*
193 smtp_enforce_sync = true
194
195 log_selector = +tls_cipher +tls_peerdn +queue_time +deliver_time +smtp_connection +smtp_incomplete_transaction +smtp_confirmation
196
197 # macro definitions.
198 # Do not wrap!
199 VDOMAINDATA = ${lookup{$domain}partial-lsearch{/etc/exim4/virtualdomains}{$value}}
200 WHITELIST = ${if match_domain{$domain}{+virtual_domains}{\
201                ${if exists {/srv/$domain/mail/whitelist}{\
202                 ${lookup{$local_part}lsearch{/srv/$domain/mail/whitelist}{$value}{}}\
203                 }{}}\
204                }{${lookup{$local_part}lsearch{/etc/exim4/whitelist}{$value}{}} : ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-whitelist}{$value}{}}}}
205 GREYLIST_LOCAL_PARTS = ${if match_domain{$domain}{+virtual_domains}\
206                        {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
207                        {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
208                        {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
209                        ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
210 RT_QUEUE_MAP = /srv/rt.debian.org/mail/rt_queue_map
211
212 ######################################################################
213 #                        ACL CONFIGURATION                           #
214 ######################################################################
215 begin acl
216
217 check_helo:
218
219   warn    set acl_c1    = 0
220   # These are in HELO acl so that they are only run once.  They increment a counter,
221   # so we don't want it to increment per rcpt to.
222
223   warn    dnslists       = list.dnswl.org&0.0.0.3
224           log_message    = Hit on list.dnswl.org for $sender_host_address
225           set acl_c1     = ${eval:$acl_c1-30}
226
227   warn    dnslists       = list.dnswl.org&0.0.0.2
228           log_message    = Hit on list.dnswl.org for $sender_host_address
229           set acl_c1     = ${eval:$acl_c1-20}
230
231   warn    dnslists       = list.dnswl.org
232           log_message    = Hit on list.dnswl.org for $sender_host_address
233           set acl_c1     = ${eval:$acl_c1-10}
234
235   warn    condition      = ${if isip {$sender_helo_name}{true}{false}}
236           log_message    = remote host used IP address in HELO/EHLO greeting
237           set acl_c1     = ${eval:$acl_c1+20}
238
239   warn    !hosts         = +debianhosts
240           condition      = ${if eq{$host_lookup_failed}{1}}
241           set acl_c1     = ${eval:$acl_c1+20}
242
243   warn    !hosts         = +debianhosts
244           condition      = ${if eq{$host_lookup_failed}{0}}
245           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}}
246           set acl_c1     = ${eval:$acl_c1+20}
247
248   warn    !hosts         = +debianhosts
249           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}}
250           set acl_c1     = ${eval:$acl_c1+20}
251
252   warn    !hosts         = +debianhosts
253           dnslists       = dul.dnsbl.sorbs.net
254           set acl_c1     = ${eval:$acl_c1+15}
255
256   # If the sender's helo name is empty, the message will be rejected later
257   # because the helo is empty.  If the rDNS lookup failed, we are already
258   # going to greylist them, so no sense worrying about it here.  Finally,
259   # if rDNS does not match helo name (both lower cased first), greylist.
260
261   warn    !hosts         = +debianhosts
262           condition      = ${if eq {$host_lookup_failed}{1}{no}{yes}}
263           condition      = ${if def:sender_helo_name {yes}{no}}
264           condition      = ${if eq {${lc:$sender_helo_name}}{${lc:$sender_host_name}}{no}{yes}}
265           log_message    = HELO doesn't match rDNS
266           set acl_c1     = ${eval:$acl_c1+8}
267
268   # Regexes of doom
269   # matches 098325879 - looks fishy
270
271   warn condition        = ${if and { \
272                                      { !match{$sender_helo_name}{\N^\[.+\]$\N} } \
273                                      { !match{$sender_helo_name}{\N^(?i)((?=[^-])[a-z0-9-]*[a-z0-9]\.)+[a-z]{2,6}$\N} } \
274                                     } \
275                             }
276        log_message      = non-FQDN HELO
277        set acl_c1       = ${eval:$acl_c1+12}
278
279   # Matches DOMAIN99.com - looks bad
280
281   warn condition       = ${if match {$sender_helo_name}{\N^[A-Z]+[A-Z0-9\-]+\.[A-Za-z0-9]+$\N}}
282        log_message     = SHOUTING HELO
283        set acl_c1      = ${eval:$acl_c1+7}
284
285   # Random HELO (run of 7 consonants) (constructed by viruses).  We purposefully
286   # skip matching on machines named .*smtp.*, since that's 4 already.  This is a fairly
287   # naive test, so it's not worth much
288
289   warn condition       = ${if match {${lc:$sender_helo_name}}{smtp}{no}{yes}}
290        condition       = ${if match {${lc:$sender_helo_name}}{\N^[a-z0-9]+\.[a-z]+$\N}}
291        condition       = ${if match {${lc:$sender_helo_name}}{\N.*[bcdfghjklmnpqrstvwxz]{7,}.*\.[a-z]+$\N}}
292        log_message     = random HELO
293        set acl_c1      = ${eval:$acl_c1+5}
294
295   # Implicit, but simpler to just say it
296   accept
297
298 #!!# ACL that is used after the RCPT command on the submission port
299 check_submission:
300
301   # Defer after too many bad RCPT TO's.  Legit MTAs will retry later.
302   # This is a rough pass at preventing addres harvesting or other mail blasts.
303
304   defer  log_message   = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
305          message       = Too many bad recipients, try again later
306          condition     = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
307
308   defer
309           ratelimit      = 5 / 60m / per_rcpt / $sender_host_address
310           message        = sorry, only 5 reports per hour for submission
311
312   accept  domains  = +submission_domains
313           endpass
314           message  = unknown user
315           verify   = recipient
316
317   deny    message = relay not permitted
318
319 #!!# ACL that is used after the RCPT command
320 check_recipient:
321
322   # Defer after too many bad RCPT TO's.  Legit MTAs will retry later.
323   # This is a rough pass at preventing addres harvesting or other mail blasts.
324
325   defer  log_message   = Too many bad recipients ${eval:$rcpt_fail_count} out of $rcpt_count
326          message       = Too many bad recipients, try again later
327          !hosts        = +debianhosts
328          condition     = ${if > {${eval:$rcpt_fail_count}}{3}{yes}{no}}
329
330   # Dump spambots that are so stupid they say helo as our IP address
331
332   drop !hosts          = +debianhosts
333        condition       = ${if eq {$sender_helo_name}{$interface_address}{yes}{no}}
334        message         = HELO mismatch Forged HELO for ($sender_helo_name)
335
336   # Also for spambots that say helo as us or one of our domains
337
338   drop !hosts          = +debianhosts
339        condition       = ${if match_domain{$sender_helo_name}{$primary_hostname:+handled_domains}}
340        condition       = ${if !match{$sender_host_name}{${rxquote:$sender_helo_name}\N$\N}}
341        message         = HELO mismatch Forged HELO for ($sender_helo_name)
342
343   # This logic gives you a list of commonly forged domains in helo to reject against
344
345   warn set acl_m2      = ${lookup{$sender_helo_name} \
346                            nwildlsearch{/etc/exim4/helo-check} \
347                           {${if eq{$value}{}{$sender_helo_name}{$value}}}{}}
348
349   # This is a failsafe in case DNS fails - we defer instead of hard reject if they 
350   # say helo as a name in the list but we can't look them up
351
352   defer !hosts         = +debianhosts
353         condition      = ${if eq{$acl_m2}{}{no}{yes}}
354         condition      = ${if eq{$sender_host_name}{}{yes}{no}}
355         condition      = ${if eq{$host_lookup_failed}{1}{no}{yes}}
356         message        = Access temporarily denied. Resolve failed PTR for $sender_host_address
357
358   # If DNS works, go ahead and reject them
359
360   drop !hosts          = +debianhosts
361        condition       = ${if and { {!eq{$acl_m2}{}}{!match{$sender_host_name}{${rxquote:$acl_m2}\N$\N}}}{yes}{no}}
362         message        = HELO mismatch Forged HELO for ($sender_helo_name)
363
364   # disabled accounts don't even get local mail.
365   deny    local_parts   = lsearch;/var/lib/misc/$primary_hostname/mail-disable
366           domains       = +local_domains
367           message       = ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-disable}{$value}}
368
369   deny    domains       = +virtual_domains
370           local_parts   = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
371                                       {${extract{directory}{VDOMAINDATA}{${value}/localonly}}}\
372                                       {}}
373           hosts         = !+debianhosts
374           message       = mail for <$local_part@$domain> only accepted from debian.org machines
375   # Accept if the source is local SMTP (i.e. not over TCP/IP).
376   # We do this by testing for an empty sending host field.
377   accept  hosts = :
378   
379   deny    domains       = +handled_domains
380           local_parts   = ^[.] : ^.*[@%!/|]
381   
382   deny    domains       = !+handled_domains
383           local_parts   = ^[./|] : ^.*[@%!] : ^.*/\\.\\./
384
385 # forwards mail to @d.o address, even if it's a bounce from master, no reply
386 # from source address; rejecting all mail now.
387   deny    recipients    = mendoza@debian.org
388           hosts         = 65.110.39.147 : 64.39.31.15
389           message       = <mendoza@kenny.linuxsis.net> cannot forward here while mailer-daemon mail is not caught
390
391   deny    condition     = ${lookup{$sender_address_local_part}lsearch{/etc/exim4/localusers}{true}}
392           sender_domains= +local_domains : debian.org : debian.net : debian.com
393           hosts         = !+debianhosts
394           message       = mail from <$sender_address> not allowed externally
395
396   deny    condition     = ${if match_domain{$sender_address_domain}{+virtual_domains}{1}{0}}
397           condition     = ${if exists {${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
398           condition     = ${if match_local_part {$sender_address_local_part}{${extract{directory}{VDOMAINDATA}{${value}/neversenders}}}{1}{0}}
399           message       = no mail should ever come from <$sender_address>
400
401   deny    local_parts   = +local_only_users
402           domains       = +local_domains
403           hosts         = !+debianhosts
404           message       = mail for $local_part is only accepted internally
405
406   deny    message  = address $sender_host_address is listed in $dnslist_domain; $dnslist_text
407           hosts    = !+debianhosts
408           dnslists = rbl.debian.net : rbl.debian.net/$sender_address_domain
409
410   deny    !recipients = survey@popcon.debian.org
411           !verify = sender
412
413   defer   !hosts         = +debianhosts
414           condition      = ${if >{${eval:$acl_c1}}{0}}
415           ratelimit      = 10 / 60m / per_rcpt / $sender_host_address
416           message        = slow down (no reverse dns, or dialup)
417
418 .ifdef HAVE_POLICYD
419   # Check with policyd-weight - this only works with a version after etch's,
420   # sadly.  etch's version attempts to hold the socket open, since that's what
421   # postfix expects.  Exim, on the other hand, expects the remote side to close
422   # the socket when it's finished sending data, so it see each transaction as
423   # an incomplete read.  I'm sure there's a way we could force exim to do
424   # something sick and clever to force either the interpretation or the socket
425   # closure, but I'm fairly sure it's now worth it, since the backport of
426   # policyd-weight is trivial.
427   warn  !hosts         = +debianhosts
428         set acl_m9     = ${readsocket{inet:127.0.0.1:12525}\
429                           {request=smtpd_access_policy\n\
430                            protocol_state=RCPT\n\
431                            protocol_name=${uc:$received_protocol}\n\
432                            helo_name=$sender_helo_name\n\
433                            queue_id=$message_exim_id\n\
434                            sender=$sender_address\n\
435                            recipient=$local_part@$domain\n\
436                            recipient_count=$rcpt_count\n\
437                            client_address=$sender_host_address\n\
438                            client_name=$sender_host_name\n\
439                            reverse_client_name=$sender_host_name\n\
440                            instance=$sender_host_address.$sender_address.$sender_helo_name\n\n}\
441                           {20s}{\n}{socket failure}}
442
443   # Defer on socket error
444   defer !hosts         = +debianhosts
445         condition      = ${if eq{$acl_m9}{socket failure}{yes}{no}}
446         message        = Cannot connect to policyd-weight. Please try again later.
447
448   # Set proposed action to $acl_m8 and message to $acl_m7
449   warn  !hosts         = +debianhosts
450         set acl_m8     = ${extract{action}{$acl_m9}}
451         set acl_m7     = ${sg{$acl_m9}{\Naction=[^ ]+ (.*)\n\n\N}{\$1}}
452
453   # Add X-policyd-weight header line to message
454   warn  !hosts         = +debianhosts
455         message        = $acl_m7
456         condition      = ${if eq{$acl_m8}{PREPEND}{yes}{no}}
457
458   # Write log message, if policyd-weight can't run checks
459   warn  !hosts         = +debianhosts
460         log_message    = policyd-weight message: $acl_m7
461         condition      = ${if eq{$acl_m8}{DUNNO}{yes}{no}}
462
463   # Deny mails which policyd-weight thinks are spam
464   deny  !hosts         = +debianhosts
465         message        = policyd-weight said: $acl_m7
466         condition      = ${if eq{$acl_m8}{550}{yes}{no}}
467
468   # Defer messages when policyd-weight suggests so.
469   defer  !hosts         = +debianhosts
470          message        = policyd-weight said: $acl_m7
471          condition      = ${if eq{$acl_m8}{450}{yes}{no}}
472 .endif
473
474   warn    recipients = survey@popcon.debian.org
475           set acl_m1 = PopconMail
476
477   warn    domains  = rt.debian.org
478           set acl_m1 = RTMail
479           set acl_m12 = ${if def:acl_m12 {$acl_m12} {${if match{$local_part}{[^+]+\\+\\d+} {RTMailRecipientHasSubaddress}}}}
480
481   warn    domains  = packages.qa.debian.org
482           set acl_m1 = PTSMail
483
484   warn    recipients = owner@packages.qa.debian.org : postmaster@packages.qa.debian.org
485           set acl_m1 = PTSOwner
486
487   warn    recipients = change@db.debian.org : changes@db.debian.org : chpasswd@db.debian.org : ping@db.debian.org : recommend@nm.debian.org
488           set acl_m1 = DBSignedMail
489
490   warn    senders  = :
491           domains  = packages.qa.debian.org
492           condition = ${if match{$local_part}{\N^bounces+\N}}
493           set acl_m1 = PTSListBounce
494
495 .ifdef USE_GREYLISTING
496 .ifdef HAVE_GREYLIST
497   defer
498     message  = $sender_host_address is not yet authorized to deliver mail from <$sender_address> to <$local_part@$domain>.
499     log_message = greylisted.
500     local_parts    = ${if match_domain{$domain}{+virtual_domains}\
501                      {${if exists {${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}\
502                      {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/grey_users}}}{$local_part}{}}}{}}}\
503                      {${lookup{$local_part}lsearch{/etc/exim4/grey_users}{$local_part}{}} : \
504                      ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-greylist}{$local_part}{}}}}
505     !senders       = :
506     !hosts         = : +debianhosts : WHITELIST : \
507                      ${if exists {/etc/greylistd/whitelist-hosts}\
508                                  {/etc/greylistd/whitelist-hosts}{}} : \
509                      ${if exists {/var/lib/greylistd/whitelist-hosts}\
510                                  {/var/lib/greylistd/whitelist-hosts}{}} 
511     !authenticated = *
512     domains        = +handled_domains : +rcpthosts
513     condition      = ${readsocket{/var/run/greylistd/socket}\
514                                  {--grey \
515                                   $sender_host_address \
516                                   $sender_address \
517                                   $local_part@$domain}\
518                                  {5s}{}{false}}
519 .endif
520 .ifdef HAVE_POSTGREY
521   # next three are greylisting, inspired by http://www.bebt.de/blog/debian/archives/2006/07/30/T06_12_27/index.html
522   # this adds acl_m4 if there isn't one (so unique per message)
523   warn
524     !senders       = :
525     !hosts         = : +debianhosts : WHITELIST
526     condition      = ${if def:acl_m4 {no}{yes}}
527     set acl_m4     = $pid.$tod_epoch.$sender_host_port
528
529   # and defers the message if postgrey thinks it should be defered ...
530   defer
531     !senders       = :
532     !hosts         = : +debianhosts : WHITELIST
533     !authenticated = *
534     domains        = +handled_domains : +rcpthosts
535     local_parts    = GREYLIST_LOCAL_PARTS
536     set acl_m3     = request=smtpd_access_policy\n\
537                      protocol_state=RCPT\n\
538                      protocol_name=${uc:$received_protocol}\n\
539                      instance=${acl_m4}\n\
540                      helo_name=${sender_helo_name}\n\
541                      client_address=${substr_-3:${mask:$sender_host_address/24}}\n\
542                      client_name=${sender_host_name}\n\
543                      sender=${sender_address}\n\
544                      recipient=$local_part@$domain\n\n
545     set acl_m3     = ${sg{\
546                          ${readsocket{/var/run/postgrey/socket}{$acl_m3}\
547                                {5s}{}{action=DUNNO}}\
548                      }{action=}{}}
549     message        = ${sg{$acl_m3}{^\\w+\\s*}{}}
550     log_message    = greylisted.
551     condition      = ${if eq{${uc:${substr{0}{5}{$acl_m3}}}}{DEFER}}
552
553  # ... or adds a header with information about how long the delay was
554  warn
555     !senders       = :
556     !hosts         = : +debianhosts : WHITELIST
557     !authenticated = *
558     domains        = +handled_domains : +rcpthosts
559     local_parts    = GREYLIST_LOCAL_PARTS
560     condition      = ${if eq{${uc:${substr_0_7:$acl_m3}}}{PREPEND}}
561     message        = ${sg{$acl_m3}{^\\w+\\s*}{}}
562 .endif
563 .endif
564
565   accept  local_parts   = postmaster
566           domains       = +handled_domains : +rcpthosts
567
568   deny   log_message   = <$sender_address> is blacklisted
569          senders       = ${if exists{/etc/exim4/blacklist}{/etc/exim4/blacklist}{}}
570          message       = We have blacklisted <$sender_address>.  Please stop mailing us
571
572   deny    message  = host $sender_host_address is listed in $dnslist_domain; see $dnslist_text
573           dnslists = ${if match_domain{$domain}{+virtual_domains}\
574                      {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}\
575                      {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
576                      {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
577                      ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
578           domains       = +handled_domains : +rcpthosts
579           !hosts        = +debianhosts : WHITELIST
580
581   deny    message  = domain $sender_address_domain is listed in $dnslist_domain; see $dnslist_text
582           dnslists = ${if match_domain{$domain}{+virtual_domains}\
583                      {${if exists {${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}\
584                      {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
585                      {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
586                      ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
587           domains       = +handled_domains : +rcpthosts
588           !hosts        = +debianhosts : WHITELIST
589
590   deny    domains  = +handled_domains : +rcpthosts
591           local_parts   = ${if match_domain{$domain}{+virtual_domains}\
592                            {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
593                            {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
594                            {${lookup{$local_part}lsearch{/etc/exim4/callout_users}{$local_part}{}} : \
595                            ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-callout}{$local_part}{}}}}
596           !hosts   = +debianhosts : WHITELIST
597           !verify  = sender/callout
598
599   accept  domains  = +handled_domains
600           endpass
601           message  = unknown user
602           verify   = recipient/defer_ok
603
604   accept  domains  = +rcpthosts
605           endpass
606           message  = unrouteable address
607           verify   = recipient
608
609   accept  hosts         = +debianhosts
610
611   accept  authenticated = *
612
613   deny    message = relay not permitted
614
615 #!!# ACL that is used after the DATA command
616 check_message:
617   require verify = header_syntax
618           message = Invalid syntax in the header
619
620   deny    condition = ${if eq {$acl_m1}{RTMail}}
621           condition = ${if and{{!match {${lc:$rh_Subject:}} {debian rt}} \
622                                {!match {${lc:$rh_Subject:]}} {\\[rt.debian.org }} \
623                                {!match {$acl_m12}{RTMailRecipientHasSubaddress}}}}
624           message  = messages to the Request Tracker system require a subject tag or a subaddress
625
626   deny    !hosts  = +debianhosts : 217.196.43.134
627           condition = ${if eq {$acl_m1}{PTSMail}}
628           condition = ${if def:h_X-PTS-Approved:{false}{true}}
629           message   = messages to the PTS require an X-PTS-Approved header
630
631   deny    condition      = ${if match {$message_body}{\Nhttp:\/\/[a-z\.-]+\/video1?.exe\N}}
632           message        = Blackisted URI found in body
633
634   deny    condition      = ${if eq {$acl_m1}{DBSignedMail}}
635           condition      = ${if and {{!match {$message_body}{PGP MESSAGE}}        \
636                                      {!match {$message_body}{PGP SIGNED MESSAGE}} \
637                                      {!match {$message_body}{PGP SIGNATURE}}      \
638                                     }                                             \
639                             }
640           message        = Mail to this address needs to be PGP-signed
641
642 # RFC 822 and 2822 say that headers must be ASCII.  This kinda emulates
643 # postfix's strict_7bit_headers option, but only checks a few common problem
644 # headers, as there doesn't appear to be an easy way to check them all.
645   deny
646           condition       = ${if or {{match {$rh_Subject:}{[\200-\377]}}\
647                                  {match {$rh_To:}{[\200-\377]}}\
648                                  {match {$rh_From:}{[\200-\377]}}\
649                                  {match {$rh_Cc:}{[\200-\377]}}}{true}{false}}
650           message         = improper use of 8-bit data in message header: message rejected
651
652   deny
653           condition       = ${if match {$rh_Subject:}{[^[:print:]]\{8\}}{true}{false}}
654           message         = Your mailer is not RFC 2047 compliant: message rejected
655
656 .ifdef CLAMAV
657   deny    
658           demime          = *
659           malware         = */defer_ok
660           message         = malware detected: $malware_name: message rejected
661 .endif
662
663   deny    spam            = $value/defer_ok
664           domains         = +handled_domains : +rcpthosts
665           message         = message got a spam score of $spam_score
666           local_parts     = ${if exists {/etc/exim4/sa_users}\
667                              {${if match_domain{$domain}{+virtual_domains}\
668                              {${lookup{$local_part@$domain}nwildlsearch{/etc/exim4/sa_users}{$local_part}{}}}\
669                              {${lookup{$local_part}lsearch{/etc/exim4/sa_users}{$local_part}{}}}}}}
670
671   # Check header_sender except for survey@popcon.d.o
672   deny    condition = ${if eq{$acl_m1}{PopconMail}{false}{true}}
673           !verify = header_sender
674           message = No valid sender found in the From:, Sender: and Reply-to: headers
675
676   accept
677
678
679
680 ######################################################################
681 #                      REWRITE CONFIGURATION                         #
682 ######################################################################
683
684
685
686 begin rewrite
687
688 \N^buildd_(.*)@ries\.debian\.org$\N buildd_$1@buildd.debian.org T
689 \N^buildd_(.*)@klecker\.debian\.org$\N buildd_$1@buildd.debian.org T
690 *@debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
691 *@people.debian.org ${lookup{$1}cdb{/var/lib/misc/${primary_hostname}/mail-forward.cdb}{$value}fail} T
692 #*@${primary_hostname} "${if exists{/etc/exim4/email-addresses}{${lookup{$1}lsearch{/etc/exim4/email-addresses}{$value}fail}}fail}" fFs
693 m68k@buildd.debian.org m68k-build@nocrew.org Ttrbc
694
695
696 #!!#######################################################!!#
697 #!!# Here follow routers created from the old routers,   #!!#
698 #!!# for handling non-local domains.                     #!!#
699 #!!#######################################################!!#
700
701 begin routers
702
703
704
705 ######################################################################
706 #                      ROUTERS CONFIGURATION                         #
707 #                Specifies how addresses are handled                 #
708 ######################################################################
709 #                          ORDER DOES MATTER                         #
710 #     An address is passed to each in turn until it is accepted.     #
711 ######################################################################
712
713 bsmtp:
714   debug_print = "R: bsmtp for $local_part@$domain"
715   driver = manualroute
716   domains = !+local_domains
717   require_files = /etc/exim4/bsmtp
718   route_list = * ${extract{file}{\
719                    ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
720                      {$value}fail}}}
721   transport = bsmtp
722
723 # This router routes to remote hosts over SMTP by explicit IP address,
724 # given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
725 # require this facility, which is why it is enabled by default in Exim.
726 ipliteral:
727   debug_print = "R: ipliteral for $local_part@$domain"
728   driver = ipliteral
729   domains = !+handled_domains
730   transport = remote_smtp
731   ignore_target_hosts = +reservedaddrs
732
733 # This router routes to remote hosts over SMTP using a DNS lookup.
734 # Ignore reserved network responses, including localhost.
735 dnslookup:
736   debug_print = "R: dnslookup for $local_part@$domain"
737   driver = dnslookup
738   domains = !+handled_domains
739   transport = remote_smtp
740   ignore_target_hosts = +reservedaddrs
741   no_more
742
743 # This allows local delivery to be forced, avoiding alias files and
744 # forwarding.
745
746 #real_local:
747 #  debug_print = "R: real_local for $local_part@$domain"
748 #  driver = accept
749 #  check_local_user
750 #  domains = lsearch;/etc/exim4/locals
751 #  local_part_prefix = real-
752 #  transport = local_delivery
753
754 # This router handles aliasing using a traditional /etc/aliases file.
755 # If any of your aliases expand to pipes or files, you will need to set
756 # up a user and a group for these deliveries to run under. You can do
757 # this by uncommenting the "user" option below (changing the user name
758 # as appropriate) and adding a "group" option if necessary.
759
760 system_aliases:
761   debug_print = "R: system_aliases for $local_part@$domain"
762   driver = redirect
763   allow_defer
764   allow_fail
765   data = ${lookup{$local_part}lsearch*{/etc/aliases}}
766   domains = +local_domains
767   file_transport = address_file
768   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
769   pipe_transport = address_pipe
770   retry_use_local_part
771
772 # This router handles forwarding using traditional .forward files.
773 # It also allows mail filtering when a forward file starts with the 
774 # string "# Exim filter": to disable filtering, uncomment the "filter" 
775 # option. The check_ancestor option means that if the forward file 
776 # generates an address that is an ancestor of the current one, the 
777 # current one gets passed on instead. This covers the case where A is 
778 # aliased to B and B has a .forward file pointing to A.
779
780 # For standard debian setup of one group per user, it is acceptable---normal
781 # even---for .forward to be group writable. If you have everyone in one
782 # group, you should comment out the "modemask" line. Without it, the exim
783 # default of 022 will apply, which is probably what you want.
784
785 userforward_verify:
786   debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
787   driver = redirect
788   check_ancestor
789   user = Debian-exim
790   no_check_local_user
791   directory_transport = address_directory
792   domains = +local_domains
793   # filter - I have disabled filtering to force users to use .forward-foo files
794   # or procmail. This will make it easier to move mailers in the future
795   #
796   # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
797   # also checks if the .forward-bar exists, if not then it uses
798   # .forward-default instead.
799   file = $home/.forward\
800          ${if eq{}{$local_part_suffix}{}{\
801            ${if exists {${home}/.forward${local_part_suffix}} \
802              {${local_part_suffix}}{-default}}\
803            }\
804           }
805   file_transport = address_file
806   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
807   local_part_suffix = -*
808   local_part_suffix_optional
809   modemask = 002
810   pipe_transport = address_pipe
811   reply_transport = address_reply
812   require_files = $home
813   router_home_directory = ${lookup passwd{$local_part}{${extract{5}{:}{$value}}}fail}
814   verify_only
815
816 userforward:
817   debug_print = "R: userforward for $local_part${local_part_suffix}@$domain"
818   driver = redirect
819   check_ancestor
820   check_local_user
821   directory_transport = address_directory
822   domains = +local_domains
823   # filter - I have disabled filtering to force users to use .forward-foo files
824   # or procmail. This will make it easier to move mailers in the future
825   #
826   # This bit does the qmailesque extension names, foo-bar@ is .forward-foo it
827   # also checks if the .forward-bar exists, if not then it uses
828   # .forward-default instead.
829   file = $home/.forward\
830          ${if eq{}{$local_part_suffix}{}{\
831            ${if exists {${home}/.forward${local_part_suffix}} \
832              {${local_part_suffix}}{-default}}\
833            }\
834           }
835   file_transport = address_file
836   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
837   local_part_suffix = -*
838   local_part_suffix_optional
839   modemask = 002
840   pipe_transport = address_pipe
841   reply_transport = address_reply
842   require_files = $home
843   no_verify
844
845 # This delivers to procmail
846 procmail:
847   debug_print = "R: procmail for $local_part@$domain"
848   driver = accept
849   check_local_user
850   domains = +local_domains
851   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
852   no_verify
853   no_expn
854   require_files = $local_part:$home/.procmailrc
855   transport = procmail_pipe
856   transport_current_directory = $home
857   
858 # This driver delivers to the LDAP generated alias file.
859 ldap_aliases:
860   debug_print = "R: ldap_aliases for $local_part@$domain"
861   driver = redirect
862   allow_defer
863   allow_fail
864   data = ${if exists{/var/lib/misc/$primary_hostname/mail-forward.cdb}\
865              {${lookup{$local_part}cdb\
866                {/var/lib/misc/$primary_hostname/mail-forward.cdb}}}}
867   domains = +local_domains
868   file_transport = address_file
869   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
870   pipe_transport = address_pipe
871   retry_use_local_part
872   
873 # This director matches local user mailboxes.
874 localuser:
875   debug_print = "R: localuser for $local_part@$domain"
876   driver = accept
877   check_local_user
878   domains = +local_domains
879   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
880   # Disable if the user has never logged in
881   require_files = $home
882   transport = local_delivery
883   no_more
884
885 # Now we begin the Virtual Domain configuration
886 # Everything before here should apply only to the local domains with a 
887 # domains= rule
888
889 # exim4 fails the router if it can't change to the user/group for delivery
890 # during verification.  So we have to seperate the cases of verifying
891 # the virts, and delivering to them.  blah.
892
893 # This router delivers for packages.d.o
894 packages:
895   debug_print = "R: packages for $local_part@$domain"
896   driver = redirect
897   file_transport = address_file
898   pipe_transport = address_pipe
899   domains = packages.debian.org
900   require_files = /org/packages.debian.org/conf/maintainer
901   data = ${lookup{$local_part}cdb{/org/packages.debian.org/conf/maintainer.cdb}}
902   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
903   transport_home_directory = /org/packages.debian.org/mail
904   transport_current_directory = /org/packages.debian.org/mail
905   check_ancestor
906   retry_use_local_part
907   no_more
908
909 .ifdef HAVE_USER_DEBBUGS
910 # This router delivers for bugs.d.o
911 bugs:
912   debug_print = "R: bugs for $local_part@$domain"
913   driver = accept
914   transport = bugs_pipe
915   domains = bugs.debian.org
916   cannot_route_message = Unknown or archived bug
917   require_files = /org/bugs.debian.org/mail/run-procmail
918   no_more
919   local_parts = ${if match\
920                   {$local_part}\
921                   {\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}\
922                {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
923                {$local_part}fail}}fail}
924 .endif
925
926 # This router delivers for rt.d.o
927 rt:
928   debug_print = "R: rt for $local_part@$domain"
929   driver = redirect
930   domains = rt.debian.org
931   require_files = /usr/bin/rt-mailgate : RT_QUEUE_MAP
932   local_parts = ${lookup{${sg{$local_part}{-comment}{}}}lsearch{RT_QUEUE_MAP}{$local_part}{}}
933   local_part_suffix = +*
934   local_part_suffix_optional
935   pipe_transport = rt_pipe
936   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}}"
937   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
938
939 virt_alias_verify:
940   debug_print = "R: virt_aliases for $local_part@$domain"
941   driver = redirect
942   data = ${if exists{\
943            ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
944            {${lookup{$local_part}lsearch*{\
945               ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
946            }}}}
947   directory_transport = address_directory
948   cannot_route_message = Unknown user
949   domains = +virtual_domains
950   file_transport = address_file
951   pipe_transport = address_pipe
952   qualify_preserve_domain
953   retry_use_local_part
954   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
955   transport_home_directory = ${extract{directory}{VDOMAINDATA}}
956   verify_only
957
958 virt_direct_verify:
959   debug_print = "R: virt_direct for $local_part@$domain"
960   driver = redirect
961   no_check_local_user
962   user = Debian-exim
963   allow_filter
964   modemask = 002
965   directory_transport = address_directory
966   domains = +virtual_domains
967   file = $home/.forward-\
968               ${if exists {${home}/.forward-${local_part}}{${local_part}}\
969                    {default}}
970   file_transport = address_file
971   pipe_transport = address_pipe
972   reply_transport = address_reply
973   retry_use_local_part
974   router_home_directory = ${extract{directory}{VDOMAINDATA}}
975   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
976   verify_only
977
978 # This is a senmailesque alias file lookup
979 virt_aliases:
980   debug_print = "R: virt_aliases for $local_part@$domain"
981   driver = redirect
982   allow_defer
983   allow_fail
984   data = ${if exists{\
985            ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
986            {${lookup{$local_part}lsearch*{\
987               ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
988            }}}}
989   directory_transport = address_directory
990   domains = +virtual_domains
991   file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
992   cannot_route_message = Unknown user
993   group = ${extract{group}{VDOMAINDATA}}
994   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
995   pipe_transport = address_pipe
996   qualify_preserve_domain
997   retry_use_local_part
998   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
999   transport_home_directory = ${extract{directory}{VDOMAINDATA}}
1000   no_verify
1001   user = ${extract{user}{VDOMAINDATA}}
1002   
1003 # This is a qmailesque deliver into a directory of .forward files
1004 virt_direct:
1005   debug_print = "R: virt_direct for $local_part@$domain"
1006   driver = redirect
1007   allow_filter
1008   allow_fail
1009   allow_defer
1010   no_check_local_user
1011   directory_transport = address_directory
1012   domains = +virtual_domains
1013   file = $home/.forward-\
1014               ${if exists {${home}/.forward-${local_part}}{${local_part}}\
1015                    {default}}
1016   file_transport = ${if eq {${extract{group_writable}{VDOMAINDATA}}}{true}{address_file_group}{address_file}}
1017   group = ${extract{group}{VDOMAINDATA}}
1018   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
1019   modemask = 002
1020   pipe_transport = address_pipe
1021   reply_transport = address_reply
1022   retry_use_local_part
1023   router_home_directory = ${extract{directory}{VDOMAINDATA}}
1024   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
1025   no_verify
1026   user = ${extract{user}{VDOMAINDATA}}
1027   #debug_print = .forward-${if exists {${home}/.forward-${local_part}} {${local_part}} {default}}
1028
1029 ######################################################################
1030 #                      TRANSPORTS CONFIGURATION                      #
1031 ######################################################################
1032 #                       ORDER DOES NOT MATTER                        #
1033 #     Only one appropriate transport is called for each delivery.    #
1034 ######################################################################
1035
1036
1037 begin transports
1038
1039 # This transport is used for local delivery to user mailboxes. On debian
1040 # systems group mail is used so we can write to the /var/mail
1041 # directory. (The alternative, which most other unixes use, is to deliver
1042 # as the user's own group, into a sticky-bitted directory)
1043 local_delivery:
1044   driver = appendfile
1045   file = /var/mail/${local_part}
1046   group = mail
1047   mode = 0660
1048   no_mode_fail_narrower
1049   return_path_add
1050   
1051 # This transport is used for handling pipe addresses generated by alias
1052 # or .forward files. It has a conventional name, since it is not actually
1053 # mentioned elsewhere in this configuration file. (A different name *can*
1054 # be specified via the "address_pipe_transport" option if you really want
1055 # to.) If the pipe generates any standard output, it is returned to the sender
1056 # of the message as a delivery error. Set return_fail_output instead if you
1057 # want this to happen only when the pipe fails to complete normally.
1058
1059 address_pipe:
1060   driver = pipe
1061   current_directory = ${home}
1062   environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1063                  EXT=${substr_1:${local_part_suffix}}:\
1064                  LOCAL=${local_part}${local_part_suffix}:\
1065                  RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1066   return_output
1067   return_path_add
1068
1069 # This transport is used for handling file addresses generated by alias
1070 # or .forward files. It has a conventional name, since it is not actually
1071 # mentioned elsewhere in this configuration file.
1072
1073 address_file:
1074   driver = appendfile
1075   return_path_add
1076
1077 address_file_group:
1078   driver = appendfile
1079   return_path_add
1080   mode = 0660
1081   directory_mode = 0770
1082   mode_fail_narrower = false
1083
1084 # This transport is used for handling file addresses generated by alias
1085 # or .forward files if the path ends in "/", which causes it to be treated
1086 # as a directory name rather than a file name. Each message is then delivered
1087 # to a unique file in the directory. If instead you want all such deliveries to
1088 # be in the "maildir" format that is used by some other mail software,
1089 # uncomment the final option below. If this is done, the directory specified
1090 # in the .forward or alias file is the base maildir directory.
1091 #
1092 # Should you want to be able to specify either maildir or non-maildir
1093 # directory-style deliveries, then you must set up yet another transport,
1094 # called address_directory2. This is used if the path ends in "//" so should
1095 # be the one used for maildir, as the double slash suggests another level
1096 # of directory. In the absence of address_directory2, paths ending in //
1097 # are passed to address_directory.
1098
1099 address_directory:
1100   driver = appendfile
1101   check_string = 
1102   maildir_format
1103   message_prefix = ""
1104   message_suffix = ""
1105   return_path_add
1106
1107 # This transport is used for handling autoreplies generated by the filtering
1108 # option of the forwardfile director. It has a conventional name, since it
1109 # is not actually mentioned elsewhere in this configuration file.
1110 address_reply:
1111   driver = autoreply
1112
1113 # This transport is used for delivering messages over SMTP connections.
1114
1115 remote_smtp:
1116   driver = smtp
1117   connect_timeout = 1m
1118   hosts_avoid_tls = *
1119
1120 # Send the message to procmail
1121 procmail_pipe:
1122   driver = pipe
1123   command = /usr/bin/procmail -a ${substr_1:${local_part_suffix}}}
1124   return_path_add
1125   user = ${local_part}
1126
1127 bsmtp:
1128   driver = appendfile
1129   batch_max = 100
1130   file = ${host}
1131   message_prefix = 
1132   message_suffix = 
1133   use_bsmtp
1134   user = ${extract{user}{\
1135                    ${lookup{$domain}partial-lsearch{/etc/exim4/bsmtp}\
1136                      {$value}fail}\
1137                    }}
1138
1139 .ifdef HAVE_USER_DEBBUGS
1140 bugs_pipe:
1141   driver = pipe
1142   command = /org/bugs.debian.org/mail/run-procmail
1143   environment = "EXTENSION=${substr_1:${local_part_suffix}}:\
1144                  EXT=${substr_1:${local_part_suffix}}:\
1145                  LOCAL=${local_part}${local_part_suffix}:\
1146                  RECIPIENT=${local_part}${local_part_suffix}@${domain}"
1147   return_path_add
1148   return_output
1149   user = debbugs
1150 .endif
1151
1152 rt_pipe:
1153   debug_print = "T: rt_pipe for $local_part${local_part_suffix}@$domain"
1154   driver = pipe
1155   return_fail_output
1156   environment = EXTENSION=${substr_1:${local_part_suffix}}
1157   allow_commands = /usr/bin/rt-mailgate
1158
1159
1160 ######################################################################
1161 #                      RETRY CONFIGURATION                           #
1162 ######################################################################
1163
1164 # This single retry rule applies to all domains and all errors. It specifies
1165 # retries every 15 minutes for 2 hours, then increasing retry intervals,
1166 # starting at 2 hours and increasing each time by a factor of 1.5, up to 16
1167 # hours, then retries every 8 hours until 4 days have passed since the first
1168 # failed delivery.
1169
1170 # Domain               Error       Retries
1171 # ------               -----       -------
1172
1173
1174 begin retry
1175
1176 debian.org             *           F,2h,10m; G,16h,2h,1.5; F,14d,8h
1177 *                      * senders=: F,2h,10m
1178 *                      rcpt_4xx    F,2h,5m;  F,4h,10m; F,4d,15m
1179 *                      *           F,2h,15m; G,16h,2h,1.5; F,4d,8h
1180
1181 # End of Exim 4 configuration