From 0c58d9814b0b420ee598105beac4048d195ed158 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 3 Jan 2011 13:55:26 +0100 Subject: mailer: Added support for /usr/sbin/sendmail. This fixes bug #788. --- config/initializers/mailer_config.rb | 38 ++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'config/initializers/mailer_config.rb') diff --git a/config/initializers/mailer_config.rb b/config/initializers/mailer_config.rb index c24d21d95..974e55953 100644 --- a/config/initializers/mailer_config.rb +++ b/config/initializers/mailer_config.rb @@ -5,23 +5,31 @@ Diaspora::Application.configure do config.action_mailer.default_url_options = {:host => AppConfig[:pod_uri].host} unless Rails.env == 'test' || AppConfig[:mailer_on] != true - config.action_mailer.delivery_method = :smtp - if AppConfig[:smtp_authentication] == "none" - config.action_mailer.smtp_settings = { - :address => AppConfig[:smtp_address], - :port => AppConfig[:smtp_port], - :domain => AppConfig[:smtp_domain] + if AppConfig[:mailer_method] == "sendmail" + config.action_mailer.delivery_method = :sendmail + config.action_mailer.sendmail_settings = { + :location => AppConfig[:sendmail_location] } else - config.action_mailer.smtp_settings = { - :address => AppConfig[:smtp_address], - :port => AppConfig[:smtp_port], - :domain => AppConfig[:smtp_domain], - :authentication => AppConfig[:smtp_authentication], - :user_name => AppConfig[:smtp_username], - :password => AppConfig[:smtp_password], - :enable_starttls_auto => true - } + config.action_mailer.delivery_method = :smtp + if AppConfig[:smtp_authentication] == "none" + config.action_mailer.smtp_settings = { + :address => AppConfig[:smtp_address], + :port => AppConfig[:smtp_port], + :domain => AppConfig[:smtp_domain], + :enable_starttls_auto => false + } + else + config.action_mailer.smtp_settings = { + :address => AppConfig[:smtp_address], + :port => AppConfig[:smtp_port], + :domain => AppConfig[:smtp_domain], + :authentication => AppConfig[:smtp_authentication], + :user_name => AppConfig[:smtp_username], + :password => AppConfig[:smtp_password], + :enable_starttls_auto => true + } + end end end end -- cgit v1.2.3