diff --git a/spec/classes/sympa_spec.rb b/spec/classes/sympa_spec.rb index 3986fe63d39b1a7b1d4f2647a7f1b52c3910b433..5276d930980e6d522364d494bd014499d968be3f 100644 --- a/spec/classes/sympa_spec.rb +++ b/spec/classes/sympa_spec.rb @@ -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.}) } 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 diff --git a/templates/sympa.conf.epp b/templates/sympa.conf.epp index 3c1dc54af620a402633659a2f15707881fe357b7..d27909e66cd34fc01ea693d1d8a4a6f159e363a9 100644 --- a/templates/sympa.conf.epp +++ b/templates/sympa.conf.epp @@ -46,13 +46,13 @@ wwsympa_url https://<%= $sympa::listdomain %>/sympa dkim_feature on 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_signature_apply_on <%= $sympa::dkim_signature_apply_on %> +dkim_signature_apply_on <%= $sympa::dkim_signature_apply_on.join(',') %> <% } else { -%> dkim_feature off <% } -%> <% 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 %> <% } else { -%> dmarc_protection.mode none