Re: Unsetting GPG after setting it with send-hook
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Friday, October 6 at 01:43 PM, quoth Patrick Ben Koetter:
>Any idea what I am missing? Should I use
>
> send-hook . unset pgp_autoencrypt
>
>to set things back to normal?
Yup. Generally, when you set something with a particular hook, you
usually want to set it back to your default with the same sort of
hook. Keep in mind: folder hooks only get triggered when you change
folders, while send-hooks get triggered whenever you send a message.
Thus, if you set pgp_autoencrypt in a send hook and unset it in a
folder hook, once it is set it will only become unset once you change
folders.
One gotcha, however, is that the ordering of hooks in your muttrc is
important. For example, this will not do what you want:
send-hook '~C pgpguy' set pgp_autoencrypt
send-hook . unset pgp_autoencrypt
While this will:
send-hook . unset pgp_autoencrypt
send-hook '~C pgpguy' set pgp_autoencrypt
The reason is that in the first case, when you compose a message to
"pgpguy", mutt will see that it matches the first hook, and will set
pgp_autoencrypt. Then it will see that it matches the second hook, and
will unset pgp_autoencrypt. In the second one, however, it will be
just the reverse, and so will do what you want: normal messages will
only match the first hook and not the second, while messages to pgpguy
will match both, and will be encrypted.
~Kyle
- --
If there be any among us who would wish to dissolve this Union or to
change its republican form, let them stand undisturbed as monuments of
the safety with which error of opinion may be tolerated where reason
is left free to combat it.
-- Thomas Jefferson: First Inaugural, 1801
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD8DBQFFJmZgBkIOoMqOI14RAgaSAKD9/lq1hy1YWl5GmzjlMc0+++51SgCg6y4R
SxZ8HrsBK1nwQmI6FTScNdQ=
=M/VG
-----END PGP SIGNATURE-----