diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 00dcb0b5f..a52ca2165 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -13,6 +13,7 @@ default: pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' mongo_port: 27017 + mailer_on: false smtp_address: 'smtp.example.com' smtp_port: '587' smtp_domain: 'mail.example.com' diff --git a/config/environments/development.rb b/config/environments/development.rb index 80022947e..74a062ea5 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -20,7 +20,7 @@ Diaspora::Application.configure do config.action_controller.perform_caching = false # Don't care if the mailer can't send - config.action_mailer.raise_delivery_errors = true + config.action_mailer.raise_delivery_errors = false config.active_support.deprecation = :log config.middleware.use MongoMapper::ClearDevMemory #config.threadsafe! diff --git a/config/environments/production.rb b/config/environments/production.rb index eebcc420b..8c65da341 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -47,16 +47,4 @@ Diaspora::Application.configure do # the I18n.default_locale when a translation can not be found) config.i18n.fallbacks = true config.threadsafe! - - config.action_mailer.delivery_method = :smtp - config.action_mailer.default_url_options = {:host => 'pivots.joindiaspora.com'} - config.action_mailer.smtp_settings = { - :address => 'smtp.gmail.com', - :port => 587, - :domain => 'mail.joindiaspora.com', - :authentication => 'plain', - :user_name => 'diaspora-pivots@joindiaspora.com', - :password => "xy289|]G+R*-kA", - :enable_starttls_auto => true - } end diff --git a/config/initializers/mailer_config.rb b/config/initializers/mailer_config.rb index cbc5f7330..b334cdb42 100644 --- a/config/initializers/mailer_config.rb +++ b/config/initializers/mailer_config.rb @@ -4,7 +4,7 @@ Diaspora::Application.configure do config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} - unless Rails.env == 'test' + unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => APP_CONFIG[:smtp_address], diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index ba76f4bde..653097042 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -71,14 +71,14 @@ module Diaspora Rails.logger.info("#{self.real_name}'s friend request has been accepted") friend_request.destroy - #Notifier.request_accepted(self, friend_request.person, aspect).deliver + Notifier.request_accepted(self, friend_request.person, aspect).deliver #this is a new friend request else self.pending_requests << friend_request self.save Rails.logger.info("#{self.real_name} has received a friend request") friend_request.save - #Notifier.new_request(self, friend_request.person).deliver + Notifier.new_request(self, friend_request.person).deliver end end