--- /tmp/message.rb	2009-09-30 23:17:51.000000000 +0200
+++ message.rb	2009-09-30 23:59:11.971558435 +0200
@@ -463,12 +464,27 @@
       ## application/pgp. this handles that.
       ##
       ## TODO: unduplicate code between here and multipart_encrypted_to_chunks
-      notice, sig, decryptedm = CryptoManager.decrypt m.body
-      if decryptedm # managed to decrypt
-        children = message_to_chunks decryptedm, true
-        [notice, sig].compact + children
+      full_content_type = m.header.fetch("Content-Type")
+      if full_content_type =~ /sign/
+        old_charset = if m.header.fetch("Old-Content-Type") =~ /charset="?(.*?)"?(;|$)/i
+          $1
+	else
+          nil
+	end
+        body = Iconv.easy_decode($encoding, m.charset || old_charset || $encoding, m.decode) if m.body
+        chunks = text_to_chunks((body || "").normalize_whitespace.split("\n"), encrypted)
+        [CryptoManager.verify(m, m), chunks].flatten.compact
+      elsif full_content_type =~ /encrypt/
+        notice, sig, decryptedm = CryptoManager.decrypt m.body
+        if decryptedm # managed to decrypt
+          children = message_to_chunks decryptedm, true
+          [notice, sig].compact + children
+        else
+          [notice]
+        end
       else
-        [notice]
+        debug "Don't know what to do with inline GPG message"
+	[m.body]
       end
     else
       filename =
