there may be two pubkeys that have the selection string in on of their user ids.
gpg -v --list-keys firstname.lastname@example.org
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 “email@example.com” but that the interactive GUI selection dialog preselects “firstname.lastname@example.org” ?
A quick test on the command line shows to me that GnuPG selects the correct key “email@example.com” 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.