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