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

Re: How to activate a given GPG key through a macro...



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

On Monday, September 24 at 08:03 AM, quoth promulgato@xxxxxxxx:
> Thank you for taking the time to explain...

You're quite welcome.

> Here's what I currently have:
>
> macro generic "<esc>2" "<enter-command>set from=promulgato@xxxxxxxx 
> hostname=yahoo.de realname=<enter><enter-command>my_hdr Bcc: 
> <promulgato@xxxxxxxx><enter><enter-command> my_hdr X-PGP-Key:"

Ah, then this would be sufficient:

macro generic "<esc>2" "<enter-command> set from=promulgato@xxxxxxxx 
hostname=yahoo.de realname= pgp_sign_as=0x31577172<enter><enter-command> my_hdr 
Bcc: <promulgato@xxxxxxxx><enter>"

Which is pretty close to what you had, but not exact.

> Now, the code "set pgp --encrypt-to=0x31577172" occurs twice in the 
> pgp section of my .muttrc. Within this scheme, do I need to include 
> that too in the macro??

Eh? That wouldn't do anything at all in a muttrc, that I'm aware of, 
and *should* cause mutt to complain. Under what context is that in 
your muttrc---is it in the middle of a variable setting or something?

> It makes perfect sense, thanks again for explaining it so clearly. 
> Fantastic, then, so I just need to replace "0x31577172" at each 
> occurrence in the .muttrc with "%?a?-u %a?"... 

Not exactly, but close. Here's an example from my muttrc (more or 
less), to demonstrate how it's used. Pay close attention to what gets 
replaced:

set pgp_encrypt_sign_command="pgpewrap gpg %?a?--encrypt-to %a? --charset utf-8 
--force-mdc %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode 
--output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"

When that is actually executed (assuming I send a message to you, for 
example, mutt will interpret that command to be:

pgpewrap gpg --encrypt-to 0xCA8E235E --charset utf-8 --force-mdc 
- --batch --quiet --no-verbose --textmode --output - --encrypt --sign -u 
0xCA8E235E --armor --always-trust -- -r 0x31577172 -- 
/tmp/mutt-tunican-501-8500-1097

See how that works?

But yes, then the command will always refer to the correct key ID's, 
no matter what you've set that key ID to be, without having to reset 
the pgp command yourself.

~Kyle
- -- 
Whenever you have an efficient government, you have a dictatorship.
      -- Harry Truman, lecturing at Columbia University, April 28, 1959
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFG9+KxBkIOoMqOI14RAlbpAJ4wzvoihFBC4WhHUCo+qW7Pulo+ggCgvmSr
Qy1qeMGvc0kzjMpEIB/ka9Q=
=9ZmT
-----END PGP SIGNATURE-----