X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fexim%2Ftemplates%2Fmanualroute.erb;h=ce22a342b867ca9adfa9a4e5021a94d3111889da;hb=755d7470838a052d1042e46e5f9cd3ae1009bdd6;hp=c798cc9104827a8e295adcf27ea1fd33cb2395d9;hpb=2ca083e7949b5c17c4188dd30ca77634620a7591;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index c798cc910..ce22a342b 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -9,16 +9,17 @@ <%= mxmatches = [ fqdn ] -case fqdn -when 'spohr.debian.org', 'draghi.debian.org', 'merikanto.debian.org' then +routes = [] +extraroutes = [] + +if nodeinfo['mailrelay'] mxmatches << 'mailout.debian.org' + extraroutes = [ "keyring.debian.org:\t\tkaufmann.debian.org" ] end -routes = [] - mxregex = Regexp.new('^\d+\s+(.*)\.$') mxinfo.keys.sort.each do |host| - mxinfo[host][0]['mXRecord'].each do |mx| + mxinfo[host]['mXRecord'].each do |mx| mxmatch = mxregex.match(mx) if mxmatches.include?(mxmatch[1]) route = host + ":\t\t" + host @@ -30,5 +31,7 @@ mxinfo.keys.sort.each do |host| end end +routes << extraroutes + routes.join("\n") %>