Create an exim::manualroute define
[mirror/dsa-puppet.git] / modules / exim / manifests / manualroute.pp
1 # register an exim manualroute on the mail relays
2 #
3 # @param domain     email domain (defaults to $name)
4 # @param target     targethost
5 # @param mailport   targetport (defaults to exim::mail_port if set, else 25)
6 define exim::manualroute (
7   String $domain = $name,
8   String $target = $::fqdn,
9   Optional[Integer] $mailport = undef,
10 ) {
11   if $mailport {
12     $port = $mailport
13   } else {
14     $port = lookup( { 'name' => 'exim::mail_port', 'default_value' => 25 } )
15   }
16
17   @@concat::fragment { "manualroute-to-${::domain}":
18     tag     => 'exim::manualroute::to::mailrelay',
19     target  => '/etc/exim4/manualroute',
20     content => "${::domain}:   ${::target}::${port}",
21   }
22 }