[Remail] [PATCH] Allow specifying path to the gpgbinary to use

Konstantin Ryabitsev konstantin at linuxfoundation.org
Mon Nov 11 19:51:30 CET 2019


We want to be able to support ECC subkeys, which limits us to gnupg
versions 2.2 and above. CentOS-7 ships with gnupg-2.0, which cannot be
easily upgraded to 2.2 due to a slew of potential problems, so we
install the newer version into /opt/gnupg22 and must call it as
/opt/gnupg22/bin/gpg.

This patch allows specifying gpg binary path to use instead of the
default "gpg" in $PATH.

Signed-off-by: Konstantin Ryabitsev <konstantin at linuxfoundation.org>
---
 Documentation/man5/remail_daemon.config.rst | 5 +++++
 remail/config.py                            | 1 +
 remail/gpg.py                               | 1 +
 3 files changed, 7 insertions(+)

diff --git a/Documentation/man5/remail_daemon.config.rst b/Documentation/man5/remail_daemon.config.rst
index ebe3959..e2c50bd 100644
--- a/Documentation/man5/remail_daemon.config.rst
+++ b/Documentation/man5/remail_daemon.config.rst
@@ -211,6 +211,7 @@ GPG options:
      gpg:
       always_trust:        True
       sign:                True
+      gpgbinary:           gpg
 
   always_trust:
 
@@ -228,6 +229,10 @@ GPG options:
    the public key of the list is not part of the welcome message which is
    sent to new recipients.
 
+  gpgbinary:
+
+   Path to the GnuPG binary to use, defaults to "gpg".
+
 The mailing lists collection:
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
diff --git a/remail/config.py b/remail/config.py
index 16422d0..a0bf7f8 100644
--- a/remail/config.py
+++ b/remail/config.py
@@ -211,6 +211,7 @@ class smime_config(object):
 gpg_defaults = {
     'always_trust'     : True,
     'sign'             : True,
+    'gpgbinary'        : 'gpg',
 }
 
 class gpg_config(object):
diff --git a/remail/gpg.py b/remail/gpg.py
index be6c033..35cbd42 100644
--- a/remail/gpg.py
+++ b/remail/gpg.py
@@ -25,6 +25,7 @@ class gpg_crypt(object):
         self.config = gpgcfg
         self.account = account
         self.gpg = gnupg.GPG(gnupghome=self.config.home,
+                             gpgbinary=self.config.gpgbinary,
                              keyring=self.config.keyring)
         self.keys = self.gpg.list_keys()
 

base-commit: 2b43bd77898a712fd87c09a368d90d2d0ba09ca0
-- 
2.23.0




More information about the Remail mailing list