Skip to content

Commit

Permalink
refactor(maps): move tls_policy and transport to mapping section
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>

BREAKING CHANGE: `transport` and `tls_policy` keys in `postfix:config` have been moved to the standard `postfix:mapping`.
  • Loading branch information
Felipe Zipitria committed Jun 6, 2020
1 parent 42965a7 commit 06276fd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 83 deletions.
15 changes: 8 additions & 7 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ postfix:

local_transport: virtual
local_recipient_maps: $virtual_mailbox_maps
# Use the `mapping` key to define the map
transport_maps: hash:/etc/postfix/transport

# SMTP server
Expand Down Expand Up @@ -163,13 +164,6 @@ postfix:
relay_recipient_maps: hash:/etc/postfix/relay_domains
virtual_alias_maps: hash:/etc/postfix/virtual

transport:
DOMAIN_NAME: ':[IP_ADDRESS]'

tls_policy:
example.com: encrypt
.example.com: encrypt

vmail:
user: postfix_user
password: DB_PASSWD
Expand Down Expand Up @@ -234,6 +228,13 @@ postfix:
-----END RSA PRIVATE KEY-----
mapping:
transport_maps:
- DOMAIN_NAME: ':[IP_ADDRESS]'

smpt_tls_policy_maps:
- example.com: encrypt
- .example.com: encrypt

smtp_sasl_password_maps:
- smtp.example.com: myaccount:somepassword

Expand Down
42 changes: 0 additions & 42 deletions postfix/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -80,48 +80,6 @@ include:
postfix_master_services: {{ postfix_master_services|tojson }}
{% endif %}
{% if 'transport' in pillar.get('postfix', '') %}
{{ postfix.config_path }}/transport:
file.managed:
- source: salt://postfix/files/transport
- user: root
- group: {{ postfix.root_grp }}
- mode: 644
- require:
- pkg: postfix
- watch_in:
- service: postfix
- template: jinja
run-postmap:
cmd.wait:
- name: {{ postfix.xbin_prefix }}/sbin/postmap {{ postfix.config_path }}/transport
- cwd: /
- watch:
- file: {{ postfix.config_path }}/transport
{% endif %}
{% if 'tls_policy' in pillar.get('postfix', '') %}
{{ postfix.config_path }}/tls_policy:
file.managed:
- source: salt://postfix/files/tls_policy
- user: root
- group: {{ postfix.root_grp }}
- mode: 644
- require:
- pkg: postfix
- watch_in:
- service: postfix
- template: jinja
run-postmap-tls-policy:
cmd.wait:
- name: {{ postfix.xbin_prefix }}/sbin/postmap {{ postfix.config_path }}/tls_policy
- cwd: /
- watch:
- file: {{ postfix.config_path }}/tls_policy
{% endif %}
{%- for domain in salt['pillar.get']('postfix:certificates', {}).keys() %}
postfix_{{ domain }}_ssl_certificate:
Expand Down
17 changes: 0 additions & 17 deletions postfix/files/tls_policy

This file was deleted.

17 changes: 0 additions & 17 deletions postfix/files/transport

This file was deleted.

0 comments on commit 06276fd

Please sign in to comment.