Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Automatically sign/encrypt messages
Date: Fri, 30 Jan 2004 14:06:43 -0500	[thread overview]
Message-ID: <4nekthi7cs.fsf@collins.bwh.harvard.edu> (raw)
In-Reply-To: <87n086ach0.fsf@ulm.my.lan>

On Thu, 29 Jan 2004, news@u-h-l.de wrote:

> But then I wanted to go one step further and not only sign but also
> encrypt all messages, at least if this is possible (i.e. if the
> recipient also uses PGP).

[...]

(add-hook
 'message-send-hook
 (lambda ()
   (let ((recipient (message-fetch-field "To")))
     (cond ((and (not (null recipient))
		 (or (pgg-lookup-key recipient)
		     (pgg-fetch-key pgg-default-keyserver-address recipient)))
	    (mml-secure-message-encrypt-pgpmime))
	   (t
	    (mml-secure-message-sign-pgpmime))))))

> This works perfectly for me. Gnus encrypts the message if gpg
> already has the recipient's key in its keyring or if it can get the
> key from a keyserver. Otherwise the message is only signed.

This looks useful enough to be in the main Gnus code, if it's not
already.  Maybe as mml-secure-message-encrypt-or-sign-pgpmime?

Ted


  reply	other threads:[~2004-01-30 19:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29 17:31 Klaus Uhl
2004-01-30 19:06 ` Ted Zlatanov [this message]
     [not found]   ` <87ptd0jsqv.fsf@u-h-l.de>
2004-02-02 20:27     ` Ted Zlatanov
2014-05-15 21:41       ` Peter Münster
2004-02-04 16:33 ` Eric Simon
2004-02-04 16:51   ` Klaus Uhl
     [not found]     ` <87znby7oby.fsf@pc70-23.unine.ch>
     [not found]       ` <87r7xar7i9.fsf@ulm.my.lan>
2004-02-05 18:37         ` Eric Simon

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=4nekthi7cs.fsf@collins.bwh.harvard.edu \
    --to=tzz@lifelogs.com \
    /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).