Post by Dominik Vogtand there is a public key for that address in the GPG keyring,
mutt still asks for a key to use for encryption. Can I tell mutt
to use the key matching the receiver address automatically?
It depends on which question it's asking you. If it's asking which
key to use then there may be multipole UIDs on the key for which it
needs clarification or there may be multiple keys which match the UID
that matches the address. This can be specified in advance with a
crypt-hook.
If you already use GPG group options iin gpg.conf, there's a script in
the GPGME Python binding examples directory that will generate
crypt-hooks from the gpg.conf automatically. In spite of its
location, it does not require GPGME to run that script. Pretty much
all the others in that directory do, but not that one (but it is in
Python and it had to go somewhere).
It's also possible that you may see a second question after the key
has been selected asking if you;'re sure you want to encrypt to that
key. That's a result of encrypting to a key which you haven'tt
signed. The traditional method of dealing with this has always been
to use a local signature that's not exportable. Alternatively
changing the trust level on the key will do it or even changing the
trust model for the entire program to "trust-model always".
I tend to put all those rules into my gpg.conf file and these days
save myself a world of grief by running the aforementioned script.
Most of the time with just very rapid key presses on the "yes, I
really want to encrypt" question, with a handful of local signatures
(depending on the frequency of contact with the other party).
Rrgards,
Ben