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