aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-01-19 14:28:04 +0100
committerJosé Valim <jose.valim@gmail.com>2010-01-19 14:28:04 +0100
commitc1848f9736d9a4a45181642106acecb6a83a45a3 (patch)
tree982fd3ea7b1ba41d123d3188d0dfd36668c3abe3 /actionmailer/lib/action_mailer/base.rb
parentc8e2998701653df9035232778d60f18c4a07abb4 (diff)
downloadrails-c1848f9736d9a4a45181642106acecb6a83a45a3.tar.gz
rails-c1848f9736d9a4a45181642106acecb6a83a45a3.tar.bz2
rails-c1848f9736d9a4a45181642106acecb6a83a45a3.zip
Get all tests passing.
Diffstat (limited to 'actionmailer/lib/action_mailer/base.rb')
-rw-r--r--actionmailer/lib/action_mailer/base.rb36
1 files changed, 30 insertions, 6 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 082560e695..5ece35e69b 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -367,7 +367,29 @@ module ActionMailer #:nodoc:
# Mail uses the same defaults as Rails, except for the file delivery method
# save location so we just add this here.
def delivery_settings
- @delivery_settings ||= {:file => {:location => defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails"}}
+ @@delivery_settings ||= begin
+ hash = Hash.new { |h,k| h[k] = {} }
+ hash[:file] = {
+ :location => defined?(Rails.root) ? "#{Rails.root}/tmp/mails" : "#{Dir.tmpdir}/mails"
+ }
+
+ hash[:smtp] = {
+ :address => "localhost",
+ :port => 25,
+ :domain => 'localhost.localdomain',
+ :user_name => nil,
+ :password => nil,
+ :authentication => nil,
+ :enable_starttls_auto => true
+ }
+
+ hash[:sendmail] = {
+ :location => '/usr/sbin/sendmail',
+ :arguments => '-i -t'
+ }
+
+ hash
+ end
end
alias :controller_path :mailer_name
@@ -386,7 +408,11 @@ module ActionMailer #:nodoc:
end
elsif match = matches_settings_method?(method_symbol)
# TODO Deprecation warning
- delivery_settings[match[1].to_sym] = parameters[0]
+ if match[2]
+ delivery_settings[match[1].to_sym] = parameters[0]
+ else
+ delivery_settings[match[1].to_sym]
+ end
else
super
end
@@ -461,13 +487,11 @@ module ActionMailer #:nodoc:
private
def get_delivery_settings(method) #:nodoc:
- method.is_a?(Symbol) ? delivery_settings[method] : delivery_settings[:custom]
+ delivery_settings[method]
end
def matches_settings_method?(method_name) #:nodoc:
- method_name = method_name.to_s
- delivery_method.is_a?(Symbol) ? method = delivery_method : method = :custom
- /(file|sendmail|smtp)_settings$/.match(method_name)
+ /(\w+)_settings(=)?$/.match(method_name.to_s)
end
def matches_dynamic_method?(method_name) #:nodoc: