Email delivery configuration moved to an unversioned YAML file (config/email.yml, see the sample file) (#1412).
Email delivery is disabled. It's automatically turned on when configuration is found. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1625 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
1 parent
5d0b53544c
commit
fc42dd2cef
37 files changed
+89
-32
No files matched your search
@@ -0,0 +1,21 @@
|
||||
# Outgoing email settings
|
||||
|
||||
production:
|
||||
delivery_method: :smtp
|
||||
smtp_settings:
|
||||
address: smtp.somenet.foo
|
||||
port: 25
|
||||
domain: somenet.foo
|
||||
authentication: :login
|
||||
user_name: redmine@somenet.foo
|
||||
password: redmine
|
||||
|
||||
development:
|
||||
delivery_method: :smtp
|
||||
smtp_settings:
|
||||
address: 127.0.0.1
|
||||
port: 25
|
||||
domain: somenet.foo
|
||||
authentication: :login
|
||||
user_name: redmine@somenet.foo
|
||||
password: redmine
|
||||
+4
-20
@@ -49,25 +49,9 @@ Rails::Initializer.run do |config|
|
||||
# Use Active Record's schema dumper instead of SQL when creating the test database
|
||||
# (enables use of different database adapters for development and test environments)
|
||||
# config.active_record.schema_format = :ruby
|
||||
|
||||
# See Rails::Configuration for more options
|
||||
|
||||
# SMTP server configuration
|
||||
config.action_mailer.smtp_settings = {
|
||||
:address => "127.0.0.1",
|
||||
:port => 25,
|
||||
:domain => "somenet.foo",
|
||||
:authentication => :login,
|
||||
:user_name => "redmine@somenet.foo",
|
||||
:password => "redmine",
|
||||
}
|
||||
|
||||
config.action_mailer.perform_deliveries = true
|
||||
|
||||
# Tell ActionMailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
#config.action_mailer.delivery_method = :test
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
|
||||
# Deliveries are disabled by default. Do NOT modify this section.
|
||||
# Define your email configuration in email.yml instead.
|
||||
# It will automatically turn deliveries on
|
||||
config.action_mailer.perform_deliveries = false
|
||||
end
|
||||
@@ -13,4 +13,5 @@ config.whiny_nils = true
|
||||
config.action_controller.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
config.action_mailer.perform_deliveries = true
|
||||
config.action_mailer.delivery_method = :test
|
||||
@@ -13,4 +13,5 @@ config.whiny_nils = true
|
||||
config.action_controller.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
config.action_mailer.delivery_method = :test
|
||||
config.action_mailer.perform_deliveries = true
|
||||
config.action_mailer.delivery_method = :test
|
||||
@@ -13,4 +13,5 @@ config.whiny_nils = true
|
||||
config.action_controller.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
config.action_mailer.delivery_method = :test
|
||||
config.action_mailer.perform_deliveries = true
|
||||
config.action_mailer.delivery_method = :test
|
||||
@@ -0,0 +1,17 @@
|
||||
# Loads action_mailer settings from email.yml
|
||||
# and turns deliveries on if configuration file is found
|
||||
|
||||
filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
|
||||
if File.file?(filename)
|
||||
mailconfig = YAML::load_file(filename)
|
||||
|
||||
if mailconfig.is_a?(Hash) && mailconfig.has_key?(Rails.env)
|
||||
# Enable deliveries
|
||||
ActionMailer::Base.perform_deliveries = true
|
||||
|
||||
mailconfig[Rails.env].each do |k, v|
|
||||
v.symbolize_keys! if v.respond_to?(:symbolize_keys!)
|
||||
ActionMailer::Base.send("#{k}=", v)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user