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