From f76a4feb539ff506a1fafc33b70eee84bd1a4053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Wed, 5 Sep 2018 12:24:07 +0200 Subject: [PATCH] Make all outside email go from the same address For most admins, it doesn't make much sense to send emails from many email addresses. Here, we set a sane default that can be easily overridden. --- config/openedx/templates/cms.env.json.templ | 1 + config/openedx/templates/lms.env.json.templ | 1 + config/openedx/universal/cms/production.py | 6 +++--- config/openedx/universal/lms/production.py | 22 ++++++++++----------- configurator/bin/configure.py | 2 ++ 5 files changed, 18 insertions(+), 14 deletions(-) diff --git a/config/openedx/templates/cms.env.json.templ b/config/openedx/templates/cms.env.json.templ index 2c2871d..96c0f36 100644 --- a/config/openedx/templates/cms.env.json.templ +++ b/config/openedx/templates/cms.env.json.templ @@ -12,6 +12,7 @@ "CMS_ROOT_URL": "{{ "https" if ACTIVATE_HTTPS else "http" }}://{{ CMS_HOST }}", "CMS_BASE": "{{ CMS_HOST }}", "LMS_BASE": "{{ LMS_HOST }}", + "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", "CELERY_BROKER_HOSTNAME": "rabbitmq", "CELERY_BROKER_TRANSPORT": "amqp", "MEDIA_ROOT": "/openedx/data/uploads/", diff --git a/config/openedx/templates/lms.env.json.templ b/config/openedx/templates/lms.env.json.templ index 115453f..3a5e78d 100644 --- a/config/openedx/templates/lms.env.json.templ +++ b/config/openedx/templates/lms.env.json.templ @@ -12,6 +12,7 @@ "CMS_ROOT_URL": "{{ "https" if ACTIVATE_HTTPS else "http" }}://{{ CMS_HOST }}", "CMS_BASE": "{{ CMS_HOST }}", "LMS_BASE": "{{ LMS_HOST }}", + "CONTACT_EMAIL": "{{ CONTACT_EMAIL }}", "CELERY_BROKER_HOSTNAME": "rabbitmq", "CELERY_BROKER_TRANSPORT": "amqp", "COMMENTS_SERVICE_URL": "http://forum:4567", diff --git a/config/openedx/universal/cms/production.py b/config/openedx/universal/cms/production.py index 7f44cee..77fbfb6 100644 --- a/config/openedx/universal/cms/production.py +++ b/config/openedx/universal/cms/production.py @@ -21,6 +21,6 @@ ALLOWED_HOSTS = [ '127.0.0.1:8001', 'localhost:8001', ] -DEFAULT_FROM_EMAIL = 'registration@' + ENV_TOKENS['LMS_BASE'] -DEFAULT_FEEDBACK_EMAIL = 'feedback@' + ENV_TOKENS['LMS_BASE'] -SERVER_EMAIL = 'devops@' + ENV_TOKENS['LMS_BASE'] +DEFAULT_FROM_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +SERVER_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] diff --git a/config/openedx/universal/lms/production.py b/config/openedx/universal/lms/production.py index b292558..4bc39a1 100644 --- a/config/openedx/universal/lms/production.py +++ b/config/openedx/universal/lms/production.py @@ -28,15 +28,15 @@ ALLOWED_HOSTS = [ '127.0.0.1:8000', 'localhost:8000', ] -DEFAULT_FROM_EMAIL = 'registration@' + ENV_TOKENS['LMS_BASE'] -DEFAULT_FEEDBACK_EMAIL = 'feedback@' + ENV_TOKENS['LMS_BASE'] -SERVER_EMAIL = 'devops@' + ENV_TOKENS['LMS_BASE'] -TECH_SUPPORT_EMAIL = 'technical@' + ENV_TOKENS['LMS_BASE'] -CONTACT_EMAIL = 'info@' + ENV_TOKENS['LMS_BASE'] -BUGS_EMAIL = 'bugs@' + ENV_TOKENS['LMS_BASE'] -UNIVERSITY_EMAIL = 'university@' + ENV_TOKENS['LMS_BASE'] -PRESS_EMAIL = 'press@' + ENV_TOKENS['LMS_BASE'] -PAYMENT_SUPPORT_EMAIL = 'payment@' + ENV_TOKENS['LMS_BASE'] +DEFAULT_FROM_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +SERVER_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +TECH_SUPPORT_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +CONTACT_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +BUGS_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +UNIVERSITY_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +PRESS_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +PAYMENT_SUPPORT_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] BULK_EMAIL_DEFAULT_FROM_EMAIL = 'no-reply@' + ENV_TOKENS['LMS_BASE'] -API_ACCESS_MANAGER_EMAIL = 'api-access@' + ENV_TOKENS['LMS_BASE'] -API_ACCESS_FROM_EMAIL = 'api-requests@' + ENV_TOKENS['LMS_BASE'] +API_ACCESS_MANAGER_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] +API_ACCESS_FROM_EMAIL = ENV_TOKENS['CONTACT_EMAIL'] diff --git a/configurator/bin/configure.py b/configurator/bin/configure.py index 953747c..1349768 100755 --- a/configurator/bin/configure.py +++ b/configurator/bin/configure.py @@ -96,6 +96,8 @@ def interactive(args): 'CMS_HOST', "Your website domain name for teachers (CMS).", 'studio.myopenedx.com' ).add( 'PLATFORM_NAME', "Platform name/title", "My Open edX" + ).add( + 'CONTACT_EMAIL', "Public contact email address", 'contact@' + configurator.get('LMS_HOST') ).add( 'SECRET_KEY', "", random_string(24) ).add(