v0.1 done: docker webhosts, smtp gateway
This commit is contained in:
4
roles/internalsmtp/defaults/main.yaml
Normal file
4
roles/internalsmtp/defaults/main.yaml
Normal file
@ -0,0 +1,4 @@
|
||||
---
|
||||
postfix_relayhost: 'smtp.stargate.internal'
|
||||
|
||||
external_domain: 'kmlabz.com'
|
18
roles/internalsmtp/tasks/postfix.yaml
Normal file
18
roles/internalsmtp/tasks/postfix.yaml
Normal 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
|
32
roles/internalsmtp/templates/main.cf
Normal file
32
roles/internalsmtp/templates/main.cf
Normal 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
|
Reference in New Issue
Block a user