Using gpg with emacs mu4e and mbsync
Nils Schween
nils.schween at mpi-hd.mpg.de
Mon May 18 09:44:05 CEST 2026
Hi famubu,
mbsync nows a command called `PassCmd`. You can use it in your
.mbsyncrc file in your IMAPAccount section. Here is an example that I found:
PassCmd "gpg --decrypt --quiet --for-your-eyes-only --no-tty ~/.authinfo.gpg | grep -m 1 your-account-name | cut -d ' ' -f 8"
But you should adapt it and not use --no--tty, --for-your-eyes-only as
Werner wrote.
Best,
Nils
famubu via Gnupg-users <gnupg-users at gnupg.org> writes:
>> --for-your-eyes-only does nothin but setting "_CONSOLE" as embedded
>> filename - it is a useless option and is a PGP 2 legacy.
>
> I figured this would be needed since the man page mentions something
> about ensuring that no file is saved. I took it to mean that using
> this would be more secure.
>
>> Do not use --no-tty but use
>>
>> gpg -v --batch -d -o - ~/.authinfo.gpg
>
> Using `--batch` gave error: `Sorry, we are in batchmode - can't get input
> The command was: `gpg -q --batch --pinentry-mode loopback -d ~/file.gpg`
>
>> assuming that you want to see the output on stdout (it is actually the
>> default with -d but better better make it explicit).
>
> I need the output to be usable by mbsync. And mbsync would get the
> password via emacs. So I don't want the output on stdout.
>
> I had actually got this to work from within emacs at some point.
> But I suppose I ended up changing the config and messed it up.
> I tried different versions of the config that I ended up with by
> commenting/uncommenting out parts of it, but to no avail.
>
>> > use-agent
>> That is a no-op for many many years.
>
> Ah.. I now see in the man page about it being a dummy option.
>
>> Pretty please update to a current version (2.5.20). 2.2.7 is 8
>> years
>
> I was just using the gpg version available in my distro.
> Got to update to newer distro version. But been putting it off since I
> got to back up my files first.
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> https://lists.gnupg.org/mailman/listinfo/gnupg-users
--
Nils Schween
PhD Student
Phone: +49 6221 516 557
Mail: nils.schween at mpi-hd.mpg.de
PGP-Key: 4DD3DCC0532EE96DB0C1F8B5368DBFA14CB81849
Max Planck Institute for Nuclear Physics
Astrophysical Plasma Theory (APT)
Saupfercheckweg 1, D-69117 Heidelberg
https://www.mpi-hd.mpg.de/mpi/en/research/scientific-divisions-and-groups/independent-research-groups/apt
More information about the Gnupg-users
mailing list