Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 6095

Show
Ignore:
Timestamp:
01/31/07 02:09:45 (3 years ago)
Author:
nzkoz
Message:

Rename server_settings to smtp_settings, add sendmail_settings to allow you to override the arguments to and location of the sendmail executable. [Koz]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionmailer/CHANGELOG

    r5505 r6095  
    11*SVN* 
     2 
     3* Rename server_settings to smtp settings, and add  sendmail_settings to allow you to override the arguments to and location of the sendmail executable. [Koz] 
    24 
    35* Allow mailer actions named send by using __send__ internally.  #6467 [iGEL] 
  • trunk/actionmailer/lib/action_mailer/base.rb

    r5505 r6095  
    185185  #   Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers. 
    186186  # 
    187   # * <tt>server_settings</tt> -  Allows detailed configuration of the server
     187  # * <tt>smtp_settings</tt> -  Allows detailed configuration for :smtp delivery method
    188188  #   * <tt>:address</tt> Allows you to use a remote mail server. Just change it from its default "localhost" setting. 
    189189  #   * <tt>:port</tt> On the off chance that your mail server doesn't run on port 25, you can change it. 
     
    194194  #     This is a symbol and one of :plain, :login, :cram_md5 
    195195  # 
     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 
    196199  # * <tt>raise_delivery_errors</tt> - whether or not errors should be raised if the email fails to be delivered. 
    197200  # 
    198201  # * <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". 
    200202  # 
    201203  # * <tt>perform_deliveries</tt> - Determines whether deliver_* methods are actually carried out. By default they are, 
     
    229231    cattr_accessor :logger 
    230232 
    231     @@server_settings = {  
     233    @@smtp_settings = {  
    232234      :address        => "localhost",  
    233235      :port           => 25,  
     
    237239      :authentication => nil 
    238240    } 
    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 
    240248 
    241249    @@raise_delivery_errors = true 
     
    550558 
    551559      def perform_delivery_sendmail(mail) 
    552         IO.popen("/usr/sbin/sendmail -i -t","w+") do |sm| 
     560        IO.popen("#{sendmail_settings[:location]} #{sendmail_settings[:arguments]}","w+") do |sm| 
    553561          sm.print(mail.encoded.gsub(/\r/, '')) 
    554562          sm.flush