Try to fix the virtualhost behaviour

This commit is contained in:
Andrea Dell'Amico 2020-09-28 18:15:58 +02:00
parent 5517833232
commit eb904bf219
1 changed files with 7 additions and 9 deletions

View File

@ -36,9 +36,8 @@ mail_owner = postfix
# other configuration parameters.
#
myhostname = {{ ansible_fqdn }}
{% if postfix_use_domain_name is defined and postfix_use_domain_name %}
{% elif domain_name is defined %}
mydomain = {{ domain_name }}
{% if postfix_use_domain_name %}
mydomain = {% if domain_name is defined %}{{ domain_name }}{% else %}{{ ansible_fqdn }}{% endif %}
{% else %}
mydomain = {{ ansible_fqdn }}
{% endif %}
@ -56,8 +55,8 @@ mydomain = {{ ansible_fqdn }}
# myorigin also specifies the default domain name that is appended
# to recipient addresses that have no @domain part.
#
{% if domain_name is defined %}
myorigin = {{ domain_name }}
{% if postfix_use_domain_name %}
myorigin = {% if domain_name is defined %}{{ domain_name }}{% else %}{{ ansible_fqdn }}{% endif %}
{% else %}
myorigin = {{ ansible_fqdn }}
{% endif %}
@ -131,11 +130,10 @@ proxy_interfaces = {% for proxy_int in postfix_proxy_interfaces %}{{ proxy_int }
#
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
#
{% if postfix_use_domain_name is defined and postfix_use_domain_name %}
{% elif domain_name is defined %}
mydestination = {{ ansible_fqdn }}, localhost, {{ domain_name }}
{% if postfix_use_domain_name %}
mydestination = {{ ansible_fqdn }}, localhost, {% if domain_name is defined %}{{ domain_name }}{% endif %}
{% else %}
mydestination = {{ ansible_fqdn }}, localhost
mydestination = {% if postfix_local_recipients %}{{ ansible_fqdn }},{% endif %} localhost
{% endif %}
# REJECTING MAIL FOR UNKNOWN LOCAL USERS