forked from External/greenlight
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:
parent
75b989240a
commit
5a38ae488e
|
@ -49,7 +49,7 @@ def test_smtp
|
||||||
authtype = ENV['SMTP_AUTH'].present? && ENV['SMTP_AUTH'] != "none" ? ENV['SMTP_AUTH'] : nil
|
authtype = ENV['SMTP_AUTH'].present? && ENV['SMTP_AUTH'] != "none" ? ENV['SMTP_AUTH'] : nil
|
||||||
|
|
||||||
smtp.start(ENV['SMTP_DOMAIN'], user, password, authtype) do |s|
|
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
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
failed("Error connecting to SMTP - #{e}")
|
failed("Error connecting to SMTP - #{e}")
|
||||||
|
|
|
@ -138,6 +138,10 @@ SMTP_STARTTLS_AUTO=
|
||||||
# Specify the email address that all mail is sent from
|
# Specify the email address that all mail is sent from
|
||||||
SMTP_SENDER=
|
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.
|
# Prefix for the applications root URL.
|
||||||
# Useful for deploying the application to a subdirectory, which is highly recommended
|
# 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
|
# 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_ID=
|
||||||
# GCS_CLIENT_CERT=
|
# GCS_CLIENT_CERT=
|
||||||
# GCS_PROJECT=
|
# GCS_PROJECT=
|
||||||
# GCS_BUCKET=
|
# GCS_BUCKET=
|
||||||
|
|
Loading…
Reference in New Issue