When sending encrypted mail, if keys are missing, fetch them from the network (WKD, DANE, etc)
Hello,
I'd like mutt to download GPG keys automatically using the new Web Key Directory protocol. WKD is enabled by default in GnuPG 2 and gaining significant adoption quickly (e.g. supported by Enigmail, OpenKeychain, and GpgOL).
Web Key Directory converts e-mail address to HTTPS URL and downloads the key from that URL. For example kernel.org has it enabled and Linus' key is at: https://kernel.org/.well-known/openpgpkey/hu/pf113mfnx1f3eb1yiwhsipa91xfc7o4x (gpg --locate-key torvalds@kernel.org will fetch that file).
Fortunately as mutt already uses gpgme the change required is just enabling support for it by adding gpgme_set_keylist_mode(ctx, GPGME_KEYLIST_MODE_LOCAL|GPGME_KEYLIST_MODE_EXTERN); in crypto-gpgme.c#get_candidates.
I've been working on a patch for that and there is one minor issue, crypt_add_string_to_hints that is used on parameters to gpg key list function will strip TLD from the e-mail address. For example user@example.com is converted to user@example. That works for keys in local keyring but will prevent WKD lookup (that needs complete e-mail address).
Do you think this change would be useful?