X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fexim%2Ftemplates%2Fmanualroute.erb;h=40062d8dccd1e7f218624c83c22df2552a870f57;hb=99c219736c3c52f933f120c4411ef8e984f5f9d1;hp=457d4da241405b7ff998432fbdf16220d459ed77;hpb=906277d3c7c09fa4437fdc4a87cab4b7896bfe67;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index 457d4da24..40062d8dc 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -9,16 +9,18 @@ <%= mxmatches = [ fqdn ] -case fqdn -when 'spohr.debian.org', 'draghi.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| +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 @@ -30,5 +32,7 @@ mxinfo.keys.sort.each do |host| end end +routes << extraroutes + routes.join("\n") %>