add bts profile for mail
[mirror/dsa-puppet.git] / modules / exim / templates / eximconf.erb
index 70ec3f4..bdb02f9 100644 (file)
 #           is much like a local domain, execpt that the delivery location
 #           and allowed set of users is controlled by a virtual domain
 #           alias file and not /etc/passwd. Wildcards are permitted
-#  rcpthosts - recipient hosts or relay domains. This is a list of
-#           all hosts that we mail exchange for. All domains that list
-#           this host in their MX records should be listed here. Wildcards
-#           are permitted.
 #  relayhosts - Hostnames that can send any arbitarily addressed mail to
 #           us. This is primarily only usefull for emergancy 'queue
 #           flushing' operations, but should be populated with a list
@@ -140,8 +136,7 @@ localpartlist postmasterish = postmaster : abuse : hostmaster : root
 
 # Domains we relay for; that is domains that aren't considered local but we 
 # accept mail for them.
-domainlist rcpthosts = partial-lsearch;/etc/exim4/rcpthosts
-hostlist debianhosts = 127.0.0.1 : net-lsearch;/var/lib/misc/thishost/debianhosts
+hostlist debianhosts = 127.0.0.1 : /var/lib/misc/thishost/debianhosts
 <%=
 out = ""
 if nodeinfo['mailrelay']
@@ -170,7 +165,7 @@ out
 # expensive, you can specify the networks for which a lookup is done, or
 # remove the setting entirely.
 host_lookup = *
-dns_ipv4_lookup = !localhost
+# dns_ipv4_lookup = !localhost (disabled upon sgrans request, zobel, 2010-03-16)
 
 # If this option is set, then any process that is running as one of the
 # listed users may pass a message to Exim and specify the sender's
@@ -219,7 +214,8 @@ delay_warning =
 <% if nodeinfo.has_key?('heavy_exim') and not nodeinfo['heavy_exim'].empty? %>
 queue_run_max = 50
 deliver_queue_load_max = 50
-queue_only_load = 15
+queue_only_load = 35
+smtp_load_reserve = 20
 <% else %>
 queue_run_max = 5
 deliver_queue_load_max = 10
@@ -239,7 +235,7 @@ ports = []
 out = "daemon_smtp_ports = "
 ports << 25
 
-if nodeinfo['bugsmaster']
+if nodeinfo['bugsmaster'] or nodeinfo['bugsmx']
   ports << 587
 end
 
@@ -329,6 +325,18 @@ out
 %>
 <%=
 out = ''
+if nodeinfo['bugsmaster']
+  out = '
+  warn    domains        = bugs.debian.org
+          set acl_m_rprf = BugsMail
+
+  accept  condition      = ${if eq {$acl_m_rprf}{}{no}{yes}}
+'
+end
+out
+%>
+<%=
+out = ''
 if nodeinfo['packagesmaster']
   out = '
   warn    domains        = packages.debian.org
@@ -492,7 +500,9 @@ if nodeinfo['smarthost'].empty?
 '
 else
   out = '
-  defer !hosts         = +debianhosts
+  drop !hosts          = +debianhosts
+       log_message     = mail from non-d.o host
+       message         = Interesting.  I doubt that should have happened.
 '
 end
 out
@@ -531,7 +541,6 @@ out
   accept  domains  = +local_domains
           hosts    = +debianhosts
           endpass
-         message  = unknown user
          verify   = recipient
 
 <%=
@@ -540,7 +549,6 @@ if nodeinfo['mailrelay']
   out = '
   accept  domains  = +mailhubdomains
           endpass
-         message  = unknown user
          verify   = recipient/callout=30s,defer_ok,use_sender,no_cache
 '
 end
@@ -549,7 +557,6 @@ out
 
   accept  domains  = +submission_domains
           endpass
-         message  = unknown user
          verify   = recipient
 
   deny    message = relay not permitted
@@ -787,7 +794,7 @@ if has_variable?("greylistd") && greylistd == "true"
                                  {/var/lib/greylistd/whitelist-hosts}{}} 
     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
     !authenticated = *
-    domains        = +handled_domains : +rcpthosts
+    domains        = +handled_domains
     condition      = ${readsocket{/var/run/greylistd/socket}\
                                  {--grey \
                                   $sender_host_address \
@@ -812,7 +819,7 @@ elsif has_variable?("postgrey") && postgrey == "true"
     !hosts         = : +debianhosts : WHITELIST
     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
     !authenticated = *
-    domains        = +handled_domains : +rcpthosts
+    domains        = +handled_domains
     local_parts    = GREYLIST_LOCAL_PARTS
     set acl_m_pgr  = request=smtpd_access_policy\n\
                      protocol_state=RCPT\n\
@@ -837,7 +844,7 @@ elsif has_variable?("postgrey") && postgrey == "true"
     !hosts         = : +debianhosts : WHITELIST
     condition      = ${if eq {$acl_m_prf}{PopconMail}{no}{yes}}
     !authenticated = *
-    domains        = +handled_domains : +rcpthosts
+    domains        = +handled_domains
     local_parts    = GREYLIST_LOCAL_PARTS
     condition      = ${if eq{${uc:${substr_0_7:$acl_m_pgr}}}{PREPEND}}
     message        = ${sg{$acl_m_pgr}{^\\\\w+\\\\s*}{}}
@@ -847,7 +854,7 @@ out
 %>
 
   accept  local_parts   = +postmasterish
-          domains       = +handled_domains : +rcpthosts
+          domains       = +handled_domains
 
   deny    hosts        = ${if exists{/etc/exim4/host_blacklist}{/etc/exim4/host_blacklist}{}}
           message      = I'm terribly sorry, but it seems you have been blacklisted
@@ -867,7 +874,7 @@ if nodeinfo['smarthost'].empty?
                     {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rbllist}}}{$value}{}}}{}}}\
                     {${lookup{$local_part}lsearch{/etc/exim4/rbllist}{$value}{}} : \
                     ${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rbl}{$value}{}}}}
-         domains       = +handled_domains : +rcpthosts
+         domains       = +handled_domains
          !hosts        = +debianhosts : WHITELIST
 '
 end
@@ -880,14 +887,14 @@ out
                     {${expand:${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/rhsbllist}}}{$value}{}}}}{}}}\
                     {${expand:${lookup{$local_part}lsearch{/etc/exim4/rhsbllist}{$value}{}}} : \
                     ${expand:${lookup{$local_part}lsearch{/var/lib/misc/$primary_hostname/mail-rhsbl}{$value}{}}}}}
-         domains       = +handled_domains : +rcpthosts
+         domains       = +handled_domains
          !hosts        = +debianhosts : WHITELIST
 
 <%= 
 out = ""
 if nodeinfo['smarthost'].empty?
   out = '
-  deny    domains  = +handled_domains : +rcpthosts
+  deny    domains  = +handled_domains
           local_parts   = ${if match_domain{$domain}{+virtual_domains}\
                           {${if exists {${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}\
                           {${lookup{$local_part}lsearch*{${extract{directory}{VDOMAINDATA}{${value}/callout_users}}}{$local_part}{}}}{}}}\
@@ -906,7 +913,6 @@ if nodeinfo['mailrelay']
   out = '
   accept  domains  = +mailhubdomains
           endpass
-         message  = unknown user
          verify   = recipient/callout=30s,defer_ok,use_sender,no_cache
 '
 end
@@ -914,14 +920,8 @@ out
 %>
   accept  domains  = +handled_domains
           endpass
-         message  = unknown user
          verify   = recipient/defer_ok
 
-  accept  domains  = +rcpthosts
-          endpass
-         message  = unrouteable address
-         verify   = recipient
-
   accept  hosts         = +debianhosts
 
   accept  authenticated = *
@@ -1312,6 +1312,8 @@ procmail:
   check_local_user
   domains = +local_domains
   headers_add = "Delivered-To: ${local_part}${local_part_suffix}@${domain}"
+  local_part_suffix = -*
+  local_part_suffix_optional
   no_verify
   no_expn
   require_files = $local_part:$home/.procmailrc
@@ -1378,20 +1380,24 @@ out
 
 <%=
 out = ""
-if nodeinfo['bugsmaster']
+if nodeinfo['bugsmaster'] or nodeinfo['bugsmx']
+  domain = 'bugs.debian.org'
+  if nodeinfo['bugsmaster']
+    domain = 'bugs-master.debian.org'
+  end
   out = '
 # This router delivers for bugs.d.o
 bugs:
   debug_print = "R: bugs for $local_part@$domain"
   driver = accept
   transport = bugs_pipe
-  domains = bugs.debian.org
+  domains = ' + domain + '
   cannot_route_message = Unknown or archived bug
   require_files = /org/bugs.debian.org/mail/run-procmail
   no_more
   local_parts = ${if match\
                   {$local_part}\
-                  {\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}\
+                  {\N^(\d+)(\d{2})(?:-(?:(?:submit|maintonly|quiet|forwarded|done|close|request|submitter)|(?:unsubscribe|ignore|help|(?:sub(?:scribe|help|yes|approve|reject))|unsubyes|bounce|probe|approve|reject|setlistyes|setlistsilentyes).*))?$\N}\
                {${if exists{/org/bugs.debian.org/spool/db-h/$2/$1$2.summary}\
               {$local_part}fail}}fail}
 '
@@ -1447,25 +1453,6 @@ end
 out
 %>
 
-virt_alias_verify:
-  debug_print = "R: virt_aliases for $local_part@$domain"
-  driver = redirect
-  data = ${if exists{\
-           ${extract{directory}{VDOMAINDATA}{${value}/aliases}}}\
-          {${lookup{$local_part}lsearch*{\
-              ${extract{directory}{VDOMAINDATA}{$value/aliases}}\
-          }}}}
-  directory_transport = address_directory
-  cannot_route_message = Unknown user
-  domains = +virtual_domains
-  file_transport = address_file
-  pipe_transport = address_pipe
-  qualify_preserve_domain
-  retry_use_local_part
-  transport_current_directory = ${extract{directory}{VDOMAINDATA}}
-  transport_home_directory = ${extract{directory}{VDOMAINDATA}}
-  verify_only
-
 virt_direct_verify:
   debug_print = "R: virt_direct for $local_part@$domain"
   driver = redirect
@@ -1508,7 +1495,6 @@ virt_aliases:
   retry_use_local_part
   transport_current_directory = ${extract{directory}{VDOMAINDATA}}
   transport_home_directory = ${extract{directory}{VDOMAINDATA}}
-  no_verify
   user = ${extract{user}{VDOMAINDATA}}
   
 # This is a qmailesque deliver into a directory of .forward files
@@ -1678,7 +1664,7 @@ bsmtp:
 
 <%=
 out = ""
-if nodeinfo['bugsmaster']
+if nodeinfo['bugsmaster'] or nodeinfo['bugsmx']
   out = '
 bugs_pipe:
   driver = pipe
@@ -1727,6 +1713,7 @@ out
 begin retry
 
 debian.org            *           F,2h,10m; G,16h,2h,1.5; F,14d,8h
+*                      * senders=: F,2h,10m
 *                      rcpt_4xx    F,2h,5m;  F,4h,10m; F,4d,15m
 *                      *           F,2h,15m; G,16h,2h,1.5; F,4d,8h