Add email-sending support

This commit is contained in:
Slavi Pantaleev
2018-08-14 14:11:41 +03:00
parent cab54879d1
commit 21da2f572b
11 changed files with 157 additions and 15 deletions

View File

@ -0,0 +1,8 @@
MAILNAME=matrix-mailer
{% if matrix_mailer_relay_use %}
RELAYHOST={{ matrix_mailer_relay_host_name }}:{{ matrix_mailer_relay_host_port }}
{% endif %}
{% if matrix_mailer_relay_auth %}
RELAYHOST_AUTH=yes
RELAYHOST_PASSWORDMAP={{ matrix_mailer_relay_host_name }}:{{ matrix_mailer_relay_auth_username }}:{{ matrix_mailer_relay_auth_password }}
{% endif %}

View File

@ -86,7 +86,7 @@ web_client: False
# web_client_location: "/path/to/web/root"
# The public-facing base URL for the client API (not including _matrix/...)
# public_baseurl: https://example.com:8448/
public_baseurl: https://{{ hostname_matrix }}/
# Set the soft limit on the number of file descriptors synapse can use
# Zero is used to indicate synapse should set the soft limit to the
@ -563,20 +563,20 @@ 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 <noreply@example.com>"
# app_name: Matrix
# 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"
{% if matrix_mailer_enabled %}
email:
enable_notifs: true
smtp_host: "matrix-mailer"
smtp_port: 587
require_transport_security: false
notif_from: "Matrix <{{ matrix_mailer_sender_address }}>"
app_name: Matrix
template_dir: /synapse/res/templates
notif_template_html: notif_mail.html
notif_template_text: notif_mail.txt
notif_for_new_users: True
riot_base_url: "https://{{ hostname_riot }}"
{% endif %}
# password_providers:

View File

@ -0,0 +1,20 @@
[Unit]
Description=Matrix mailer
After=docker.service
Requires=docker.service
[Service]
Type=simple
ExecStartPre=-/usr/bin/docker kill matrix-mailer
ExecStartPre=-/usr/bin/docker rm matrix-mailer
ExecStart=/usr/bin/docker run --rm --name matrix-mailer \
--network={{ matrix_docker_network }} \
--env-file={{ matrix_environment_variables_data_path }}/env-mailer \
{{ matrix_docker_image_mailer }}
ExecStop=-/usr/bin/docker kill matrix-mailer
ExecStop=-/usr/bin/docker rm matrix-mailer
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target

View File

@ -10,6 +10,9 @@ After=matrix-postgres.service
After=matrix-goofys.service
Requires=matrix-goofys.service
{% endif %}
{% if matrix_mailer_enabled %}
Wants=matrix-mailer.service
{% endif %}
Wants=matrix-coturn.service
[Service]