Skip to content
Snippets Groups Projects
Commit fe0288e7 authored by Trey Dockendorf's avatar Trey Dockendorf
Browse files

Add manage_root_alias parameter to disable management of root's mailalias resource

parent 5205360b
Branches
Tags
No related merge requests found
......@@ -9,6 +9,7 @@ class postfix::files {
$master_smtps = $postfix::master_smtps
$master_submission = $postfix::master_submission
$myorigin = $postfix::myorigin
$manage_root_alias = $postfix::manage_root_alias
$root_mail_recipient = $postfix::root_mail_recipient
$smtp_listen = $postfix::_smtp_listen
$use_amavisd = $postfix::use_amavisd
......@@ -90,8 +91,11 @@ class postfix::files {
default: {}
}
if $manage_root_alias {
mailalias {'root':
recipient => $root_mail_recipient,
notify => Exec['newaliases'],
}
}
}
......@@ -89,6 +89,7 @@ class postfix (
$mynetworks = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', # postfix_mynetworks
$myorigin = $::fqdn,
$relayhost = undef, # postfix_relayhost
$manage_root_alias = true,
$root_mail_recipient = 'nobody', # root_mail_recipient
$satellite = false,
$smtp_listen = '127.0.0.1', # postfix_smtp_listen
......@@ -104,6 +105,7 @@ class postfix (
validate_bool($ldap)
validate_bool($mailman)
validate_bool($mta)
validate_bool($manage_root_alias)
validate_bool($satellite)
validate_bool($use_amavisd)
validate_bool($use_dovecot_lda)
......
......@@ -289,6 +289,12 @@ describe 'postfix' do
is_expected.to contain_file('/etc/postfix/master.cf').with_content(/sympa/)
end
end
context 'when manage_root_alias is false' do
let(:params) { { :manage_root_alias => false } }
it 'should not manage root mailalias' do
is_expected.not_to contain_mailalias('root')
end
end
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment