Using gpg with emacs mu4e and mbsync
famubu
famubu at disroot.org
Mon May 18 23:08:18 CEST 2026
> mbsync nows a command called `PassCmd`. You can use it in your
> .mbsyncrc file in your IMAPAccount section.
Yes, I am using that command like this:
```
PassCmd "gpg -q --for-your-eyes-only --pinentry-mode loopback -d
~/.authinfo.gpg | awk '/some regex/ {print $NF}'"
```
> But you should adapt it and not use --no--tty, --for-your-eyes-only as
I am getting problems when invoking mbsync (which in turn invokes gpg)
from emacs. With or without `--no-tty`.
Without `--no-tty`: I am prompted to enter the password, but it is
within an emacs buffer that is not editable. It should have appeared
in the minibuffer where we can actually type the password.
With `--no-tty` (same command as above):
```
gpg: Sorry, no terminal at all requested - can't get input
```
Almost all blog posts and forum entries that I came across uses
`--no-tty` though. I am not sure why.
Maybe it was needed for older versions of one of the software
involved.
Example posts:
- https://jherrlin.github.io/posts/emacs-mu4e/
- https://f-santos.gitlab.io/2020-04-24-mu4e.html
-
https://www.erichgrunewald.com/posts/setting-up-gmail-in-doom-emacs-using-mbsync-and-mu4e/
- https://github.com/danielfleischer/mu4easy
-
https://emacs.stackexchange.com/questions/53506/user-friendly-setup-of-emacs-with-gpg-mu4e-and-mu4e-send-delay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20260519/ad60a60b/attachment-0001.html>
More information about the Gnupg-users
mailing list