diff options
Diffstat (limited to 'actionmailer/lib/action_mailer')
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index b256016d94..6bbc710942 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -184,7 +184,7 @@ module ActionMailer #:nodoc: # * <tt>logger</tt> - the logger is used for generating information on the mailing run if available. # Can be set to nil for no logging. Compatible with both Ruby's own Logger and Log4r loggers. # - # * <tt>server_settings</tt> - Allows detailed configuration of the server: + # * <tt>smtp_settings</tt> - Allows detailed configuration for :smtp delivery method: # * <tt>:address</tt> Allows you to use a remote mail server. Just change it from its default "localhost" setting. # * <tt>:port</tt> On the off chance that your mail server doesn't run on port 25, you can change it. # * <tt>:domain</tt> If you need to specify a HELO domain, you can do it here. @@ -193,10 +193,12 @@ module ActionMailer #:nodoc: # * <tt>:authentication</tt> If your mail server requires authentication, you need to specify the authentication type here. # This is a symbol and one of :plain, :login, :cram_md5 # + # * <tt>sendmail_settings</tt> - Allows you to override options for the :sendmail delivery method + # * <tt>:location</tt> The location of the sendmail executable, defaults to "/usr/sbin/sendmail" + # * <tt>:arguments</tt> The command line arguments # * <tt>raise_delivery_errors</tt> - whether or not errors should be raised if the email fails to be delivered. # # * <tt>delivery_method</tt> - Defines a delivery method. Possible values are :smtp (default), :sendmail, and :test. - # Sendmail is assumed to be present at "/usr/sbin/sendmail". # # * <tt>perform_deliveries</tt> - Determines whether deliver_* methods are actually carried out. By default they are, # but this can be turned off to help functional testing. @@ -228,7 +230,7 @@ module ActionMailer #:nodoc: class_inheritable_accessor :template_root cattr_accessor :logger - @@server_settings = { + @@smtp_settings = { :address => "localhost", :port => 25, :domain => 'localhost.localdomain', @@ -236,7 +238,13 @@ module ActionMailer #:nodoc: :password => nil, :authentication => nil } - cattr_accessor :server_settings + cattr_accessor :smtp_settings + + @@sendmail_settings = { + :location => '/usr/sbin/sendmail', + :arguments => '-i -t' + } + cattr_accessor :sendmail_settings @@raise_delivery_errors = true cattr_accessor :raise_delivery_errors @@ -549,7 +557,7 @@ module ActionMailer #:nodoc: end def perform_delivery_sendmail(mail) - IO.popen("/usr/sbin/sendmail -i -t","w+") do |sm| + IO.popen("#{sendmail_settings[:location]} #{sendmail_settings[:arguments]}","w+") do |sm| sm.print(mail.encoded.gsub(/\r/, '')) sm.flush end |