File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ postfix:
156
156
smtp_use_tls : ' yes'
157
157
smtp_tls_cert_file : /etc/postfix/ssl/example.com-relay-client-cert.crt
158
158
smtp_tls_key_file : /etc/postfix/ssl/example.com-relay-client-cert.key
159
+ smtp_tls_policy_maps : hash:/etc/postfix/tls_policy
159
160
160
161
smtp_sasl_password_maps : hash:/etc/postfix/sasl_passwd
161
162
sender_canonical_maps : hash:/etc/postfix/sender_canonical
@@ -165,6 +166,10 @@ postfix:
165
166
transport :
166
167
DOMAIN_NAME : ' :[IP_ADDRESS]'
167
168
169
+ tls_policy :
170
+ example.com : encrypt
171
+ .example.com : encrypt
172
+
168
173
vmail :
169
174
user : postfix_user
170
175
password : DB_PASSWD
Original file line number Diff line number Diff line change @@ -101,6 +101,27 @@ run-postmap:
101
101
- file : {{ postfix.config_path }}/ transport
102
102
{% endif % }
103
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
+
104
125
{%- for domain in salt[' pillar.get' ](' postfix:certificates' , {}).keys() % }
105
126
106
127
postfix_{{ domain }}_ssl_certificate:
Original file line number Diff line number Diff line change
1
+ #
2
+ # This file is managed by salt
3
+ #
4
+
5
+ {% set config = salt['pillar.get']('postfix:tls_policy', {}) -%}
6
+ {% macro set_parameter(parameter, default=None) -%}
7
+ {% set value = config.get(parameter, default) -%}
8
+ {% if value is not none -%}
9
+ {{ parameter }} {{ value }}
10
+ {% endif -%}
11
+ {% endmacro -%}
12
+
13
+ {# Accept arbitrary parameters -#}
14
+ {% for parameter in config -%}
15
+ {{ set_parameter(parameter) }}
16
+ {% endfor -%}
17
+
You can’t perform that action at this time.
0 commit comments