On 10/30/2008, "Tomas Pospisek ML" <[EMAIL PROTECTED]> 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?
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk