Add template for sasl auth configuration

This commit is contained in:
phil 2023-03-31 17:19:01 +02:00
parent 8cf866e399
commit 649e769424
3 changed files with 12 additions and 1 deletions

View file

@ -46,6 +46,7 @@
- relay_by_sender
- relay_checks
- sender_checks
- smtp_sasl_auth_password
- transport_global_exceptions
- transport_relay
notify: reload postfix

View file

@ -0,0 +1,5 @@
#{{ ansible_managed }}
{% if postfix_smtp_sasl_auth is defined %}
{{ "%-50s %s:%s" | format(postfix_smtp_sasl_auth_relay, postfix_smtp_sasl_auth_user, postfix_smtp_sasl_auth_password) }}
{% endif %}

View file

@ -123,7 +123,12 @@ smtpd_sasl_exceptions_networks = {{ postfix_smtpd_sasl_exceptions_networks | joi
### SMTP Auth client side
smtp_sasl_auth_enable = yes
smtp_sasl_auth_soft_bounce = no
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
{% if postfix_smtp_sasl_password_maps is defined %}
smtp_sasl_password_maps =
{% for map in postfix_smtp_sasl_password_maps %}
{{ map.type }}:{{ map.path }}
{% endfor %}
{% endif %}
smtp_sasl_security_options = noanonymous
{% endif %}