Skip to content
Browse files

Added that delivery errors are caught in a way so the mail is still r…

…eturned whether the delivery was successful or not

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 3135ec4 commit 74a612c4a15f3094e478aa79eb63b27efec8358a @dhh dhh committed May 2, 2005
Showing with 11 additions and 9 deletions.
  1. +2 −0 actionmailer/CHANGELOG
  2. +9 −9 actionmailer/lib/action_mailer/base.rb
View
2 actionmailer/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Added that delivery errors are caught in a way so the mail is still returned whether the delivery was successful or not
+
* Fixed that email address like "Jamis Buck, M.D." <wild.medicine@example.net> would cause the quoter to generate emails resulting in "bad address" errors from the mail server #1220 [Jamis Buck]
View
18 actionmailer/lib/action_mailer/base.rb
@@ -100,14 +100,8 @@ def initialize
class << self
def method_missing(method_symbol, *parameters)#:nodoc:
case method_symbol.id2name
- when /^create_([_a-z]\w*)/
- create_from_action($1, *parameters)
- when /^deliver_([_a-z]\w*)/
- begin
- deliver(send("create_" + $1, *parameters))
- rescue Object => e
- raise e if raise_delivery_errors
- end
+ when /^create_([_a-z]\w*)/ then create_from_action($1, *parameters)
+ when /^deliver_([_a-z]\w*)/ then deliver(send("create_" + $1, *parameters))
end
end
@@ -134,7 +128,13 @@ def create(to, subject, body, from, timestamp = nil, headers = {}, charset = @@d
def deliver(mail) #:nodoc:
logger.info "Sent mail:\n #{mail.encoded}" unless logger.nil?
- send("perform_delivery_#{delivery_method}", mail) if perform_deliveries
+
+ begin
+ send("perform_delivery_#{delivery_method}", mail) if perform_deliveries
+ rescue Object => e
+ raise e if raise_delivery_errors
+ end
+
return mail
end

0 comments on commit 74a612c

Please sign in to comment.
Something went wrong with that request. Please try again.