X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fexim%2Ftemplates%2Fmanualroute.erb;h=40062d8dccd1e7f218624c83c22df2552a870f57;hb=47956d833f29daab3137c1e71cbf0926bd7db5f4;hp=2b84b4ede1d4545636d64d513014aba7c901d020;hpb=09ab0b0f5d21744817de20b116633bd108272ab8;p=mirror%2Fdsa-puppet.git diff --git a/modules/exim/templates/manualroute.erb b/modules/exim/templates/manualroute.erb index 2b84b4ede..40062d8dc 100644 --- a/modules/exim/templates/manualroute.erb +++ b/modules/exim/templates/manualroute.erb @@ -12,15 +12,15 @@ mxmatches = [ fqdn ] routes = [] extraroutes = [] -case fqdn -when 'spohr.debian.org', 'draghi.debian.org', 'merikanto.debian.org' then +if nodeinfo['mailrelay'] mxmatches << 'mailout.debian.org' extraroutes = [ "keyring.debian.org:\t\tkaufmann.debian.org" ] end mxregex = Regexp.new('^\d+\s+(.*)\.$') -mxinfo.keys.sort.each do |host| - mxinfo[host]['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