Subject: [sup-talk] improvement: add self as recipient on sent messages

From: [email-masked] (Tomas Pospisek ML)
Date: Thu, 30 Oct 2008 13:57:16 +0000

Currently sup seems to call gpg with the recipient only. However sup
should add "self" also to the recipients. Otherwise one is not able to
read sent, encrypted mails any more.
*t

---

From: [email-masked] (Tomas Pospisek ML)
Date: Thu, 30 Oct 2008 17:03:45 +0000

>read sent, encrypted mails any more.

Patch is below. Two comments:

1. is there a less ugly way to create a new Array with an additional
element?
2. the patch assumes that adding "From: " to gpg's" --recipient"s is
a sensible thing to do and thus it does it with no questions asked

OK?
*t

--- sup/crypto.rb.orig	2008-10-30 16:36:37.000000000 +0100
+++ sup/crypto.rb	2008-10-30 17:40:07.000000000 +0100
@@ -53,7 +53,7 @@
     payload_fn.write format_payload(payload)
     payload_fn.close

-    recipient_opts = to.map { |r| "--recipient '<#{r}>'" }.join("
")
+    recipient_opts = (to + [ from ] ).map { |r| "--recipient
'<#{r}>'" }.join(" ")
     sign_opts = sign ? "--sign --local-user '#{from}'" : ""
     gpg_output = run_gpg "--output - --armor --encrypt --textmode
#{sign_opts} #{recipient_opts} #{payload_fn.path}"
     raise Error, (gpg_output || "gpg command failed: #{cmd}") unless
$?.success?

---

From: [email-masked] (William Morgan)
Date: Sun, 02 Nov 2008 11:30:54 -0800

> Patch is below. Two comments:

Applied, thanks!

> 1. is there a less ugly way to create a new Array with an additional

Nope, that's the right way.

> 2. the patch assumes that adding "From: " to gpg's" --recipient"s is a
> sensible thing to do and thus it does it with no questions asked

Seems reasonable to me.
-- 
William <wmorgan-sup at masanjin.net>