diff --git a/defaults/main.yml b/defaults/main.yml index 309aa13..d99d468 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -165,6 +165,7 @@ postfix_alias_maps: postfix_alias_databases: '{{ postfix_alias_maps }}' postfix_virtual_addresses: False +postfix_hostname_as_virtual_domain: True postfix_virtual_mailbox_domains: 'hash:/etc/postfix/virtual_domains' postfix_virtual_mailbox_domains_data: [] # diff --git a/templates/virtual_domains.j2 b/templates/virtual_domains.j2 index bbb8260..419396a 100644 --- a/templates/virtual_domains.j2 +++ b/templates/virtual_domains.j2 @@ -6,6 +6,9 @@ {% for dom in postfix_virtual_mailbox_domains_data %} {{ dom.domain }} OK {% endfor %} +{% if postfix_hostname_as_virtual_domain %} +{{ ansible_fqdn }} OK +{% endif %} {% else %} localdomain OK {% endif %}