diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-02 15:03:13 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-02 15:03:13 +0000 |
commit | 74a612c4a15f3094e478aa79eb63b27efec8358a (patch) | |
tree | def7b21b7aaabaf2ae16dcbba880f4c5f2ca381e /actionmailer | |
parent | 3135ec40a3304eb79284c4447b0ffc79867f6224 (diff) | |
download | rails-74a612c4a15f3094e478aa79eb63b27efec8358a.tar.gz rails-74a612c4a15f3094e478aa79eb63b27efec8358a.tar.bz2 rails-74a612c4a15f3094e478aa79eb63b27efec8358a.zip |
Added that delivery errors are caught in a way so the mail is still returned whether the delivery was successful or not
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1272 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer')
-rw-r--r-- | actionmailer/CHANGELOG | 2 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/actionmailer/CHANGELOG b/actionmailer/CHANGELOG index bb87dd9014..88c3548046 100644 --- a/actionmailer/CHANGELOG +++ b/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] diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 3b9d25723b..faade19e9e 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -100,14 +100,8 @@ module ActionMailer #:nodoc: 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 @@ module ActionMailer #:nodoc: 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 |