X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fexim%2Ftemplates%2Fmanualroute.erb;h=10f246ac65a251f981a10ea72da18133c6e0d049;hb=b4cb1b1c8b6900dabfb28bc5d9f15d6c16172f0a;hp=3eee472aeb1920d8fc0e5212023a67854a18e75a;hpb=17abf0658eb9488037debdebab62649e826462a6;p=dsa-puppet.git diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index 3eee472a..10f246ac 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -5,74 +5,36 @@ ## Format: ## domain: hostname[::port] options ## example: -## buildd.debian.org: raff.debian.org::587 byname +## buildd.debian.org: grieg.debian.org::587 byname <%= -routes = case fqdn - when 'spohr.debian.org', 'draghi.debian.org' then ' -agnesi.debian.org: agnesi.debian.org::25 -agricola.debian.org: agricola.debian.org::25 -albeniz.debian.org: albeniz.debian.org::25 -ancina.debian.org: ancina.debian.org::2025 -arcadelt.debian.org: arcadelt.debian.org::25 -argento.debian.org: argento.debian.org::25 -bartok.debian.org: bartok.debian.org::25 -brahms.debian.org: brahms.debian.org::25 -caballero.debian.org: caballero.debian.org::25 -crest.debian.org: crest.debian.org::25 -dijkstra.debian.org: dijkstra.debian.org::25 -escher.debian.org: escher.debian.org::25 -fano.debian.org: fano.debian.org::25 -finzi.debian.org: finzi.debian.org::25 -geo1.debian.org: geo1.debian.org::25 -geo2.debian.org: geo2.debian.org::25 -geo3.debian.org: geo3.debian.org::25 -gluck.debian.org: gluck.debian.org::25 -goedel.debian.org: goedel.debian.org::25 -goetz.debian.org: goetz.debian.org::25 -handel.debian.org: handel.debian.org::25 -kassia.debian.org: kassia.debian.org::587 -lafayette.debian.org: lafayette.debian.org::25 -lebrun.debian.org: lebrun.debian.org::25 -leisner.debian.org: leisner.debian.org::25 -lobos.debian.org: lobos.debian.org::25 -luchesi.debian.org: luchesi.debian.org::25 -mahler.debian.org: mahler.debian.org::25 -malo.debian.org: malo.debian.org::25 -mayer.debian.org: mayer.debian.org::25 -mayr.debian.org: mayr.debian.org::25 -merulo.debian.org: merulo.debian.org::25 -morales.debian.org: morales.debian.org::25 -mundy.debian.org: mundy.debian.org::25 -murphy.debian.org: murphy.debian.org::25 -paer.debian.org: paer.debian.org::25 -penalosa.debian.org: penalosa.debian.org::25 -pergolesi.debian.org: pergolesi.debian.org::25 -peri.debian.org: peri.debian.org::25 -pescetti.debian.org: pescetti.debian.org::25 -piatti.debian.org: piatti.debian.org::2025 -praetorius.debian.org: praetorius.debian.org::25 -puccini.debian.org: puccini.debian.org::25 -rem.debian.org: rem.debian.org::25 -rore.debian.org: rore.debian.org::25 -saens.debian.org: saens.debian.org::25 -schein.debian.org: schein.debian.org::25 -schroeder.debian.org: schroeder.debian.org::25 -schumann.debian.org: schumann.debian.org::25 -senfl.debian.org: senfl.debian.org::25 -sibelius.debian.org: sibelius.debian.org::25 -smetana.debian.org: smetana.debian.org::25 -soler.debian.org: soler.debian.org::25 -sperger.debian.org: sperger.debian.org::25 -spontini.debian.org: spontini.debian.org::25 -steffani.debian.org: steffani.debian.org::25 -unger.debian.org: unger.debian.org::25 -villa.debian.org: villa.debian.org::25 -voltaire.debian.org: voltaire.debian.org::25 -wieck.debian.org: wieck.debian.org::25 -zee.debian.org: zee.debian.org::25 -zelenka.debian.org: zelenka.debian.org::25 -' +mxmatches = [ scope.lookupvar('::fqdn') ] +routes = [] +extraroutes = [] + +if scope.lookupvar('site::nodeinfo')['mailrelay'] + mxmatches << 'mailout.debian.org' + mxmatches << 'INCOMING-MX' + extraroutes = [ "keyring.debian.org:\t\tkaufmann.debian.org" ] + extraroutes << "www-master.debian.org:\t\twolkenstein.debian.org" +end + +mxregex = Regexp.new('^\d+\s+(.*?)\.?$') +scope.lookupvar('site::allnodeinfo').keys.sort.each do |host| + next unless scope.lookupvar('site::allnodeinfo')[host]['mXRecord'] + scope.lookupvar('site::allnodeinfo')[host]['mXRecord'].each do |mx| + mxmatch = mxregex.match(mx) + if mxmatches.include?(mxmatch[1]) + route = host + ":\t\t" + host + if scope.lookupvar('site::localinfo').has_key?(host) and scope.lookupvar('site::localinfo')[host].has_key?('mail_port') and scope.lookupvar('site::localinfo')[host]['mail_port'].to_s != '' + route += "::" + scope.lookupvar('site::localinfo')[host]['mail_port'].to_s + end + routes << route + end + end end -routes + +routes << extraroutes + +routes.join("\n") %>