Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions group_vars/all/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ unsubscribe_email_host: "mail.fragdenstaat.de"
# - from: "test@fragdenstaat.de"
# to: "root@fragdenstaat.de"

## in secret.yml
smtp_relays: []
# - domain: ""
# username: ""
# password: ""

## in secret.yml
alias_foi_domains: []

Expand Down
4 changes: 4 additions & 0 deletions roles/postfix/files/transport
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
stefan.wehrmeyer@okfn.de relay:[in-v3.mailjet.com]:587
fragdenstaat.de local
echtemail.de local
* smtp
12 changes: 12 additions & 0 deletions roles/postfix/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
notify: restart postfix
changed_when: false

- name: update transport postmap
ansible.builtin.command:
cmd: "postmap /etc/postfix/transport"
notify: restart postfix
changed_when: false

- name: update sasl_passwd postmap
ansible.builtin.command:
cmd: "postmap /etc/postfix/sasl_passwd"
notify: restart postfix
changed_when: false

- name: restart opendkim
ansible.builtin.service:
name: opendkim
Expand Down
15 changes: 14 additions & 1 deletion roles/postfix/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
---

- name: Ensure postfix and dependencies are installed
ansible.builtin.apt:
pkg:
Expand Down Expand Up @@ -37,6 +36,20 @@
mode: "0644"
notify: restart postfix

- name: Install transport
ansible.builtin.copy:
src: transport
dest: /etc/postfix/transport
mode: "0600"
notify: update transport postmap

- name: Install postfix sasl_passwd
ansible.builtin.template:
src: sasl_passwd.j2
dest: /etc/postfix/sasl_passwd
mode: "0600"
notify: update sasl_passwd postmap

- name: Install vmail_domains
ansible.builtin.template:
src: vmail_domains.j2
Expand Down
8 changes: 8 additions & 0 deletions roles/postfix/templates/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,11 @@ smtpd_milters =
inet:127.0.0.1:12301
inet:127.0.0.1:8893
non_smtpd_milters = inet:localhost:12301

transport_maps = hash:/etc/postfix/transport

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
header_size_limit = 4096000
2 changes: 2 additions & 0 deletions roles/postfix/templates/sasl_passwd.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{% for smtp in smtp_relays %}[{{ smtp.domain }}]:587 {{ smtp.username }}:{{ smtp.password }}
{% endfor %}
Loading