Gpg, evolution email signing not working

I’m facing issues with Gpg signed emails in evolution on eos t2 distro.

Setup Gpg key: :white_check_mark:
Setup evolution to use key: :white_check_mark:
Send email: errors with

Detailed error: Output from gpg2:
gpg: enabled compatibility flags:
gpg: writing to '-'
gpg: pinentry launched (20093 curses 1.2.1 - - :0 - 1000/1000 0)
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device

Running on gnome Wayland.

Try to set this variable before you launch evolution or gnome

export GPG_TTY=$(tty)
1 Like

Thanks - that I found too, and did not work

However, this worked:

GPG_TTY=`tty`
export GPG_TTY

I am not entirely sure why. But it seems to have done the trick.

No, I spoke too darn soon

Worked until I rebooted.
Now the error is

You may need to select different mail options.

Detailed error: Output from gpg2:
gpg: enabled compatibility flags:
gpg: writing to '-'
gpg: pinentry launched (4866 curses 1.2.1-beta26 not a tty - :0 ? 1000/1000 0)
gpg: signing failed: No such file or directory
gpg: signing failed: No such file or directory

:exploding_head:

Works if I start the evolution app from terminal.

But then it asks a password for the signing (in the terminal) which it did not, before

This is all a **** incredible mess lol

I have to at least once start evolution in terminal, and at least once send an email and enter the pwd in the terminal.
Then, I can kill the terminal and use mail of evolution with key and it works without the pwd prompt or terminal startup.

This tells me 1) the session somehow saves the password that protects the key and B) the app is probably not really working since it needs to be started up in terminal (I would presume a path issue when started from gui?)

Do you have the password stored in the gnome keyring?

PS
It is working just fine for me with gnome and evolution.
There must be something wrong with your specific setup

I didn’t store the password - I just entered it when I generated the key itself. I’ll try to store it see if that helps.

Which evolution and which pinentry do you use? Yay or Flatpak/pinentry or pinentry-git?

I use regular Arch packages

evolution 3.50.1-1
evolution-bogofilter 3.50.1-1
evolution-data-server 3.50.1-2
evolution-spamassassin 3.50.1-1

I have not set any specific pinentry program in gpg-agent.conf

###+++--- GPGConf ---+++###
debug-level basic
log-file socket:///home/user/.gnupg/log-socket
default-cache-ttl 300
max-cache-ttl 3000
###+++--- GPGConf ---+++### Mi 05 Nov 2014 18:59:25 CET
# GPGConf edited this configuration file.
# It will disable options before this marked block, but it will
# never change anything below these lines.

EDIT
But I have the tool installed:

# ls -l /usr/bin/pinentry-gnome3
-rwxr-xr-x 1 root root 76240 2023-10-01@13:19 /usr/bin/pinentry-gnome3

from package pinentry 1.2.1-3

Exactly. And pinentry-gnome3 isn’t available on EndeavourOS t2 image.
At least not in yay/arch. Where did you get it from?

pinentry-gnome3, the binary, is provided by, pinentry, the package.

I mentioned it already:

1 Like

Now after another reboot, no changes made whatsover… it also does not work anymore even if started from terminal.

You may need to select different mail options.

Detailed error: Output from gpg2:
gpg: enabled compatibility flags:
gpg: writing to '-'
gpg: pinentry launched (4866 curses 1.2.1-beta26 not a tty - :0 ? 1000/1000 0)
gpg: signing failed: No such file or directory
gpg: signing failed: No such file or directory

If directly in terminal I run:
echo "test" | gpg --clearsign
I get:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

test
gpg: signing failed: No such file or directory
gpg: [stdin]: clear-sign failed: No such file or directory

I then changed the ~/.bash_profile to what @mbod suggested, and at this point the terminal command to gpg sign works.
And if I enter my password on the prompt, then open the Evolution mail, I can send gpg signed mails there too. Otherwise, not.

So, there is an issue in how Evolution reads the GPG_TTY variable and/or attemps to prompt for the password, I have no other way to explain this.

If I may ask:

  1. Do you have the password stored in the gnome keyring?
    ==> How exactly do I do this? Sorry, I have never used the “Passwords and Keys” application so far other than for this GPG key. It seems btw that this application is called seahorse. Are we talking about the same?
  2. How can I set GPG_TTY so that it is loaded when I log in, so that I do not have to invoke a terminal each time first?

Sorry if this are obvious things to you - this is my first time using these apps, and 15 years since using linux the last time :slight_smile:

hrrmm… So setting GPG_TTY in bashrc instead of the bash_profile resolves the issue of the need of sourcing bash_profile first.

I guess I will also find out how to avoid having to first pass the password at least once in the terminal :sweat_smile:

There we go

  1. Install evolution from yay
  2. Install pinentry from same
  3. Install seahorse from same
  4. Generate GPG Key in seahorse
  5. Configure Evolution mail to use said GPG key
  6. Ensure in your ~/.bashrc the GPG_TTY is set. It is important this is in bashrc and NOT in bash_profile.
  7. Ensure in your ~/.gnupg/gpg-agent.conf the gnome3 is enabled pinentry-program /usr/bin/pinentry-gnome3. This is the second crucial part.

Only then will Evolution be able to ask for the password, when run from the GUI.
It will ask once for that password (after each reboot or else event that kills gpg-agent).
That is not cool still, but acceptable.

:tada:

2 Likes