pdobsan / oama

OAuth credential Manager
BSD 3-Clause "New" or "Revised" License
128 stars 10 forks source link

how to prevent GPG from prompting for passphrase on decrypt #64

Open nbi1 opened 1 week ago

nbi1 commented 1 week ago

Currently I see this in syslog when I attempt to send mail via msmtp:

dbus-daemon[1576]: [session uid=0 pid=1576] Activating service name='org.gnome.keyring.SystemPrompter' requested by ':1.1279' (uid=0 pid=74795 comm="pinentry --display :0.0") gcr-prompter[74801]: cannot open display: :1 dbus-daemon[1576]: [session uid=0 pid=1576] Activated service 'org.gnome.keyring.SystemPrompter' failed: Process org.gnome.keyring.SystemPrompter exited with status 1 gpg-agent[74795]: No Gcr System Prompter available, falling back to curses gpg-agent[74512]: failed to unprotect the secret key: Inappropriate ioctl for device gpg-agent[74512]: failed to read the secret key gpg-agent[74512]: command 'PKDECRYPT' failed: Inappropriate ioctl for device

So the msmtp invocation fails because oama fails due to GPG not being able to prompt successfully? Is there a clean mechanism by which oama can pass options to disable the prompt and get the info from a file? I know how to do this from the terminal command line, but the goal is to have scripted msmtp invocations taking place on a server. I'm trying to avoid hacks like rebuilding oama or filtering the decrypt call.

pdobsan commented 1 week ago

On Sun, Oct 13, 2024 at 01:20:10AM -0700, nbi1 wrote:

but the goal is to have scripted msmtp invocations taking place on a server

Use gpg-agent.