summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Saulnier <fantom@fedoraproject.org>2017-08-11 20:58:12 +0200
committerMatthieu Saulnier <fantom@fedoraproject.org>2017-08-11 20:58:12 +0200
commit1c12765c379126b32f1d0602260a886ca7b7af79 (patch)
tree64cc6db1349b13476ca1d0c0aca53ed6cb58422b
parent406818f04951fe616740a880599b3bb3f78db982 (diff)
downloadplaybooks-ansible-1c12765c379126b32f1d0602260a886ca7b7af79.tar.gz
playbooks-ansible-1c12765c379126b32f1d0602260a886ca7b7af79.tar.xz
playbooks-ansible-1c12765c379126b32f1d0602260a886ca7b7af79.zip
fix local or non-local HELO hostnames
-rw-r--r--roles/mtaserver/templates/main.cf.j28
1 files changed, 8 insertions, 0 deletions
diff --git a/roles/mtaserver/templates/main.cf.j2 b/roles/mtaserver/templates/main.cf.j2
index 50133b1..35266c7 100644
--- a/roles/mtaserver/templates/main.cf.j2
+++ b/roles/mtaserver/templates/main.cf.j2
@@ -96,8 +96,12 @@ mail_owner = postfix
{% if is_mtamaster is defined %}
myhostname = mail.casperlefantom.net
{% else %}
+{% if ansible_default_ipv4.network == "192.168.0.0" %}
+myhostname = {{ ansible_hostname }}.home.casperlefantom.net
+{% else %}
myhostname = {{ ansible_hostname }}.casperlefantom.net
{% endif %}
+{% endif %}
# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
@@ -350,7 +354,11 @@ mynetworks = hash:/etc/postfix/network_table
{% if is_mtamaster is defined %}
##relayhost = [smtp.free.fr]
{% else %}
+{% if ansible_default_ipv4.network == "192.168.0.0" %}
+relayhost = [mail.home.casperlefantom.net]:587
+{% else %}
relayhost = [mail.casperlefantom.net]:587
+{% endif %}
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/credentials
smtp_sasl_security_options = noanonymous