2019-05-02 17:17:27 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-03-22 19:57:59 -05:00
|
|
|
if SiteSetting.notification_email == SiteSetting.defaults[:notification_email]
|
|
|
|
# don't crash for invalid hostname, which is possible in dev
|
2015-03-22 20:16:21 -05:00
|
|
|
begin
|
|
|
|
SiteSetting.notification_email = "noreply@#{Discourse.current_hostname}"
|
|
|
|
rescue Discourse::InvalidParameters
|
2020-04-15 10:21:21 -05:00
|
|
|
if Rails.env.production?
|
|
|
|
STDERR.puts "WARNING: Discourse hostname: #{Discourse.current_hostname} is not a valid domain for emails!"
|
|
|
|
end
|
2015-03-22 20:16:21 -05:00
|
|
|
end
|
2015-03-22 19:57:59 -05:00
|
|
|
end
|