From a68dc4f68f3eb1680e3a6f62e2df52420bb92381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Sun, 7 Jul 2019 09:06:35 +0800 Subject: [PATCH] Add support for external SMTP server with TLS Note that this setting will not work with the default namshi smtp server shipped with tutor. Close #231. --- CHANGELOG.md | 1 + docs/configuration.rst | 3 +++ tutor/templates/apps/openedx/config/cms.env.json | 1 + tutor/templates/apps/openedx/config/lms.env.json | 1 + tutor/templates/config.yml | 1 + 5 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6291864..bb3cb24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥". ## Latest +- [Improvement] Add support for TLS in external SMTP server (#231) - [Bugfix] Fix missing video transcripts in LMS (#229) - [Improvement] Make it possible to enable/disable multiple plugins at once - [Improvement] Add 'local-docker-compose-nginx-volumes' patch diff --git a/docs/configuration.rst b/docs/configuration.rst index ba665f5..51e95a2 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -140,6 +140,9 @@ SMTP - ``SMTP_PORT`` (default: ``25``) - ``SMTP_USERNAME`` (default: ``""``) - ``SMTP_PASSWORD`` (default: ``""``) +- ``SMTP_USE_TLS`` (default: ``false``) + +Note that the SMTP server shipped with Tutor by default does not implement TLS. SSL/TLS certificates for HTTPS access ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tutor/templates/apps/openedx/config/cms.env.json b/tutor/templates/apps/openedx/config/cms.env.json index 80a9e96..dc75fec 100644 --- a/tutor/templates/apps/openedx/config/cms.env.json +++ b/tutor/templates/apps/openedx/config/cms.env.json @@ -30,6 +30,7 @@ "EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend", "EMAIL_HOST": "{{ SMTP_HOST }}", "EMAIL_PORT": {{ SMTP_PORT }}, + "EMAIL_USE_TLS": {{ "true" if SMTP_USE_TLS else "false" }}, "HTTPS": "{{ "on" if ACTIVATE_HTTPS else "off" }}", "LANGUAGE_CODE": "{{ LANGUAGE_CODE }}", {% if ACTIVATE_HTTPS %}"SESSION_COOKIE_DOMAIN": ".{{ LMS_HOST|common_domain(CMS_HOST) }}",{% endif %} diff --git a/tutor/templates/apps/openedx/config/lms.env.json b/tutor/templates/apps/openedx/config/lms.env.json index 82fa71c..d959b36 100644 --- a/tutor/templates/apps/openedx/config/lms.env.json +++ b/tutor/templates/apps/openedx/config/lms.env.json @@ -36,6 +36,7 @@ "EMAIL_BACKEND": "django.core.mail.backends.smtp.EmailBackend", "EMAIL_HOST": "{{ SMTP_HOST }}", "EMAIL_PORT": {{ SMTP_PORT }}, + "EMAIL_USE_TLS": {{ "true" if SMTP_USE_TLS else "false" }}, "HTTPS": "{{ "on" if ACTIVATE_HTTPS else "off" }}", "LANGUAGE_CODE": "{{ LANGUAGE_CODE }}", "LOGIN_REDIRECT_WHITELIST": ["{{ CMS_HOST }}", "studio.localhost"], diff --git a/tutor/templates/config.yml b/tutor/templates/config.yml index ff22637..f194bd6 100644 --- a/tutor/templates/config.yml +++ b/tutor/templates/config.yml @@ -66,4 +66,5 @@ SMTP_HOST: "smtp" SMTP_PORT: 25 SMTP_USERNAME: "" SMTP_PASSWORD: "" +SMTP_USE_TLS: false WEB_PROXY: false