<<< Date Index >>>     <<< Thread Index >>>

Re: Retrieving select PGP keys



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday, November 21 at 05:18 PM, quoth Jorge Luis:
> I want to auto-retrieve PGP public keys for only certain messages.  
> I don't want to fill my keyring with keys from mailing lists, for 
> example, but I do want to retrieve and verify keys from private 
> correspondents.

This can be accomplished pretty easily using a message hook and some 
extra variables.

First, put your pgp decode commands in custom variables, like so:

     set my_pgpdecode="gpgwrapper.sh --charset utf-8 --status-fd=2 --no-verbose 
--quiet --batch --output - %f"

     set my_pgpdecrypt="gpg --status-fd=2 --no-verbose --quiet --batch --output 
- %f"

Now, store the special argument:

     set my_pgplookuparg="--keyserver-options auto-key-retrieve=1"

Then create a few message hooks, like this:

     message-hook . 'set pgp_decode_command="$my_pgpdecode $my_pgplookuparg"'
     message-hook . 'set pgp_decrypt_command="$my_pgpdecrypt $my_pgplookuparg"'
     message-hook ~l 'set pgp_decode_command="$my_pgpdecode"'
     message-hook ~l 'set pgp_decrypt_command="$my_pgpdecrypt"'

I haven't tested that; you may have to set up more hooks for the other 
pgp-related commands (pgp_verify_command, etc), but that's the basic 
idea: messages from mailing lists don't get the auto-key-retrieve 
keyserver option. What do you think?

~Kyle
- -- 
When we blindly adopt any religion, political system, or literary 
dogma, we become automatons. We cease to grow.
                                                           -- Anais Nin
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAkknPNcACgkQBkIOoMqOI17BwQCg1nG+NxXgowVLR0CYrnXfFE99
48wAn31Lc2rXUAYG6k03XElLaogSWk69
=rZob
-----END PGP SIGNATURE-----