Default GPG key when multiple in same domain

Nik's Avatar


11 Dec, 2014 04:12 PM

when multiple keys from the same source domain are present in the same keychain, it seems to pick the last one alphabetically from that domain instead of matching the email address associated with the specific account when the feature to choose the key automatically is enabled. This results in having to always manually select the correct key from the drop down.

This is beta3

  1. 1 Posted by Nik on 12 Dec, 2014 04:55 PM

    Nik's Avatar

    I did some more investigation and I can give a more concrete recreate:

    1) I have two separate unique keys associated with separate email addresses under the same domain, but I think that might not be necessary.


     nik @
     help @

    The key is that nik @ is a user-id under both keys. In this case, I think gpgtools looks at the user-ids from all available keys and chooses maybe the last one it finds, and doesn't really look at the email associated with the key.

    If I remove the user-id nik @ from the help @ key, then gpgtools selects the nik @ key.

    The defect than is that the logic should look to the key's assocaited email to match the currently selected account's email address, and, if none match, falling back to user-ids under keys matching. Then those users will ask to be allowed to choose which one gets chosen ... or something but maybe that's a corner case.

    note: I put spaces and dummy domains around the emails to avoid spamming some random domain

  2. Support Staff 2 Posted by Steve on 10 Jan, 2015 07:00 PM

    Steve's Avatar

    Hi Nik,

    thanks for taking the time to report this problem.

    Does selecing a default key in GPGPreferences change anything for the better?

    I still agree we could have some better key management overall, but for this specific case setting a default key should do the trick.

    All the best,

  3. Support Staff 3 Posted by Steve on 11 May, 2015 08:02 PM

    Steve's Avatar

    Closing, since no further user feedback was received. Should your problem persist, feel free to re-open this discussion any time.

    All the best, steve

  4. Steve closed this discussion on 11 May, 2015 08:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac