mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
If EMAIL_HOST is unset or blank, don't send email via django.core.mail
It will instead use the dummy EmailBackend (imported from commit 6faec7f3e087901226a120b9268cf687ed165c05)
This commit is contained in:
@@ -38,11 +38,12 @@ MANDRILL_API_KEY = 'xxxxxxxxxxxxxxxxxxxxxx'
|
||||
# This should be synced with our camo installation
|
||||
CAMO_KEY = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
|
||||
|
||||
EMAIL_USE_TLS = True
|
||||
# Leave EMAIL_HOST unset or empty if you do not wish for emails to be sent
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
EMAIL_HOST_USER = 'zulip@zulip.com'
|
||||
EMAIL_HOST_PASSWORD = 'xxxxxxxxxxxxxxxx'
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = True
|
||||
|
||||
config_file = ConfigParser.RawConfigParser()
|
||||
config_file.read("/etc/zulip/zulip.conf")
|
||||
|
||||
@@ -13,12 +13,13 @@ DEPLOYMENT_ROLE_KEY = ''
|
||||
# Configure the outgoing SMTP server below. For outgoing email
|
||||
# via a GMail SMTP server, EMAIL_USE_TLS must be True and the
|
||||
# outgoing port must be 587. The EMAIL_HOST is prepopulated
|
||||
# for GMail servers, change it for other hosts
|
||||
EMAIL_USE_TLS = True
|
||||
# for GMail servers, change it for other hosts, or leave it unset
|
||||
# or empty to skip sending email.
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
EMAIL_HOST_USER = ''
|
||||
EMAIL_HOST_PASSWORD = ''
|
||||
EMAIL_PORT = 587
|
||||
EMAIL_USE_TLS = True
|
||||
|
||||
# By default uploaded files and avatars are stored directly on the Zulip server
|
||||
# If file storage to Amazon S3 is desired, please contact Zulip Support
|
||||
|
||||
@@ -670,10 +670,16 @@ if DEPLOYED:
|
||||
else:
|
||||
FULL_NAVBAR = True
|
||||
|
||||
# If an email host is not specified, fail silently and gracefully
|
||||
if not EMAIL_HOST and DEPLOYED:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend'
|
||||
elif not DEPLOYED:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
else:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
||||
|
||||
# For testing, you may want to have emails be printed to the console.
|
||||
if not DEPLOYED:
|
||||
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
|
||||
|
||||
# Use fast password hashing for creating testing users when not
|
||||
# DEPLOYED
|
||||
PASSWORD_HASHERS = (
|
||||
|
||||
Reference in New Issue
Block a user