lib/sup/message.rb in sup-0.15.2 vs lib/sup/message.rb in sup-0.15.3

- old
+ new

@@ -261,13 +261,13 @@ rmsg = location.parsed_message parse_header rmsg.header message_to_chunks rmsg rescue SourceError, SocketError, RMail::EncodingUnsupportedError => e warn "problem reading message #{id}" - [Chunk::Text.new(error_message.split("\n"))] - debug "could not load message: #{location.inspect}, exception: #{e.inspect}" + + [Chunk::Text.new(error_message.split("\n"))] end end def error_message <<EOS @@ -495,17 +495,25 @@ ## apparently some versions of Thunderbird generate encryped email that ## does not follow RFC3156, e.g. messages with X-Enigmail-Version: 0.95.0 ## they have no MIME multipart and just set the body content type to ## application/pgp. this handles that. ## - ## TODO: unduplicate code between here and multipart_encrypted_to_chunks + ## TODO 1: unduplicate code between here and + ## multipart_encrypted_to_chunks + ## TODO 2: this only tries to decrypt. it cannot handle inline PGP notice, sig, decryptedm = CryptoManager.decrypt m.body if decryptedm # managed to decrypt children = message_to_chunks decryptedm, true [notice, sig].compact + children else - [notice] + ## try inline pgp signed + chunks = inline_gpg_to_chunks m.body, $encoding, (m.charset || $encoding) + if chunks + chunks + else + [notice] + end end else filename = ## first, paw through the headers looking for a filename. ## RFC 2183 (Content-Disposition) specifies that disposition-parms are @@ -577,9 +585,10 @@ # -----BEGIN PGP SIGNED MESSAGE----- # and # -----END PGP SIGNED MESSAGE----- # # In some cases, END PGP SIGNED MESSAGE doesn't appear + # (and may leave strange -----BEGIN PGP SIGNATURE----- ?) gpg = lines.between(GPG_SIGNED_START, GPG_SIGNED_END) # between does not check if GPG_END actually exists # Reference: http://permalink.gmane.org/gmane.mail.sup.devel/641 if !gpg.empty? msg = RMail::Message.new