X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fexim%2Ftemplates%2Fmanualroute.erb;h=40062d8dccd1e7f218624c83c22df2552a870f57;hb=47956d833f29daab3137c1e71cbf0926bd7db5f4;hp=0b9df28abcff60991f5ea498868864bdf9cf390e;hpb=12070e19fd7d7a3f5b89b668d03444371eb4844f;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index 0b9df28ab..40062d8dc 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -8,45 +8,31 @@ ## buildd.debian.org: raff.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 -brahms.debian.org: brahms.debian.org::25 -crest.debian.org: crest.debian.org::25 -fano.debian.org: fano.debian.org::25 -finzi.debian.org: finzi.debian.org::25 -goedel.debian.org: goedel.debian.org::25 -goetz.debian.org: goetz.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 -mahler.debian.org: mahler.debian.org::25 -malo.debian.org: malo.debian.org::25 -mayer.debian.org: mayer.debian.org::25 -merulo.debian.org: merulo.debian.org::25 -morales.debian.org: morales.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 -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 -schroeder.debian.org: schroeder.debian.org::25 -smetana.debian.org: smetana.debian.org::25 -sperger.debian.org: sperger.debian.org::25 -spontini.debian.org: spontini.debian.org::25 -zee.debian.org: zee.debian.org::25 -zelenka.debian.org: zelenka.debian.org::25 -' +mxmatches = [ fqdn ] +routes = [] +extraroutes = [] + +if nodeinfo['mailrelay'] + mxmatches << 'mailout.debian.org' + extraroutes = [ "keyring.debian.org:\t\tkaufmann.debian.org" ] +end + +mxregex = Regexp.new('^\d+\s+(.*)\.$') +allnodeinfo.keys.sort.each do |host| + next unless allnodeinfo[host]['mXRecord'] + allnodeinfo[host]['mXRecord'].each do |mx| + mxmatch = mxregex.match(mx) + if mxmatches.include?(mxmatch[1]) + route = host + ":\t\t" + host + if localinfo.has_key?(host) and localinfo[host].has_key?('mail_port') and localinfo[host]['mail_port'].to_s != '' + route += "::" + localinfo[host]['mail_port'].to_s + end + routes << route + end + end end -routes + +routes << extraroutes + +routes.join("\n") %>