diff --git a/manifests/profile/mta.pp b/manifests/profile/mta.pp index 14294db0754668dd8ddd52bec2a8f94a1c21a33a..2182e9d9ddba26f8368b3e4fb198ef68438c2c3d 100644 --- a/manifests/profile/mta.pp +++ b/manifests/profile/mta.pp @@ -22,6 +22,9 @@ # @param extra_params # extra parameters to set in postfix # +# @param virtual_aliases +# hash mapping source to target addresses to be added to postfix's virtual_alias map +# class tails::profile::mta ( String $myhostname = $facts['networking']['fqdn'], String $myorigin = $facts['networking']['fqdn'], @@ -30,6 +33,7 @@ class tails::profile::mta ( Boolean $allow_trusted_subnets = true, Boolean $monitor = true, Hash $extra_params = {}, + Hash $virtual_aliases = {}, ) { if $allow_trusted_subnets { $allmynetworks = $mynetworks + lookup('tirewall::trusted_subnets', Array, 'first', []) @@ -129,6 +133,14 @@ class tails::profile::mta ( }, } + $virtual_aliases.each | String $source, String $target | { + concat::fragment { "postfix::map: virtual alias for ${source}": + target => '/etc/postfix/maps/virtual_alias', + content => "${source} ${target}", + require => Class['postfix'], + } + } + include tails::profile::rspamd if $monitor { include monitoring::checkcommands::mailqueue