]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/exim/templates/manualroute.erb
40062d8dccd1e7f218624c83c22df2552a870f57
[dsa-puppet.git] / modules / exim / templates / manualroute.erb
1 ##
2 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
3 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
4 ##
5 ## Format:
6 ## domain: hostname[::port] options
7 ## example:
8 ## buildd.debian.org: raff.debian.org::587 byname
9
10 <%=
11 mxmatches = [ fqdn ]
12 routes = []
13 extraroutes = []
14
15 if nodeinfo['mailrelay']
16   mxmatches << 'mailout.debian.org'
17   extraroutes = [ "keyring.debian.org:\t\tkaufmann.debian.org" ]
18 end
19
20 mxregex = Regexp.new('^\d+\s+(.*)\.$')
21 allnodeinfo.keys.sort.each do |host|
22   next unless allnodeinfo[host]['mXRecord']
23   allnodeinfo[host]['mXRecord'].each do |mx|
24     mxmatch = mxregex.match(mx)
25     if mxmatches.include?(mxmatch[1])
26       route = host + ":\t\t" + host
27       if localinfo.has_key?(host) and localinfo[host].has_key?('mail_port') and localinfo[host]['mail_port'].to_s != ''
28         route += "::" + localinfo[host]['mail_port'].to_s
29       end
30       routes << route
31     end
32   end
33 end
34
35 routes << extraroutes
36
37 routes.join("\n")
38 %>