[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-talk] crypto-mode hook fragment to sign if from address can be signed



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: signature.asc
Description: PGP signature

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