Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Marc Hartstein <marc.hartstein@alum.vassar.edu>
To: sup-talk <sup-talk@rubyforge.org>
Subject: [sup-talk] crypto-mode hook fragment to sign if from address can be signed
Date: Sat, 29 Jan 2011 12:31:07 -0500	[thread overview]
Message-ID: <1296322007-sup-3060@cabinet> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 822 bytes --]

I wrote this crypto-mode hook fragment so sup will default to Sign when
it has selected a from address for the outgoing email for which I have a
key which can sign emails. I have an occasionally used address for
outgoing mail which is not associated with my private key and which only
posts to a mailing list which complains about signed email anyway, so
this makes my life easier.

Posted to share if anybody else finds it useful, and also to solicit
suggestions for improvements. It works as-is, but I'm neither a Ruby nor
GPG expert and wouldn't be surprised to learn there's a better way.

======================================================================
sign_addresses = `gpg -K`.grep(/<(.*)>/){$1}
crypto_selector.set_to :sign if not sign_addresses.select{|a| header["From"].include?(a) }.empty?

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

             reply	other threads:[~2011-01-29 17:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-29 17:31 Marc Hartstein [this message]
2011-01-29 18:50 ` Tero Tilus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296322007-sup-3060@cabinet \
    --to=marc.hartstein@alum.vassar.edu \
    --cc=sup-talk@rubyforge.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox