Hello, 
  Since the Trac is down and it is not possible to create new tickets. I am
dropping off the patch here.

In action-mailer while checking if a part has an attachment, the
content-type's main-type is compared. But before calling main-type it has to
be ensured whether content-type exists, otherwise it will throw an
exception. Many mail clients for example (gnus) don't set content-type for
text/plain parts. 

Index: actionmailer/lib/action_mailer/vendor/tmail/attachments.rb
===================================================================
--- actionmailer/lib/action_mailer/vendor/tmail/attachments.rb	(revision 4617)
+++ actionmailer/lib/action_mailer/vendor/tmail/attachments.rb	(working copy)
@@ -12,7 +12,7 @@
 
     def attachment?(part)
       (part['content-disposition'] && part['content-disposition'].disposition == "attachment") ||
-      part.header['content-type'].main_type != "text"
+        (part.header['content-type'] && part.header['content-type'].main_type != "text")
     end
 
     def attachments
Thanks.

-- 
Surendra Singhi
http://ssinghi.kreeti.com, http://www.kreeti.com
Read my blog at: http://cuttingtheredtape.blogspot.com/
,----
| "All animals are equal, but some animals are more equal than others."
|     -- Orwell, Animal Farm, 1945
`----

_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to