Allow customization of test email recipient (#2107)

* Update configuration.rake

use env variable SMTP_TEST_RECIPIENT so customers using mail providers like Microsoft can specify RFC 2606 compliant destination test recipients

* add SMTP_TEST_RECIPIENT to sample.env

add SMTP_TEST_RECIPIENT to sample.env with default value to ensure retro compatibility

* default to notifications@example.com

default to notifications@example.com should SMTP_TEST_RECIPIENT not be defined

Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
This commit is contained in:
Jordi Molina 2020-09-22 17:03:47 +02:00 committed by GitHub
parent 75b989240a
commit 5a38ae488e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -49,7 +49,7 @@ def test_smtp
authtype = ENV['SMTP_AUTH'].present? && ENV['SMTP_AUTH'] != "none" ? ENV['SMTP_AUTH'] : nil
smtp.start(ENV['SMTP_DOMAIN'], user, password, authtype) do |s|
s.sendmail('test', ENV['SMTP_USERNAME'], 'notifications@example.com')
s.sendmail('test', ENV['SMTP_USERNAME'], ENV.fetch('SMTP_TEST_RECIPIENT', 'notifications@example.com'))
end
rescue => e
failed("Error connecting to SMTP - #{e}")

View File

@ -138,6 +138,10 @@ SMTP_STARTTLS_AUTO=
# Specify the email address that all mail is sent from
SMTP_SENDER=
# Specify the recipient for test emails (needed for providers like Microsoft, who are very
# strict about RFC 2606)
SMTP_TEST_RECIPIENT=notifications@example.com
# Prefix for the applications root URL.
# Useful for deploying the application to a subdirectory, which is highly recommended
# if deploying on a BigBlueButton server. Keep in mind that if you change this, you'll
@ -282,4 +286,4 @@ DEFAULT_REGISTRATION=open
# GCS_CLIENT_ID=
# GCS_CLIENT_CERT=
# GCS_PROJECT=
# GCS_BUCKET=
# GCS_BUCKET=