actionmailer 1.3.1 → 1.3.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionmailer might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ *1.13.2* (February 5th, 2007)
2
+
3
+ * Deprecate server_settings renaming it to smtp_settings, add sendmail_settings to allow you to override the arguments to and location of the sendmail executable. [Koz]
4
+
5
+
1
6
  *1.3.1* (January 16th, 2007)
2
7
 
3
8
  * Depend on Action Pack 1.13.1
data/Rakefile CHANGED
@@ -54,7 +54,7 @@ spec = Gem::Specification.new do |s|
54
54
  s.rubyforge_project = "actionmailer"
55
55
  s.homepage = "http://www.rubyonrails.org"
56
56
 
57
- s.add_dependency('actionpack', '= 1.13.1' + PKG_BUILD)
57
+ s.add_dependency('actionpack', '= 1.13.2' + PKG_BUILD)
58
58
 
59
59
  s.has_rdoc = true
60
60
  s.requirements << 'none'
@@ -27,7 +27,7 @@ unless defined?(ActionController)
27
27
  require 'action_controller'
28
28
  rescue LoadError
29
29
  require 'rubygems'
30
- require_gem 'actionpack', '>= 1.12.5'
30
+ gem 'actionpack', '>= 1.12.5'
31
31
  end
32
32
  end
33
33
 
@@ -184,7 +184,7 @@ module ActionMailer #:nodoc:
184
184
  # * <tt>logger</tt> - the logger is used for generating information on the mailing run if available.
185
185
  # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers.
186
186
  #
187
- # * <tt>server_settings</tt> - Allows detailed configuration of the server:
187
+ # * <tt>smtp_settings</tt> - Allows detailed configuration for :smtp delivery method:
188
188
  # * <tt>:address</tt> Allows you to use a remote mail server. Just change it from its default "localhost" setting.
189
189
  # * <tt>:port</tt> On the off chance that your mail server doesn't run on port 25, you can change it.
190
190
  # * <tt>:domain</tt> If you need to specify a HELO domain, you can do it here.
@@ -193,10 +193,12 @@ module ActionMailer #:nodoc:
193
193
  # * <tt>:authentication</tt> If your mail server requires authentication, you need to specify the authentication type here.
194
194
  # This is a symbol and one of :plain, :login, :cram_md5
195
195
  #
196
+ # * <tt>sendmail_settings</tt> - Allows you to override options for the :sendmail delivery method
197
+ # * <tt>:location</tt> The location of the sendmail executable, defaults to "/usr/sbin/sendmail"
198
+ # * <tt>:arguments</tt> The command line arguments
196
199
  # * <tt>raise_delivery_errors</tt> - whether or not errors should be raised if the email fails to be delivered.
197
200
  #
198
201
  # * <tt>delivery_method</tt> - Defines a delivery method. Possible values are :smtp (default), :sendmail, and :test.
199
- # Sendmail is assumed to be present at "/usr/sbin/sendmail".
200
202
  #
201
203
  # * <tt>perform_deliveries</tt> - Determines whether deliver_* methods are actually carried out. By default they are,
202
204
  # but this can be turned off to help functional testing.
@@ -228,7 +230,7 @@ module ActionMailer #:nodoc:
228
230
  class_inheritable_accessor :template_root
229
231
  cattr_accessor :logger
230
232
 
231
- @@server_settings = {
233
+ @@smtp_settings = {
232
234
  :address => "localhost",
233
235
  :port => 25,
234
236
  :domain => 'localhost.localdomain',
@@ -236,7 +238,13 @@ module ActionMailer #:nodoc:
236
238
  :password => nil,
237
239
  :authentication => nil
238
240
  }
239
- cattr_accessor :server_settings
241
+ cattr_accessor :smtp_settings
242
+
243
+ @@sendmail_settings = {
244
+ :location => '/usr/sbin/sendmail',
245
+ :arguments => '-i -t'
246
+ }
247
+ cattr_accessor :sendmail_settings
240
248
 
241
249
  @@raise_delivery_errors = true
242
250
  cattr_accessor :raise_delivery_errors
@@ -355,6 +363,18 @@ module ActionMailer #:nodoc:
355
363
  def deliver(mail)
356
364
  new.deliver!(mail)
357
365
  end
366
+
367
+ # Server Settings is the old name for <tt>smtp_settings</tt>
368
+ def server_settings
369
+ smtp_settings
370
+ end
371
+ deprecate :server_settings=>"It's now named smtp_settings"
372
+
373
+ def server_settings=(settings)
374
+ ActiveSupport::Deprecation.warn("server_settings has been renamed smtp_settings, this warning will be removed with rails 2.0", caller)
375
+ self.smtp_settings=settings
376
+ end
377
+
358
378
  end
359
379
 
360
380
  # Instantiate a new mailer object. If +method_name+ is not +nil+, the mailer
@@ -542,14 +562,14 @@ module ActionMailer #:nodoc:
542
562
  destinations = mail.destinations
543
563
  mail.ready_to_send
544
564
 
545
- Net::SMTP.start(server_settings[:address], server_settings[:port], server_settings[:domain],
546
- server_settings[:user_name], server_settings[:password], server_settings[:authentication]) do |smtp|
565
+ Net::SMTP.start(smtp_settings[:address], smtp_settings[:port], smtp_settings[:domain],
566
+ smtp_settings[:user_name], smtp_settings[:password], smtp_settings[:authentication]) do |smtp|
547
567
  smtp.sendmail(mail.encoded, mail.from, destinations)
548
568
  end
549
569
  end
550
570
 
551
571
  def perform_delivery_sendmail(mail)
552
- IO.popen("/usr/sbin/sendmail -i -t","w+") do |sm|
572
+ IO.popen("#{sendmail_settings[:location]} #{sendmail_settings[:arguments]}","w+") do |sm|
553
573
  sm.print(mail.encoded.gsub(/\r/, ''))
554
574
  sm.flush
555
575
  end
@@ -2,7 +2,7 @@ module ActionMailer
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 1
4
4
  MINOR = 3
5
- TINY = 1
5
+ TINY = 2
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -787,6 +787,19 @@ EOF
787
787
  assert_match %r{format=flowed}, mail['content-type'].to_s
788
788
  assert_match %r{charset=utf-8}, mail['content-type'].to_s
789
789
  end
790
+
791
+ def test_deprecated_server_settings
792
+ old_smtp_settings = ActionMailer::Base.smtp_settings
793
+ assert_deprecated do
794
+ ActionMailer::Base.server_settings
795
+ end
796
+ assert_deprecated do
797
+ ActionMailer::Base.server_settings={}
798
+ assert_equal Hash.new, ActionMailer::Base.smtp_settings
799
+ end
800
+ ensure
801
+ ActionMailer::Base.smtp_settings=old_smtp_settings
802
+ end
790
803
  end
791
804
 
792
805
  class InheritableTemplateRootTest < Test::Unit::TestCase
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: actionmailer
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.3.1
7
- date: 2007-01-18 00:00:00 -06:00
6
+ version: 1.3.2
7
+ date: 2007-02-05 00:00:00 -06:00
8
8
  summary: Service layer for easy email delivery and testing.
9
9
  require_paths:
10
10
  - lib
@@ -140,5 +140,5 @@ dependencies:
140
140
  requirements:
141
141
  - - "="
142
142
  - !ruby/object:Gem::Version
143
- version: 1.13.1
143
+ version: 1.13.2
144
144
  version: