Changeset 6094
- Timestamp:
- 01/31/07 02:07:09 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1-2-stable/actionmailer/CHANGELOG
r5984 r6094 1 *SVN* 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 1 5 *1.3.1* (January 16th, 2007) 2 6 branches/1-2-stable/actionmailer/lib/action_mailer/base.rb
r5081 r6094 185 185 # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers. 186 186 # 187 # * <tt>s erver_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. … … 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, … … 229 231 cattr_accessor :logger 230 232 231 @@s erver_settings = {233 @@smtp_settings = { 232 234 :address => "localhost", 233 235 :port => 25, … … 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 … … 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 … … 543 563 mail.ready_to_send 544 564 545 Net::SMTP.start(s erver_settings[:address], server_settings[:port], server_settings[:domain],546 s erver_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 … … 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 branches/1-2-stable/actionmailer/test/mail_service_test.rb
r5081 r6094 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