Gnus development mailing list
 help / color / mirror / Atom feed
From: "Peter Münster" <pmlists@free.fr>
To: ding@gnus.org
Subject: Re: Automatic GPG signing
Date: Fri, 13 Jun 2014 13:09:25 +0200	[thread overview]
Message-ID: <8761k5m5ga.fsf@micropit.roche-blanche.homenet.org> (raw)
In-Reply-To: <87oaxx2lah.fsf@descartes.rss.mhs.man.ac.uk>

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




  reply	other threads:[~2014-06-13 11:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-12 19:11 Matt Ford
2014-06-12 19:18 ` Gijs Hillenius
2014-06-13  9:47   ` Matt Ford
2014-06-13 11:09     ` Peter Münster [this message]
2014-06-13 11:32       ` Peter Münster
2014-06-13 13:54         ` Matt Ford
2014-06-13 14:15           ` Peter Münster
2014-06-13 13:05       ` Andreas Schwab
2014-06-13 14:04         ` Peter Münster
2014-06-13 14:30           ` Matt Ford

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=8761k5m5ga.fsf@micropit.roche-blanche.homenet.org \
    --to=pmlists@free.fr \
    --cc=ding@gnus.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;
as well as URLs for NNTP newsgroup(s).