Hi all, attached is a tiny patch which relaxes the selection of the private key in the identity setup dialogue. Currently, the user can only select a key with a uid which matches the account's email address. However, there are use-cases where this is not sufficient. At work, we have an isolated network with “internal” email addresses. Outgoing messages are re-written to public addresses, but the internal ones shall not be exposed to the outside world (see e.g. [1]), i.e. the key /must not/ carry a user-id for the internal address. Thus, neither auto-selection nor defining the key id in the gui works (it would be possible to run gpg[sm] on the console to print the id, and then copy it into the input field, though). The patch enables selecting any valid private key in the identity dialogue, but /not/ when a message shall be sent and the private key cannot be determined. Note that the vast majority of users will probably never use this feature, i.e. use automatic key selection (id is empty in the identity setup). Opinions? Cheers, Albrecht. [1] <http://www.postfix.org/ADDRESS_REWRITING_README.html#generic>
diff --git a/libbalsa/libbalsa-gpgme.c b/libbalsa/libbalsa-gpgme.c index 41dfe560f..c0b5fe737 100644 --- a/libbalsa/libbalsa-gpgme.c +++ b/libbalsa/libbalsa-gpgme.c @@ -771,8 +771,10 @@ libbalsa_gpgme_get_seckey(gpgme_protocol_t protocol, if (ctx != NULL) { GList *keys = NULL; - /* let gpgme list all available keys */ - if (libbalsa_gpgme_list_keys(ctx, &keys, NULL, name, TRUE, FALSE, FALSE, error)) { + /* Let gpgme list all available secret keys, including those not matching the passed email address. + * Rationale: enable selecting a secret key even if the local email address is re-written by the MTA. + * See e.g. http://www.postfix.org/ADDRESS_REWRITING_README.html#generic */ + if (libbalsa_gpgme_list_keys(ctx, &keys, NULL, NULL, TRUE, FALSE, FALSE, error)) { if (keys != NULL) { gpgme_key_t key;
Attachment:
pgpf8L14DYmva.pgp
Description: PGP signature