ansibleify smtp
This commit is contained in:
parent
aefa493b14
commit
40aab44dec
@ -6,3 +6,4 @@
|
|||||||
- common
|
- common
|
||||||
- docker
|
- docker
|
||||||
- webserver
|
- webserver
|
||||||
|
- internalsmtp
|
||||||
|
@ -5,3 +5,4 @@
|
|||||||
- netplan
|
- netplan
|
||||||
- common
|
- common
|
||||||
- docker
|
- docker
|
||||||
|
- internalsmtp
|
||||||
|
@ -18,3 +18,5 @@ all:
|
|||||||
ansible_host: swagger.stargate.internal
|
ansible_host: swagger.stargate.internal
|
||||||
drone-runner:
|
drone-runner:
|
||||||
ansible_host: drone-runner.stargate.internal
|
ansible_host: drone-runner.stargate.internal
|
||||||
|
smtp:
|
||||||
|
ansible_host: smtp.stargate.internal
|
||||||
|
@ -5,3 +5,4 @@
|
|||||||
- common
|
- common
|
||||||
- docker
|
- docker
|
||||||
- neko
|
- neko
|
||||||
|
- internalsmtp
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
---
|
---
|
||||||
postfix_relayhost: 'smtp.stargate.internal'
|
postfix_relayhost: 'smtp.stargate.internal'
|
||||||
|
|
||||||
external_domain: 'kmlabz.com'
|
external_domain: 'tormakris.dev'
|
||||||
|
@ -60,6 +60,6 @@
|
|||||||
community.general.ufw:
|
community.general.ufw:
|
||||||
rule: allow
|
rule: allow
|
||||||
direction: in
|
direction: in
|
||||||
port: 52000:52100
|
port: 59000:59049
|
||||||
proto: udp
|
proto: udp
|
||||||
interface: eth1
|
interface: eth1
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
---
|
---
|
||||||
postfix_relayhost: 'smtp.sendgrid.net'
|
postfix_relayhost: 'smtp-relay.gmail.com:25'
|
||||||
external_domain: 'kmlabz.com'
|
external_domain: 'tormakris.dev'
|
||||||
username: lofasz
|
|
||||||
password: lofasz
|
|
@ -6,12 +6,6 @@
|
|||||||
name:
|
name:
|
||||||
- postfix
|
- postfix
|
||||||
|
|
||||||
- name: Install Postfix SASL credentials
|
|
||||||
template:
|
|
||||||
src: templates/sasl_passwd
|
|
||||||
mode: 600
|
|
||||||
dest: /etc/postfix/sasl_passwd
|
|
||||||
|
|
||||||
- name: Install Postfix mail gateway config
|
- name: Install Postfix mail gateway config
|
||||||
template:
|
template:
|
||||||
src: templates/main.cf
|
src: templates/main.cf
|
||||||
@ -20,9 +14,6 @@
|
|||||||
- name: Build /etc/mailname
|
- name: Build /etc/mailname
|
||||||
shell: hostname --fqdn > /etc/mailname
|
shell: hostname --fqdn > /etc/mailname
|
||||||
|
|
||||||
- name: Build hashtable of SASL creds
|
|
||||||
command: postmap /etc/postfix/sasl_passwd
|
|
||||||
|
|
||||||
- name: Restart Postfix
|
- name: Restart Postfix
|
||||||
service:
|
service:
|
||||||
name: postfix
|
name: postfix
|
||||||
|
@ -14,10 +14,6 @@ smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
|||||||
smtpd_tls_security_level=may
|
smtpd_tls_security_level=may
|
||||||
|
|
||||||
smtp_tls_CApath=/etc/ssl/certs
|
smtp_tls_CApath=/etc/ssl/certs
|
||||||
smtp_sasl_auth_enable = yes
|
|
||||||
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
|
|
||||||
smtp_sasl_security_options = noanonymous
|
|
||||||
smtp_sasl_tls_security_options = noanonymous
|
|
||||||
smtp_tls_security_level = encrypt
|
smtp_tls_security_level = encrypt
|
||||||
header_size_limit = 4096000
|
header_size_limit = 4096000
|
||||||
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
|
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
|
||||||
@ -29,7 +25,7 @@ alias_maps = hash:/etc/aliases
|
|||||||
alias_database = hash:/etc/aliases
|
alias_database = hash:/etc/aliases
|
||||||
myorigin = /etc/mailname
|
myorigin = /etc/mailname
|
||||||
mydestination = {{ansible_hostname}}.{{external_domain}}, $myhostname, {{ansible_hostname}}, localhost.localdomain, localhost
|
mydestination = {{ansible_hostname}}.{{external_domain}}, $myhostname, {{ansible_hostname}}, localhost.localdomain, localhost
|
||||||
relayhost = {{postfix_relayhost}}
|
relayhost = [{{postfix_relayhost}}]
|
||||||
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
|
||||||
mailbox_size_limit = 0
|
mailbox_size_limit = 0
|
||||||
recipient_delimiter = +
|
recipient_delimiter = +
|
||||||
|
@ -1 +0,0 @@
|
|||||||
[{{postfix_relayhost}}:587 {{username}}:{{password}}
|
|
Loading…
Reference in New Issue
Block a user