diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-09-16 13:46:10 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-09-16 13:47:49 +0300 |
commit | 05a697f2b8553bb0379a38b0767b8c4053470eeb (patch) | |
tree | 68956716251ca8a1fb0fc9d00476bb41e954c1e2 /ansible | |
parent | 9a3f7758417c53fe6cd11dd82ed906b3b8ae0722 (diff) | |
download | ansibleness-05a697f2b8553bb0379a38b0767b8c4053470eeb.tar.gz |
Add: enable use of smarthost by postfix on pieni.net
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/host_vars/pieni.yml | 1 | ||||
-rw-r--r-- | ansible/roles/mail-server/tasks/postfix.yml | 1 | ||||
-rw-r--r-- | ansible/roles/mail-server/templates/postfix.main.cf.j2 | 9 |
3 files changed, 9 insertions, 2 deletions
diff --git a/ansible/host_vars/pieni.yml b/ansible/host_vars/pieni.yml index 77dd610..d00e433 100644 --- a/ansible/host_vars/pieni.yml +++ b/ansible/host_vars/pieni.yml @@ -5,6 +5,7 @@ debian_mirror_src: http.debian.net codeliwfidistro: unstable mailname: pieni.net smarthost: mail.pepperfish.net +smarthost_port: 587 smarthost_user: pieni-fwd@ppfm.net smarthost_pass_name: pieni.net/smarthost_pass gitano_bypass_pub: "{{ lookup('file', '/home/liw/.ssh/gitano-bypass-key.pub') }}" 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 |