postfix:
# postmaster email address
postmaster: postmaster@example.org
+ # optional: Hostname of this email system
+ hostname: mail.example.org
# optional: Whether to put a postscreen on port 25
postscreen: True
# optional: Open another SMTP daemon on port 26 that only accepts mail from local hosts
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