From bb8a7fcf83e2651410be85ce2535a23598709c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=AD=C3=B0ir=20Valberg=20Gu=C3=B0mundsson?= Date: Tue, 11 Jul 2023 20:42:20 +0200 Subject: [PATCH] Enable email in matrix. --- .../files/configs/matrix/homeserver.yaml.j2 | 21 ++++--------------- .../docker/tasks/services/matrix_element.yml | 3 +++ roles/docker/tasks/services/postfix.yml | 2 +- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/roles/docker/files/configs/matrix/homeserver.yaml.j2 b/roles/docker/files/configs/matrix/homeserver.yaml.j2 index b474901..dc69304 100644 --- a/roles/docker/files/configs/matrix/homeserver.yaml.j2 +++ b/roles/docker/files/configs/matrix/homeserver.yaml.j2 @@ -820,23 +820,10 @@ password_config: # If your SMTP server requires authentication, the optional smtp_user & # smtp_pass variables should be used # -#email: -# enable_notifs: false -# smtp_host: "localhost" -# smtp_port: 25 -# smtp_user: "exampleusername" -# smtp_pass: "examplepassword" -# require_transport_security: False -# notif_from: "Your Friendly %(app)s Home Server " -# app_name: Matrix -# # if template_dir is unset, uses the example templates that are part of -# # the Synapse distribution. -# #template_dir: res/templates -# notif_template_html: notif_mail.html -# notif_template_text: notif_mail.txt -# notif_for_new_users: True -# riot_base_url: "http://localhost/riot" - +email: + smtp_host: "{{ smtp_host }}" + smtp_port: {{ smtp_port }} + notif_from: "matrix.data.coop " #password_providers: # - module: "ldap_auth_provider.LdapAuthProvider" diff --git a/roles/docker/tasks/services/matrix_element.yml b/roles/docker/tasks/services/matrix_element.yml index 62df3f3..527fb89 100644 --- a/roles/docker/tasks/services/matrix_element.yml +++ b/roles/docker/tasks/services/matrix_element.yml @@ -82,6 +82,7 @@ networks: - matrix - external_services + - postfix volumes: - "{{ services.matrix.volume_folder }}/data:/data" environment: @@ -113,5 +114,7 @@ external_services: external: name: external_services + postfix: + external: true matrix: name: "matrix" diff --git a/roles/docker/tasks/services/postfix.yml b/roles/docker/tasks/services/postfix.yml index ece525e..76c4f59 100644 --- a/roles/docker/tasks/services/postfix.yml +++ b/roles/docker/tasks/services/postfix.yml @@ -23,6 +23,6 @@ - "{{ services.postfix.volume_folder }}/dkim:/etc/opendkim/keys" env: # Get all services which have allowed_sender_domain defined - ALLOWED_SENDER_DOMAINS: "{{ services | dict2items | selectattr('value.allowed_sender_domain', 'true') | map(attribute='value.domain') | join(' ') }}" + ALLOWED_SENDER_DOMAINS: "{{ base_domain }} {{ services | dict2items | selectattr('value.allowed_sender_domain', 'true') | map(attribute='value.domain') | join(' ') }}" HOSTNAME: "{{ services.postfix.domain }}" # the name the smtp server will identify itself as DKIM_AUTOGENERATE: "true"