mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 10:30:31 +08:00
If someone is working on SMTP-related code, they might actually know what they're doing and want to use the provided environment variables to send mail. This allows that.
13 lines
539 B
Ruby
13 lines
539 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Load the Rails application.
|
|
require_relative "application"
|
|
|
|
# Initialize the Rails application.
|
|
Rails.application.initialize!
|
|
|
|
# When in "dev" mode, ensure we won't be sending any emails
|
|
if Rails.env.development? && !GlobalSetting.try(:use_smtp_environment_in_development) &&
|
|
ActionMailer::Base.smtp_settings.slice(:address, :port) != { address: "localhost", port: 1025 }
|
|
fail "In development mode, you should be using a local development mail server to avoid unintentionally sending real mail"
|
|
end
|