Skip to content

Commit 06276fd

Browse files
author
Felipe Zipitria
committed
refactor(maps): move tls_policy and transport to mapping section
Signed-off-by: Felipe Zipitria <[email protected]> BREAKING CHANGE: `transport` and `tls_policy` keys in `postfix:config` have been moved to the standard `postfix:mapping`.
1 parent 42965a7 commit 06276fd

File tree

4 files changed

+8
-83
lines changed

4 files changed

+8
-83
lines changed

pillar.example

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ postfix:
122122

123123
local_transport: virtual
124124
local_recipient_maps: $virtual_mailbox_maps
125+
# Use the `mapping` key to define the map
125126
transport_maps: hash:/etc/postfix/transport
126127

127128
# SMTP server
@@ -163,13 +164,6 @@ postfix:
163164
relay_recipient_maps: hash:/etc/postfix/relay_domains
164165
virtual_alias_maps: hash:/etc/postfix/virtual
165166

166-
transport:
167-
DOMAIN_NAME: ':[IP_ADDRESS]'
168-
169-
tls_policy:
170-
example.com: encrypt
171-
.example.com: encrypt
172-
173167
vmail:
174168
user: postfix_user
175169
password: DB_PASSWD
@@ -234,6 +228,13 @@ postfix:
234228
-----END RSA PRIVATE KEY-----
235229
236230
mapping:
231+
transport_maps:
232+
- DOMAIN_NAME: ':[IP_ADDRESS]'
233+
234+
smpt_tls_policy_maps:
235+
- example.com: encrypt
236+
- .example.com: encrypt
237+
237238
smtp_sasl_password_maps:
238239
- smtp.example.com: myaccount:somepassword
239240

postfix/config.sls

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -80,48 +80,6 @@ include:
8080
postfix_master_services: {{ postfix_master_services|tojson }}
8181
{% endif %}
8282
83-
{% if 'transport' in pillar.get('postfix', '') %}
84-
{{ postfix.config_path }}/transport:
85-
file.managed:
86-
- source: salt://postfix/files/transport
87-
- user: root
88-
- group: {{ postfix.root_grp }}
89-
- mode: 644
90-
- require:
91-
- pkg: postfix
92-
- watch_in:
93-
- service: postfix
94-
- template: jinja
95-
96-
run-postmap:
97-
cmd.wait:
98-
- name: {{ postfix.xbin_prefix }}/sbin/postmap {{ postfix.config_path }}/transport
99-
- cwd: /
100-
- watch:
101-
- file: {{ postfix.config_path }}/transport
102-
{% endif %}
103-
104-
{% if 'tls_policy' in pillar.get('postfix', '') %}
105-
{{ postfix.config_path }}/tls_policy:
106-
file.managed:
107-
- source: salt://postfix/files/tls_policy
108-
- user: root
109-
- group: {{ postfix.root_grp }}
110-
- mode: 644
111-
- require:
112-
- pkg: postfix
113-
- watch_in:
114-
- service: postfix
115-
- template: jinja
116-
117-
run-postmap-tls-policy:
118-
cmd.wait:
119-
- name: {{ postfix.xbin_prefix }}/sbin/postmap {{ postfix.config_path }}/tls_policy
120-
- cwd: /
121-
- watch:
122-
- file: {{ postfix.config_path }}/tls_policy
123-
{% endif %}
124-
12583
{%- for domain in salt['pillar.get']('postfix:certificates', {}).keys() %}
12684
12785
postfix_{{ domain }}_ssl_certificate:

postfix/files/tls_policy

Lines changed: 0 additions & 17 deletions
This file was deleted.

postfix/files/transport

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)