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