From cf1e2a84fff32ab1cf2a736bb99c53e830d92db3 Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Mon, 6 Jun 2005 16:06:26 +0000 Subject: Handle parsing of recursively multipart messages git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1389 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/lib/action_mailer/vendor/tmail/quoting.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'actionmailer/lib/action_mailer') diff --git a/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb b/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb index 43e834b2a6..4420f2ea6b 100644 --- a/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/quoting.rb @@ -28,9 +28,16 @@ module TMail if multipart? parts.collect { |part| header = part["content-type"] - header && header.main_type == "text" ? - part.unquoted_body(to_charset) : - (header ? attachment_presenter.call(header.params["name"]) : "") + + if part.multipart? + part.body(to_charset, &attachment_presenter) + elsif header.nil? + "" + elsif header.main_type == "text" + part.unquoted_body(to_charset) + else + attachment_presenter.call(header["name"] || "(unnamed)") + end }.join else unquoted_body(to_charset) -- cgit v1.2.3