]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/exim/templates/manualroute.erb
<weasel> zobel: why are you moving MX to a machine with loads of disk? why not pick...
[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 case fqdn
13 when 'spohr.debian.org', 'draghi.debian.org', 'merikanto.debian.org' then
14   mxmatches << 'mailout.debian.org'
15 end
16
17 routes = []
18
19 mxregex = Regexp.new('^\d+\s+(.*)\.$')
20 mxinfo.keys.sort.each do |host|
21   mxinfo[host][0]['mXRecord'].each do |mx|
22     mxmatch = mxregex.match(mx)
23     if mxmatches.include?(mxmatch[1])
24       route = host + ":\t\t" + host
25       if localinfo.has_key?(host) and localinfo[host].has_key?('mail_port') and localinfo[host]['mail_port'].to_s != ''
26         route += "::" + localinfo[host]['mail_port'].to_s
27       end
28       routes << route
29     end
30   end
31 end
32
33 routes.join("\n")
34 %>