Skip to content
Snippets Groups Projects
Commit 022829f3 authored by Fabien Combernous's avatar Fabien Combernous
Browse files

Fix template for dkim_signature_apply_on and dmarc_protection.mode arrays

parent bcce1cab
No related branches found
No related tags found
1 merge request!16Resolve "Fix template for dkim_signature_apply_on and dmarc_protection.mode arrays"
Pipeline #93884 passed
...@@ -99,6 +99,23 @@ describe 'sympa' do ...@@ -99,6 +99,23 @@ describe 'sympa' do
it { is_expected.to compile.and_raise_error(%r{With dkim_feature true, dkim_private_key is mandatory.}) } it { is_expected.to compile.and_raise_error(%r{With dkim_feature true, dkim_private_key is mandatory.}) }
end end
context 'with dkim_feature and dmarc_protection enabled' do
let(:params) do
{
dkim_feature: true,
dkim_private_key: '/etc/sympa/foo.key',
dmarc_protection: true,
}
end
it { is_expected.to compile.with_all_deps }
it do
is_expected.to contain_file('/home/sympa/etc/sympa.conf') \
.with_content(%r{^dkim_signature_apply_on\s+any$}) \
.with_content(%r{^dmarc_protection\.mode\s+all$})
end
end
end end
end end
end end
...@@ -46,13 +46,13 @@ wwsympa_url https://<%= $sympa::listdomain %>/sympa ...@@ -46,13 +46,13 @@ wwsympa_url https://<%= $sympa::listdomain %>/sympa
dkim_feature on dkim_feature on
dkim_parameters.private_key_path <%= $sympa::prefix_path %>/<%= $sympa::sysconf_dir %>/dkim/<%= $sympa::listdomain %>/<%= $sympa::dkim_selector %>.key dkim_parameters.private_key_path <%= $sympa::prefix_path %>/<%= $sympa::sysconf_dir %>/dkim/<%= $sympa::listdomain %>/<%= $sympa::dkim_selector %>.key
dkim_parameters.selector <%= $sympa::dkim_selector %> dkim_parameters.selector <%= $sympa::dkim_selector %>
dkim_signature_apply_on <%= $sympa::dkim_signature_apply_on %> dkim_signature_apply_on <%= $sympa::dkim_signature_apply_on.join(',') %>
<% } else { -%> <% } else { -%>
dkim_feature off dkim_feature off
<% } -%> <% } -%>
<% if $sympa::dmarc_protection { -%> <% if $sympa::dmarc_protection { -%>
dmarc_protection.mode <%= $sympa::dmarc_protection_mode %> dmarc_protection.mode <%= $sympa::dmarc_protection_mode.join(',') %>
dmarc_protection.phrase <%= $sympa::dmarc_protection_phrase %> dmarc_protection.phrase <%= $sympa::dmarc_protection_phrase %>
<% } else { -%> <% } else { -%>
dmarc_protection.mode none dmarc_protection.mode none
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment