postfix: permit adding more domains to virtual_mailbox_domains
[ansible.git] / roles / email / templates / main.cf
index cbd7b3d85c4cdd515b4a24485beebc68938952d7..a03d62764273be553f77bb2319e1e6670a4075a5 100644 (file)
@@ -1,12 +1,16 @@
 compatibility_level = 2
 
-# local delivery: aliases only
-alias_maps = hash:/etc/aliases
-local_recipient_maps = $alias_maps
+{% if postfix.hostname is defined %}
+myhostname = {{ postfix.hostname }}
+{% endif %}
 {% if postfix.mynetworks is defined %}
 mynetworks = {{ postfix.mynetworks }}
 {% endif %}
 
+# local delivery: aliases only
+alias_maps = hash:/etc/aliases
+local_recipient_maps = $alias_maps
+
 {% if 'letsencrypt' in group_names %}
 # TLS server parameters
 smtpd_tls_cert_file=/etc/ssl/mycerts/letsencrypt/live.crt+chain
@@ -83,7 +87,7 @@ relay_clientcerts = hash:$config_directory/relay_clientcerts
 {% endif %}
 
 # setup virtual delivery domains, aliases and destinations
-virtual_mailbox_domains =
+virtual_mailbox_domains = {{ postfix.alias_domains | default("") }}
 {% if postfix.mailman is defined %}  {% for item in postfix.mailman.domains %} {{item}}{% endfor %}{% endif %}
 {% if postfix.dovecot is defined %}  {% for item in postfix.dovecot.domains %} {{item}}{% endfor %}{% endif %}