From 05a697f2b8553bb0379a38b0767b8c4053470eeb Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 16 Sep 2017 13:46:10 +0300 Subject: Add: enable use of smarthost by postfix on pieni.net --- ansible/roles/mail-server/tasks/postfix.yml | 1 + ansible/roles/mail-server/templates/postfix.main.cf.j2 | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'ansible/roles/mail-server') diff --git a/ansible/roles/mail-server/tasks/postfix.yml b/ansible/roles/mail-server/tasks/postfix.yml index 8d600ff..c691cd8 100644 --- a/ansible/roles/mail-server/tasks/postfix.yml +++ b/ansible/roles/mail-server/tasks/postfix.yml @@ -76,3 +76,4 @@ - name: postmap smarthost creds shell: | postmap /etc/postfix/sasl_passwd + notify: restart postfix diff --git a/ansible/roles/mail-server/templates/postfix.main.cf.j2 b/ansible/roles/mail-server/templates/postfix.main.cf.j2 index 80cd00e..8e08ed9 100644 --- a/ansible/roles/mail-server/templates/postfix.main.cf.j2 +++ b/ansible/roles/mail-server/templates/postfix.main.cf.j2 @@ -7,7 +7,7 @@ mydestination = {{ mail_hostname }}, localhost.localdomain, localhost mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 inet_interfaces = all myorigin = /etc/mailname -relayhost = +relayhost = {{ smarthost }}:{{ smarthost_port }} alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases virtual_alias_maps = hash:/etc/postfix/virtual @@ -27,7 +27,12 @@ smtp_tls_security_level = may smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtp_tls_loglevel = 1 -# SASL authentication +# SASL authentication, outgoing mail. +smtp_sasl_auth_enable = yes +smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd +smtp_sasl_security_options = + +# SASL authentication, incoming mail. smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes -- cgit v1.2.1