How to handle Multiple OfflineImap with Gpg stored Passwords?

0

I am using Offlineimap with gpgp stored passwords. Pretty similar to this setup

https://unix.stackexchange.com/questions/44214/encrypt-offlineimap-password

My issue is this. I have multiple email accoutns, and it is tedious to enter the same Gnupg password over and over again while trying to sync.

I tried the priming thing the user mentions in that article but it does not work me, in fact OfflineImap tries to pass the actual Gpg password to the mail server. So I assume that is botched.

The other issue is that I cannot use the Gnome Keyring type stuff because I do not have Gnome/Kde etc. I am using ssh terminal for that.

I am on Debian Wheezy 32b, it has Py 2.7

What are my options?

thanks

yarun can

Posted 2014-06-01T05:15:19.133

Reputation: 800

Are you using one or multiple keys for your mail addresses? If you're using a single key, you should be able to configure gpg-agent. If you're using multiple keys, you're probably out of luck. – Jens Erat – 2014-06-01T08:30:29.513

I am using single key however the solution has to be terminal friendly since I cant get gpg-agent window – yarun can – 2014-06-01T15:33:30.073

There is also a (n)curses based implementation, if you can have an interactive terminal (which you seem to have). – Jens Erat – 2014-06-01T16:52:29.290

If the hint on the curses-implementation worked for you, I will reformulate the comment as an answer. – Jens Erat – 2014-06-01T17:05:14.463

Jens thanks for the point, Iactually figured out after you mentioned it. Surprisinglu It works great! – yarun can – 2014-06-04T01:51:51.850

Answers

0

GnuPG 2 (in Debian and derivatives installed as gpg2) can connect with gpg-agent caching your passphrase. If you use a graphical user interface, you will probably know it from its key entry window, but there's also a command line version pinentry-curses, that does not require any window manager. In Debian and derrivative distributions, it's in the package pinentry-curses:

pinentry-curses - curses-based PIN or pass-phrase entry dialog for GnuPG

Make sure to configure it in .gnupg/gpg-agent.conf.

Jens Erat

Posted 2014-06-01T05:15:19.133

Reputation: 14 141

1

See the Arch Wiki for configuring gpg-agent

Install gnupg2 & change /usr/bin/gpg to be a symlink to /usr/bin/gpg2 (removing gnupg breaks Debian).

For anyone using duply on Debian Wheezy & having problems with pinentry-curses - use duply 1.9.0 not 1.5.5 in the repos (this fixes problems signing backups with gpg).

pinentry-curses now works without any problems when called programmatically. This also fixes gpg problems with fwknop

Stuart Cardall

Posted 2014-06-01T05:15:19.133

Reputation: 236