Change from and noreply emails to use EXTERNAL_HOST domain.

This eliminates another mandatory setting from what one needs to
configure to setup a Zulip server.
This commit is contained in:
Pweaver (Paul Weaver)
2017-06-09 00:09:01 -04:00
committed by Tim Abbott
parent 3fe6d12ab6
commit 2c10e7c0db
5 changed files with 9 additions and 10 deletions

View File

@@ -51,10 +51,10 @@ later setup a real SMTP provider!
To configure outgoing SMTP, you will need to complete the following steps: To configure outgoing SMTP, you will need to complete the following steps:
1. Fill out the outgoing email sending configuration block in 1. Fill out the outgoing email sending configuration block in
`/etc/zulip/settings.py`, including `EMAIL_HOST`, `EMAIL_HOST_USER`, `/etc/zulip/settings.py`, including `EMAIL_HOST`, `EMAIL_HOST_USER`, and
and `NOREPLY_EMAIL_ADDRESS`. You may also need `NOREPLY_EMAIL_ADDRESS`. You may also need to set `EMAIL_PORT` if your provider
to set `EMAIL_PORT` if your provider doesn't use the standard doesn't use the standard SMTP submission port (587). You may also want to update
SMTP submission port (587). `NOREPLY_EMAIL_ADDRESS` from its default value.
2. Put the SMTP password for `EMAIL_HOST_USER` in 2. Put the SMTP password for `EMAIL_HOST_USER` in
`/etc/zulip/zulip-secrets.conf` as `email_password = yourPassword`. `/etc/zulip/zulip-secrets.conf` as `email_password = yourPassword`.

View File

@@ -78,14 +78,14 @@ These settings include:
maintaining this installation and who will get support and error maintaining this installation and who will get support and error
emails. emails.
- `EMAIL_*` and `NOREPLY_EMAIL_ADDRESS`: - `EMAIL_*`:
credentials for an outgoing SMTP server so Zulip can send emails credentials for an outgoing SMTP server so Zulip can send emails
when needed (don't forget to set `email_password` in the when needed (don't forget to set `email_password` in the
`zulip-secrets.conf` file!). We highly recommend reading our `zulip-secrets.conf` file!). We highly recommend reading our
[production email docs](prod-email.html) and following the test [production email docs](prod-email.html) and following the test
procedure discussed there to make sure you've setup outgoing email procedure discussed there to make sure you've setup outgoing email
correctly, since outgoing email is the most common configuration correctly, since outgoing email is the most common configuration
problem. problem. You may also want to update `NOREPLY_EMAIL_ADDRESS`
- If desired, you can also configure additional - If desired, you can also configure additional
[authentication backends](prod-authentication-methods.html) while [authentication backends](prod-authentication-methods.html) while

View File

@@ -41,7 +41,7 @@ class TestMissedMessages(ZulipTestCase):
if settings.EMAIL_GATEWAY_PATTERN != "": if settings.EMAIL_GATEWAY_PATTERN != "":
reply_to_addresses = [settings.EMAIL_GATEWAY_PATTERN % (u'mm' + t) for t in tokens] reply_to_addresses = [settings.EMAIL_GATEWAY_PATTERN % (u'mm' + t) for t in tokens]
else: else:
reply_to_addresses = ["Zulip <noreply@example.com>"] reply_to_addresses = ["Zulip <noreply@zulip.example.com>"]
msg = mail.outbox[0] msg = mail.outbox[0]
sender = settings.NOREPLY_EMAIL_ADDRESS sender = settings.NOREPLY_EMAIL_ADDRESS
from_email = sender from_email = sender

View File

@@ -76,8 +76,8 @@ EMAIL_PORT = 587
EMAIL_USE_TLS = True EMAIL_USE_TLS = True
# The noreply address to be used as the sender for certain generated emails. # The noreply address to be used as the sender for certain generated emails.
# Messages sent to this address could contain sensitive user data and should # Messages sent to this address could contain sensitive user data and should
# not be delivered anywhere. # not be delivered anywhere. (e.g. "Zulip <noreply@example.com>")
NOREPLY_EMAIL_ADDRESS = "Zulip <noreply@example.com>" NOREPLY_EMAIL_ADDRESS = "Zulip <noreply@" + EXTERNAL_HOST.split(":")[0] + ">"
## OPTIONAL SETTINGS ## OPTIONAL SETTINGS

View File

@@ -236,7 +236,6 @@ REQUIRED_SETTINGS = [("EXTERNAL_HOST", "zulip.example.com"),
# case, it seems worth having in this list # case, it seems worth having in this list
("SECRET_KEY", ""), ("SECRET_KEY", ""),
("AUTHENTICATION_BACKENDS", ()), ("AUTHENTICATION_BACKENDS", ()),
("NOREPLY_EMAIL_ADDRESS", "Zulip <noreply@example.com>"),
] ]
if ADMINS == "": if ADMINS == "":