From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.229.71 with SMTP id jh7cs96178icb; Sat, 29 Jan 2011 09:46:28 -0800 (PST) Received: by 10.224.37.74 with SMTP id w10mr4415161qad.163.1296323186523; Sat, 29 Jan 2011 09:46:26 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id bb9si20068632qcb.71.2011.01.29.09.46.26; Sat, 29 Jan 2011 09:46:26 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id BED1518583C9; Sat, 29 Jan 2011 12:46:25 -0500 (EST) Received: from mail-yw0-f50.google.com (mail-yw0-f50.google.com [209.85.213.50]) by rubyforge.org (Postfix) with ESMTP id 955221858387 for ; Sat, 29 Jan 2011 12:31:14 -0500 (EST) Received: by ywc21 with SMTP id 21so1629523ywc.23 for ; Sat, 29 Jan 2011 09:31:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:subject:from:to:date:message-id :user-agent:content-transfer-encoding:mime-version:content-type; bh=GepFrWQ83Vfw+dO6gB5ETATFj0mPh5/hOGdpRIBF0Pc=; b=KpQjJdrH7631UAq1G6dvPcWp0vOkuogTTFCyl9Y/bhL5mfY6JQNIEYt9A6a2//Fc9E YA+SvDq7lTy2WHZEfBzQGo/30YLf3rVANRZdZLyIYvK2WAcP7J3MIw2raclNTU1RZlPo 6z0qBWUCSXtp1g2Z4HRvKJu8V0hHU4isAQBI8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:subject:from:to:date:message-id:user-agent :content-transfer-encoding:mime-version:content-type; b=MN2OQK8uIX/EnjuAU+86noEM1F1HyI0e2uE+MvQHcfQYyy1XPSFmNpqmZeW4xX21pa uPT1HuXnc9BbUGKBmSrPilEC+bjnNBHBfv2Smx+fr9t+/8PcG9B2G0rW8fURpV3aXpmL BmYuaZnUSxGQVlcOihtnsRefmw/a2gNxctT98= Received: by 10.150.211.5 with SMTP id j5mr822845ybg.378.1296322274128; Sat, 29 Jan 2011 09:31:14 -0800 (PST) Received: from cabinet.magus.is-a-geek.com (99-114-88-81.lightspeed.miamfl.sbcglobal.net [99.114.88.81]) by mx.google.com with ESMTPS id j3sm12381695ybe.11.2011.01.29.09.31.13 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 29 Jan 2011 09:31:13 -0800 (PST) Received: by cabinet.magus.is-a-geek.com (Postfix, from userid 1000) id 2801730C19D; Sat, 29 Jan 2011 12:31:12 -0500 (EST) From: Marc Hartstein To: sup-talk Date: Sat, 29 Jan 2011 12:31:07 -0500 Message-Id: <1296322007-sup-3060@cabinet> User-Agent: Sup/git MIME-Version: 1.0 Subject: [sup-talk] crypto-mode hook fragment to sign if from address can be signed X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============0966806831==" Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org --===============0966806831== Content-Transfer-Encoding: 8bit Content-Type: multipart/signed; boundary="=-1296322272-124950-31319-7932-1-="; protocol="application/pgp-signature" --=-1296322272-124950-31319-7932-1-= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D sign_addresses =3D `gpg -K`.grep(/<(.*)>/){$1} crypto_selector.set_to :sign if not sign_addresses.select{|a| header["Fro= m"].include?(a) }.empty? --=-1296322272-124950-31319-7932-1-= Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) iEYEARECAAYFAk1ETuAACgkQSEext8NjodvvMACfbqFajwkIKlqNO0S6XiXzanU1 26IAn3Kh2+V6TjCCG8UEYrJt3kXKIARV =4FSz -----END PGP SIGNATURE----- --=-1296322272-124950-31319-7932-1-=-- --===============0966806831== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk --===============0966806831==--