send_test_email: Send email from NOREPLY address as well.

Tweaked by tabbott to also set different subject lines, to make it
easier to see that one got 2 emails.
This commit is contained in:
Sampriti Panda
2018-05-27 23:43:23 +05:30
committed by Tim Abbott
parent 08d7e113db
commit 018a33ff7c
2 changed files with 10 additions and 6 deletions

View File

@@ -104,7 +104,9 @@ su zulip
``` ```
If it doesn't throw an error, it probably worked; you can confirm by If it doesn't throw an error, it probably worked; you can confirm by
checking your email. checking your email. You should get two emails: One sent by a the
default From address for your Zulip server, and one sent by the
"noreply" From address.
If it doesn't work, check these common failure causes: If it doesn't work, check these common failure causes:
@@ -112,6 +114,9 @@ If it doesn't work, check these common failure causes:
firewall rules. Check whether the port `EMAIL_PORT` is blocked in firewall rules. Check whether the port `EMAIL_PORT` is blocked in
your hosting provider's firewall. your hosting provider's firewall.
* Your SMTP server's permissions might not allow the email account
you're using to send email from the `noreply` email address.
* Make sure you set the password in `/etc/zulip/zulip-secrets.conf`. * Make sure you set the password in `/etc/zulip/zulip-secrets.conf`.
* Check the username and password for typos. * Check the username and password for typos.

View File

@@ -13,17 +13,16 @@ class Command(sendtestemail.Command):
if settings.WARN_NO_EMAIL: if settings.WARN_NO_EMAIL:
raise CommandError("Outgoing email not yet configured, see\n " raise CommandError("Outgoing email not yet configured, see\n "
"https://zulip.readthedocs.io/en/latest/production/email.html") "https://zulip.readthedocs.io/en/latest/production/email.html")
subject = "Zulip Test email"
message = ("Success! If you receive this message, you've " message = ("Success! If you receive this message, you've "
"successfully configured sending email from your " "successfully configured sending email from your "
"Zulip server. Remember that you need to restart " "Zulip server. Remember that you need to restart "
"the Zulip server with /home/zulip/deployments/current/scripts/restart-server " "the Zulip server with /home/zulip/deployments/current/scripts/restart-server "
"after changing the settings in /etc/zulip before your changes will take effect.") "after changing the settings in /etc/zulip before your changes will take effect.")
sender = FromAddress.SUPPORT send_mail("Zulip email test", message, FromAddress.SUPPORT, kwargs['email'])
send_mail(subject, message, sender, kwargs['email']) send_mail("Zulip noreply email test", message, FromAddress.NOREPLY, kwargs['email'])
if kwargs['managers']: if kwargs['managers']:
mail_managers(subject, "This email was sent to the site managers.") mail_managers("Zulip manager email test", "This email was sent to the site managers.")
if kwargs['admins']: if kwargs['admins']:
mail_admins(subject, "This email was sent to the site admins.") mail_admins("Zulip admins email test", "This email was sent to the site admins.")