|
110 | 110 | value: 'off',
|
111 | 111 | match: ' xclient off;'
|
112 | 112 | },
|
113 |
| - { |
114 |
| - title: 'should set proxy_protocol', |
115 |
| - attr: 'proxy_protocol', |
116 |
| - value: 'off', |
117 |
| - match: ' proxy_protocol off;' |
118 |
| - }, |
119 |
| - { |
120 |
| - title: 'should set proxy_smtp_auth', |
121 |
| - attr: 'proxy_smtp_auth', |
122 |
| - value: 'off', |
123 |
| - match: ' proxy_smtp_auth off;' |
124 |
| - }, |
125 | 113 | {
|
126 | 114 | title: 'should set auth_http',
|
127 | 115 | attr: 'auth_http',
|
|
254 | 242 | end
|
255 | 243 | end
|
256 | 244 | end
|
| 245 | + context 'mail proxy parameters' do |
| 246 | + let(:pre_condition) { ['class { "nginx": nginx_version => "1.20.0"}'] } |
| 247 | + let(:params) do |
| 248 | + { |
| 249 | + listen_port: 25, |
| 250 | + ipv6_enable: true, |
| 251 | + ssl_cert: 'dummy.crt', |
| 252 | + ssl_key: 'dummy.key' |
| 253 | + } |
| 254 | + end |
| 255 | + |
| 256 | + it 'configures mail proxy settings' do |
| 257 | + content = catalogue.resource('concat::fragment', "#{title}-header").send(:parameters)[:content] |
| 258 | + expect(content).to include('proxy_protocol off;') |
| 259 | + expect(content).to include('proxy_smtp_auth off;') |
| 260 | + end |
| 261 | + end |
257 | 262 | end
|
258 | 263 |
|
259 | 264 | describe 'mailhost template content for imap' do
|
|
548 | 553 | title: 'should set the IPv4 SSL listen port',
|
549 | 554 | attr: 'ssl_port',
|
550 | 555 | value: 45,
|
551 |
| - match: ' listen *:45;' |
| 556 | + match: ' listen *:45 ssl;' |
552 | 557 | },
|
553 | 558 | {
|
554 | 559 | title: 'should enable IPv6',
|
|
598 | 603 | value: 'off',
|
599 | 604 | match: ' xclient off;'
|
600 | 605 | },
|
601 |
| - { |
602 |
| - title: 'should set proxy_protocol', |
603 |
| - attr: 'proxy_protocol', |
604 |
| - value: 'off', |
605 |
| - match: ' proxy_protocol off;' |
606 |
| - }, |
607 |
| - { |
608 |
| - title: 'should set proxy_smtp_auth', |
609 |
| - attr: 'proxy_smtp_auth', |
610 |
| - value: 'off', |
611 |
| - match: ' proxy_smtp_auth off;' |
612 |
| - }, |
613 | 606 | {
|
614 | 607 | title: 'should set auth_http',
|
615 | 608 | attr: 'auth_http',
|
|
712 | 705 | expect(content).to include('listen *:587 ssl;')
|
713 | 706 | end
|
714 | 707 | end
|
| 708 | + |
| 709 | + context 'mail proxy parameters' do |
| 710 | + let(:pre_condition) { ['class { "nginx": nginx_version => "1.20.0"}'] } |
| 711 | + |
| 712 | + it 'configures mail proxy settings' do |
| 713 | + content = catalogue.resource('concat::fragment', "#{title}-ssl").send(:parameters)[:content] |
| 714 | + expect(content).to include('proxy_protocol off;') |
| 715 | + expect(content).to include('proxy_smtp_auth off;') |
| 716 | + end |
| 717 | + end |
715 | 718 | end
|
716 | 719 | end
|
717 | 720 |
|
|
0 commit comments