diff --git a/roles/mail_server/templates/main.cf.j2 b/roles/mail_server/templates/main.cf.j2 index ca4d07cb3e730101baa5f231602797f37be6c837..0091b0d39ca775ca80f1ef4f819c827c5545e61d 100644 --- a/roles/mail_server/templates/main.cf.j2 +++ b/roles/mail_server/templates/main.cf.j2 @@ -6,7 +6,7 @@ # ================ # Internet hostname of this mail system. -myhostname = {{ inventory_hostname }} +myhostname = {{ ansible_fqdn }} # Under Debian, when a file name is specified, the first line of the # file be used as the SMTP server name. @@ -49,7 +49,7 @@ compatibility_level = 3.6 # ====================== # List of domains for local transport deliveries. -mydestination = {{ inventory_hostname }}, {{ inventory_hostname_short }}, localhost.localdomain, localhost +mydestination = {{ ansible_fqdn }}, {{ ansible_hostname }}, localhost.localdomain, localhost # Alias maps for local deliveries (to system accounts). alias_maps = hash:/etc/aliases @@ -111,8 +111,8 @@ smtpd_tls_cert_file = /etc/ssl/certs/{{ ansible_fqdn }}_smtp.pem smtpd_tls_key_file = /etc/ssl/private/{{ ansible_fqdn }}_smtp.key # Use custom, generated DH parameters for increased security. -smtpd_tls_dh1024_param_file = /etc/ssl/private/{{ inventory_hostname }}_smtp.dh.pem -smtpd_tls_dh512_param_file = /etc/ssl/private/{{ inventory_hostname }}_smtp.dh.pem +smtpd_tls_dh1024_param_file = /etc/ssl/private/{{ ansible_fqdn }}_smtp.dh.pem +smtpd_tls_dh512_param_file = /etc/ssl/private/{{ ansible_fqdn }}_smtp.dh.pem # Use TLS when available with Postfix SMTP client. smtp_tls_security_level = may