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