Subject: [sup-talk] gpg signing issue

From: [email-masked] (Jan Spakula)
Date: Tue, 26 Feb 2008 21:40:54 -0600

Hello,

I have an issue with gpg signing emails with sup. The header of sent
emails look like this:
Content-Type: multipart/signed; protocol=""application/pgp-signature""; boundary="=-1204074034-949437-9467-7738-1-="; micalg="pgp-sha1"
Note the double quotation marks around
application/pgp-signature. (I checked it in the "Sent", and of course on
my other e-mail account.) Apparently they throw off at least mutt and
claws-mail, so that they don't recognize the protocol for the
attachment. However, if I manually edit the header to have only one set
of quotation marks, the signature is recognized.

I took a peek on the sources (crypto.rb), and I don't know how the
double quotation marks could be created. Anybody else having this
problem?

Thanks,
  Jan

---
 . gpg key: http://freeshell.de/~teatime/teatime.sig
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080226/134de07a/attachment.bin

---

From: [email-masked] (Nicolas Pouillard)
Date: Wed, 27 Feb 2008 09:39:38 +0100

> double quotation marks could be created. Anybody else having this

That's  a  ruby-mail  bug  with  a  working patch [1], however ruby-mail is no
longer actively maintained :(

[1]: "[2661] set_boundary doubles quotes in params which already contained a quote"
http://rubyforge.org/tracker/index.php?func=detail&aid=2661&group_id=446&atid=1756

-- 
Nicolas Pouillard aka Ertai
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20080227/94488b5f/attachment.bin

---

From: [email-masked] (William Morgan)
Date: Wed, 27 Feb 2008 09:50:37 -0800

Reformatted excerpts from nicolas.pouillard's message of 2008-02-27:
> That's  a  ruby-mail  bug  with  a  working patch [1], however
> ruby-mail is no longer actively maintained :(

I did hear from Matt Armstrong recently that he was starting to maintain
it again. At least, he released a 1.0.0 last month that has Ruby 1.9
modifications. But nothing since.

> http://rubyforge.org/tracker/index.php?func=detail&aid=2661&group_id=446&atid=1756

Does the following workaround help? (Completely untested.)

diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
index 9e16132..ee06958 100644
--- a/lib/sup/crypto.rb
+++ b/lib/sup/crypto.rb
@@ -40,7 +40,7 @@ class CryptoManager
     raise Error, (output || "gpg command failed: #{cmd}") unless $?.success?
 
     envelope = RMail::Message.new
-    envelope.header["Content-Type"] = 'multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1'
+    envelope.header["Content-Type"] = 'multipart/signed; protocol=application/pgp-signature; micalg=pgp-sha1'
 
     envelope.add_part payload
     signature = RMail::Message.make_attachment output, "application/pgp-signature", nil, "signature.asc"

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Jan Spakula)
Date: Wed, 27 Feb 2008 12:56:07 -0600

Excerpts from William Morgan's message of Wed Feb 27 11:50:37 -0600 2008:
> ...

Yes, both fixes work. (Didn't try them simultaneusly though.)

Thanks a lot,
  Jan

---

From: [email-masked] (William Morgan)
Date: Thu, 28 Feb 2008 09:09:55 -0800

> Yes, both fixes work. (Didn't try them simultaneusly though.)

Ok, I'm going to merge this into both next and master.