From mboxrd@z Thu Jan 1 00:00:00 1970 From: michael+sup@stapelberg.de (Michael Stapelberg) Date: Sat, 26 Sep 2009 22:28:54 +0200 Subject: [sup-talk] Bug: Messages using inline GPG are not decrypted In-Reply-To: <1253988435-sup-8649@masanjin.net> References: <1253638189-sup-7758@midna.zekjur.net> <1253640093-sup-48@midna.zekjur.net> <1253905743-sup-419@midna.zekjur.net> <1253988435-sup-8649@masanjin.net> Message-ID: <1253996823-sup-6670@midna.zekjur.net> Hi, Excerpts from William Morgan's message of Sa Sep 26 20:09:36 +0200 2009: > I believe I've fixed this in git. Thunderbird is not producing > RFC3156-compliant encrypted emails, but by the Postel's Law we will > accomodate their errors. Let me know if it doesn't work. The changes basically work. The message itself is opened and decrypted correctly. However, when handling some messages, an exception occurs (downcase called on NilClass), which can be fixed like this: --- a/lib/sup/message.rb +++ b/lib/sup/message.rb @@ -436,7 +436,7 @@ private end chunks - elsif m.header.content_type.downcase == "message/rfc822" + elsif m.header.content_type && m.header.content_type.downcase == "message/rfc822" if m.body payload = RMail::Parser.read(m.body) from = payload.header.from.first ? payload.header.from.first.format : "" @@ -456,7 +456,7 @@ private debug "no body for message/rfc822 enclosure; skipping" [] end - elsif m.header.content_type.downcase == "application/pgp" && m.body + elsif m.header.content_type && m.header.content_type.downcase == "application/pgp" && m.body ## 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 Best regards, Michael