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