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