[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-devel] RubyMail cannot handle multipart/signed messages



On Mon, Apr 19, 2010 at 17:57 (+0200), Michael Stapelberg wrote:
> 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:

The first part is a multipart-message in itself, you have to recurse to get
hands on its parts:

irb(main):012:0> pp mail.parts.first.parts.map { |p| p.content_type }
["text/plain; charset=US-ASCII",
 "text/plain; charset=US_ASCII",
 "text/plain; charset=US_ASCII",
 "text/plain; charset=US_ASCII",
 "text/plain; charset=US_ASCII"]


This is not only legal, RFC 3156 even requires this (in 5.):

  The multipart/signed body MUST consist of exactly two parts.  The first part
  contains the signed data in MIME canonical format, including a set of
  appropriate content headers describing the data.

  The second body MUST contain the OpenPGP digital signature.  It MUST be
  labeled with a content type of "application/pgp-signature".


Best wishes, Sam

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel