there may be two pubkeys that have the selection string in on of their user ids.
gpg -v --list-keys email@example.com
to see how many pubkeys it lists.
This is the simplest explanation for the behaviour you are describing.
many thanks for your information! I tested it and have to specify the matter: Assume I have the 3 public keys
and want to send an email to
the OpenPGP-plugin suggests to use the key of
Just to clarify in which component we need to look for the problem: The Problem is not that GpgOL automatically encrypts to “firstname.lastname@example.org” but that the interactive GUI selection dialog preselects “email@example.com” ?
A quick test on the command line shows to me that GnuPG selects the correct key “firstname.lastname@example.org” in your test scenario.
I’ve opened a ticket about this https://dev.gnupg.org/T3978
you are right: The “preselection” uses the wrong key!
Seems to be a problem in S/MIME usage, not in OpenPGP.