Commit 52cfe0ea authored by Raphaël Pinson's avatar Raphaël Pinson Committed by GitHub
Browse files

Merge pull request #133 from treydock/add-manage_root_alias-parameter

Add manage_root_alias parameter
parents 5205360b fe0288e7
...@@ -9,6 +9,7 @@ class postfix::files { ...@@ -9,6 +9,7 @@ class postfix::files {
$master_smtps = $postfix::master_smtps $master_smtps = $postfix::master_smtps
$master_submission = $postfix::master_submission $master_submission = $postfix::master_submission
$myorigin = $postfix::myorigin $myorigin = $postfix::myorigin
$manage_root_alias = $postfix::manage_root_alias
$root_mail_recipient = $postfix::root_mail_recipient $root_mail_recipient = $postfix::root_mail_recipient
$smtp_listen = $postfix::_smtp_listen $smtp_listen = $postfix::_smtp_listen
$use_amavisd = $postfix::use_amavisd $use_amavisd = $postfix::use_amavisd
...@@ -90,8 +91,11 @@ class postfix::files { ...@@ -90,8 +91,11 @@ class postfix::files {
default: {} default: {}
} }
mailalias {'root': if $manage_root_alias {
recipient => $root_mail_recipient, mailalias {'root':
notify => Exec['newaliases'], recipient => $root_mail_recipient,
notify => Exec['newaliases'],
}
} }
} }
...@@ -89,6 +89,7 @@ class postfix ( ...@@ -89,6 +89,7 @@ class postfix (
$mynetworks = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', # postfix_mynetworks $mynetworks = '127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128', # postfix_mynetworks
$myorigin = $::fqdn, $myorigin = $::fqdn,
$relayhost = undef, # postfix_relayhost $relayhost = undef, # postfix_relayhost
$manage_root_alias = true,
$root_mail_recipient = 'nobody', # root_mail_recipient $root_mail_recipient = 'nobody', # root_mail_recipient
$satellite = false, $satellite = false,
$smtp_listen = '127.0.0.1', # postfix_smtp_listen $smtp_listen = '127.0.0.1', # postfix_smtp_listen
...@@ -104,6 +105,7 @@ class postfix ( ...@@ -104,6 +105,7 @@ class postfix (
validate_bool($ldap) validate_bool($ldap)
validate_bool($mailman) validate_bool($mailman)
validate_bool($mta) validate_bool($mta)
validate_bool($manage_root_alias)
validate_bool($satellite) validate_bool($satellite)
validate_bool($use_amavisd) validate_bool($use_amavisd)
validate_bool($use_dovecot_lda) validate_bool($use_dovecot_lda)
......
...@@ -289,6 +289,12 @@ describe 'postfix' do ...@@ -289,6 +289,12 @@ describe 'postfix' do
is_expected.to contain_file('/etc/postfix/master.cf').with_content(/sympa/) is_expected.to contain_file('/etc/postfix/master.cf').with_content(/sympa/)
end end
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 end
end end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment