From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84607 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?Peter_M=C3=BCnster?= Newsgroups: gmane.emacs.gnus.general Subject: Re: Automatic GPG signing Date: Fri, 13 Jun 2014 13:09:25 +0200 Message-ID: <8761k5m5ga.fsf@micropit.roche-blanche.homenet.org> References: <87oaxy0wpa.fsf@descartes.rss.mhs.man.ac.uk> <874mzqlyws.fsf@hillenius.net> <87oaxx2lah.fsf@descartes.rss.mhs.man.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1402657791 11473 80.91.229.3 (13 Jun 2014 11:09:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2014 11:09:51 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32852=ding+2Daccount=gmane.org@lists.math.uh.edu Fri Jun 13 13:09:45 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WvPMf-0000WS-0B for ding-account@gmane.org; Fri, 13 Jun 2014 13:09:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1WvPMe-0004uO-74 for ding-account@gmane.org; Fri, 13 Jun 2014 06:09:44 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1WvPMb-0004uG-Qd for ding@lists.math.uh.edu; Fri, 13 Jun 2014 06:09:41 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1WvPMZ-00021e-Lf for ding@lists.math.uh.edu; Fri, 13 Jun 2014 06:09:41 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1WvPMX-0002fs-OM for ding@gnus.org; Fri, 13 Jun 2014 13:09:37 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WvPMW-0000Q5-V5 for ding@gnus.org; Fri, 13 Jun 2014 13:09:36 +0200 Original-Received: from arennes-651-1-364-33.w2-14.abo.wanadoo.fr ([2.14.203.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Jun 2014 13:09:36 +0200 Original-Received: from pmlists by arennes-651-1-364-33.w2-14.abo.wanadoo.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Jun 2014 13:09:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 45 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: arennes-651-1-364-33.w2-14.abo.wanadoo.fr User-Agent: Gnus/5.130012 (=?utf-8?Q?=E7=9C=9F?= Gnus v0.12) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:huLYBhrg9l0zCGHN5vFxUrXAKUY= X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84607 Archived-At: On Fri, Jun 13 2014, Matt Ford wrote: > http://www.emacswiki.org/emacs/DefaultEncrypt Hi, If you want a very easy setup (encrypt whenever all recipients have keys), then you could use something like this: --8<---------------cut here---------------start------------->8--- (defun pm/message-send () (unless (message-field-value gnus-delay-header) ; see http://article.gmane.org/gmane.emacs.gnus.general/84598 (unless (string-equal pm/role "list") ; no gpg stuff in lists (if (jl-epg-check-unique-keys (jl-mail-recipients)) (mml-secure-message-sign-encrypt) (mml-secure-message-sign))) (or (pm/spell) (keyboard-quit)))) ; see http://article.gmane.org/gmane.emacs.gnus.general/84461 (add-hook 'message-send-hook 'pm/message-send) --8<---------------cut here---------------end--------------->8--- And when you want to fetch unknown keys from a signed message: --8<---------------cut here---------------start------------->8--- (defun pm/gnus-article-receive-epg-keys () "Fetch unknown keys from a signed message. >From http://article.gmane.org/gmane.emacs.gnus.user/15894" (interactive) (goto-char (point-min)) (if (re-search-forward "\\[\\[PGP Signed Part:No public key for \\([A-F0-9]\\{16,16\\}\\) created at " nil 'noerror) (progn (epg-import-keys-from-server (epg-make-context 'OpenPGP) (list (match-string 1))) (gnus-summary-prev-article) (gnus-summary-next-article) (gnus-summary-select-article-buffer)) (message "No unknown signed parts found."))) --8<---------------cut here---------------end--------------->8--- HTH, -- Peter