From mboxrd@z Thu Jan 1 00:00:00 1970 From: tpo2@sourcepole.ch (Tomas Pospisek ML) Date: Thu, 30 Oct 2008 17:03:45 +0000 Subject: [sup-talk] improvement: add self as recipient on crypted sent messages In-Reply-To: Message-ID: <7tCX6GnV.1225386225.8453510.tpo2@192.168.3.7> On 10/30/2008, "Tomas Pospisek ML" wrote: > >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. 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?