v0.1 done: docker webhosts, smtp gateway

This commit is contained in:
2022-01-01 19:24:52 +01:00
commit 3a460cc704
28 changed files with 470 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
postfix_relayhost: 'smtp.stargate.internal'
external_domain: 'kmlabz.com'

View File

@ -0,0 +1,18 @@
---
- name: "Install Postfix via apt"
apt:
update_cache: yes
state: present
name:
- postfix
- name: Install Postfix forwarder config
template:
src: templates/main.cf
dest: /etc/postfix/main.cf
- name: Restart Postfix
service:
name: postfix
state: restarted
enabled: yes

View File

@ -0,0 +1,32 @@
# {{ansible_managed}}
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = {{ansible_hostname}}.{{external_domain}}
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = {{ansible_hostname}}.{{external_domain}}, $myhostname, {{ansible_hostname}}, localhost.localdomain, localhost
relayhost = {{postfix_relayhost}}
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all