Skip to content

Commit

Permalink
smtpd_relay_restrictions are not related to the relay_host settings a…
Browse files Browse the repository at this point in the history
…nd were not used if postfix_relayhost was not defined
  • Loading branch information
tersmitten committed Jul 24, 2018
1 parent f06b4d1 commit c972826
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions templates/etc/postfix/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

{% if postfix_smtpd_relay_restrictions is defined %}
smtpd_relay_restrictions = {{ postfix_smtpd_relay_restrictions | join(', ') }}
{% endif %}
myhostname = {{ postfix_hostname }}
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
Expand All @@ -50,11 +47,8 @@ recipient_delimiter = +
inet_interfaces = {{ postfix_inet_interfaces }}
inet_protocols = {{ postfix_inet_protocols }}

{% if postfix_relayhost is defined %}
{% if postfix_relayhost %}
relayhost = [{{ postfix_relayhost }}]:{{ postfix_relayhost_port }}
{% else %}
relayhost =
{% endif %}
{% if postfix_sasl_auth_enable %}
smtp_sasl_auth_enable = {{ postfix_sasl_auth_enable | bool | ternary('yes', 'no') }}
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
Expand All @@ -69,6 +63,13 @@ smtp_tls_note_starttls_offer = yes
smtp_tls_CAfile = {{ postfix_smtp_tls_cafile }}
{% endif %}
{% endif %}
{% else %}
relayhost =
{% endif %}

{% if postfix_smtpd_relay_restrictions is defined %}
smtpd_relay_restrictions = {{ postfix_smtpd_relay_restrictions | join(', ') }}
{% endif %}

message_size_limit = {{ postfix_message_size_limit }}

Expand Down

0 comments on commit c972826

Please sign in to comment.