mirror of
https://github.com/zulip/zulip.git
synced 2025-10-30 03:23:50 +00:00
settings: Set a flag when email isn't configured, so we can warn.
This commit is contained in:
@@ -51,10 +51,12 @@ ZULIP_ADMINISTRATOR = 'zulip-admin@example.com'
|
||||
# /home/zulip/deployments/current/manage.py send_test_email username@example.com
|
||||
#
|
||||
# A common problem is hosting provider firewalls that block outgoing SMTP traffic.
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
EMAIL_HOST_USER = ''
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = True
|
||||
#
|
||||
#EMAIL_HOST = 'smtp.gmail.com'
|
||||
#EMAIL_HOST_USER = ''
|
||||
#EMAIL_PORT = 587
|
||||
#EMAIL_USE_TLS = True
|
||||
EMAIL_HOST = None
|
||||
|
||||
## OPTIONAL SETTINGS
|
||||
|
||||
|
||||
@@ -273,6 +273,10 @@ DEFAULT_SETTINGS.update({
|
||||
# available for sysadmin override in unusual cases.
|
||||
'EMAIL_BACKEND': None,
|
||||
|
||||
# Whether to give admins a warning in the web app that email isn't set up.
|
||||
# Set below when email isn't configured.
|
||||
'WARN_NO_EMAIL': False,
|
||||
|
||||
# Whether to keep extra frontend stack trace data.
|
||||
# TODO: Investigate whether this should be removed and set one way or other.
|
||||
'SAVE_FRONTEND_STACKTRACES': False,
|
||||
@@ -1537,7 +1541,8 @@ elif DEVELOPMENT:
|
||||
# In the dev environment, emails are printed to the run-dev.py console.
|
||||
EMAIL_BACKEND = 'zproject.email_backends.EmailLogBackEnd'
|
||||
elif not EMAIL_HOST:
|
||||
# If an email host is not specified, fail silently and gracefully
|
||||
# If an email host is not specified, fail gracefully
|
||||
WARN_NO_EMAIL = True
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
|
||||
else:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
|
||||
Reference in New Issue
Block a user