neomutt and pinentry

scottro

Daemon

Reaction score: 550
Messages: 1,529

I've been having trouble making neomutt work with encryption. I had tried various things. In the end, I found a post about how neomutt doesn't work correctly with pinentry-tty, which is both a b-dep and r-dep for neomutt. The poster (they were using Mac OS had found that using pinentry-curses fixed his problem.

So, I found that using the standard .neomuttrc encryption lines, found at https://neomutt.org/test-doc/howto/encryption, along with installing pinentry-curses and creating a ~/.gnupg/gpg-agent.conf that reads
Code:
pinentry-program /usr/local/bin/pinentry-curses
and restarting the agent with
Code:
gpg-connect-agent reloadagent
made encryption with neomutt work for me. I haven't written the maintainer, as I've not seen mention
of the problem with FreeBSD, so suspect it's one of those Just Me(tm) problems, but figured I'd put it out here, in case other have problems.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,085
Messages: 33,642

I found a post about how neomutt doesn't work correctly with pinentry-tty, which is both a b-dep and r-dep for neomutt.
It's not? Not directly at least. I suspect it's GPG that's pulling it in, not neomutt itself.
 
OP
S

scottro

Daemon

Reaction score: 550
Messages: 1,529

I didn't investigate that part that deeply. Looked at neomutt Makefile and didn't see it, but I ran make search name=neomutt and pinentry-tty showed as b-dep and r-dep. But it definitely makes more sense that GPG is pulling it in. And... looking through the gnupg Makefile, sure enough one sees
Code:
RUN_DEPENDS=    pinentry:security/pinentry
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 9,085
Messages: 33,642

The default settings for security/pinentry has the ncurses option turned off:
Code:
     TTY=on: Console version
     NCURSES=off: Curses frontend
     FLTK=off: FLTK frontend
     GTK2=off: Gtk+ 2 frontend
     QT5=off: Qt 5 frontend
     GNOME3=off: GNOME 3 frontend
 
OP
S

scottro

Daemon

Reaction score: 550
Messages: 1,529

That would also explain it. I did it all from packages, and didn't even realize, till getting a bit lucky with searching yesterday, that pinentry was the culprit.
 

rigoletto@

Daemon
Developer

Reaction score: 1,130
Messages: 2,196

I used to use neomutt with pinentry-tty and it suddenly stopped working (some error message I don't remember) about a year ago, and since then it just works with pinentry-gtk2 for me (same error message to all others, I never tested FLTK).

I tried to debug the issue but didn't put any real effort on it and give it up.
 
OP
S

scottro

Daemon

Reaction score: 550
Messages: 1,529

After reading SirDice's post, just for fun on a test bhyve install, I installed pinentry from ports, selecting curses rather than the default tty, then installed neomutt. It all worked fine, even without the gpg-agent.conf file.
There's a bug somewhere, I think from December 2019, saying that neomutt doesn't work properly with pine-tty. However, your post indicates that that's not always true, as it worked for awhile. (I can't even find that bug again, not sure what search terms I used.)
Anyway, I've found the solution that works for me, both in a urxvt terminal and console. These days, it doesn't take much to make me happy. :)
 
Top