Index: app/models/mailer.rb =================================================================== --- app/models/mailer.rb (revision 10015) +++ app/models/mailer.rb (working copy) @@ -418,6 +418,12 @@ def self.deliver_mail(mail) return false if mail.to.blank? && mail.cc.blank? && mail.bcc.blank? + if self.async + Thread.start do + super + end + return true + end super end Index: config/initializers/10-patches.rb =================================================================== --- config/initializers/10-patches.rb (revision 9976) +++ config/initializers/10-patches.rb (working copy) @@ -47,9 +47,16 @@ require 'mail' +module ActionMailer + class Base + cattr_accessor :async + end +end + module DeliveryMethods class AsyncSMTP < ::Mail::SMTP def deliver!(*args) + ActiveSupport::Deprecation.warn "async_smtp delivery method is deprecated and will be removed in Redmine 2.2. Use the async property at email_delivery level instead." Thread.start do super *args end @@ -58,6 +65,7 @@ class AsyncSendmail < ::Mail::Sendmail def deliver!(*args) + ActiveSupport::Deprecation.warn "async_sendmail delivery method is deprecated and will be removed in Redmine 2.2. Use the async property at email_delivery level instead." Thread.start do super *args end