summaryrefslogtreecommitdiffstats
path: root/app/models/mailer.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-13 08:11:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2013-07-13 08:11:20 +0000
commit8ff33ac9f7819ea157f3045a75ea04963504f35d (patch)
tree93d4a412496b186039ef57b394ffbcec92ca2768 /app/models/mailer.rb
parent6ecd90e7ff5cba5c6976062ed01d213a5b46cdfd (diff)
downloadredmine-8ff33ac9f7819ea157f3045a75ea04963504f35d.tar.gz
redmine-8ff33ac9f7819ea157f3045a75ea04963504f35d.zip
Log email delivery errors (#14403).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12010 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models/mailer.rb')
-rw-r--r--app/models/mailer.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/app/models/mailer.rb b/app/models/mailer.rb
index 5c773c5f1..83dbd9fc6 100644
--- a/app/models/mailer.rb
+++ b/app/models/mailer.rb
@@ -430,7 +430,17 @@ class Mailer < ActionMailer::Base
def self.deliver_mail(mail)
return false if mail.to.blank? && mail.cc.blank? && mail.bcc.blank?
- super
+ begin
+ # Log errors when raise_delivery_errors is set to false, Rails does not
+ mail.raise_delivery_errors = true
+ super
+ rescue Exception => e
+ if ActionMailer::Base.raise_delivery_errors
+ raise e
+ else
+ Rails.logger.error "Email delivery error: #{e.message}"
+ end
+ end
end
def self.method_missing(method, *args, &block)