[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sup-devel] RubyMail cannot handle multipart/signed messages
Hi Sam,
Excerpts from Sam Hall's message of 2010-04-19 14:55:37 +0200:
> ~> irb -r mail
> irb(main):001:0> pp Mail.read('mwe').parts
> [#<Mail::Part:16136008, Multipart: true, Headers: <Content-Type: multipart/mixed; boundary="MP_/+kacMkT=yx+FKvl3YUds1sR">>,
> #<Mail::Part:19934460, Multipart: false, Headers: <Content-Type: application/pgp-signature; name=signature.asc>, <Content-Disposition: attachment; filename=signature.asc>>]
> => nil
> What's the problem on your side?
The problem arises as soon as you try to iterate over the content of the mail.
You will see that it only contains 2 parts (according to 'mail'), while there
are at least three text files, a signature and a text part:
irb(main):003:0> puts mail.parts.length
2
irb(main):006:0> pp mail.parts.map { |p| p.content_type }
["multipart/mixed; boundary=\"MP_/+kacMkT=yx+FKvl3YUds1sR\"",
"application/pgp-signature; name=signature.asc"]
irb(main):007:0>
Best regards,
Michael
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel