From a035df85be2c6df7ce1d2b6ecafbc3adddcd2680 Mon Sep 17 00:00:00 2001 From: perennate Date: Mon, 23 Sep 2013 23:28:35 -0400 Subject: [PATCH] Add keymap_only configuration, to ignore public_keys list. This means the keymap will be exclusively used to determine which email addresses to sign with which keys. --- gpg-mailgate.conf.sample | 5 +++++ gpg-mailgate.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gpg-mailgate.conf.sample b/gpg-mailgate.conf.sample index 19dbadd..53d5fa8 100644 --- a/gpg-mailgate.conf.sample +++ b/gpg-mailgate.conf.sample @@ -3,6 +3,11 @@ # this may be useful for debugging purposes add_header = yes +# whether we should only sign emails if they are explicitly defined in +# the key mappings below ([keymap] section) +# this means gpg-mailgate won't automatically detect PGP recipients +keymap_only = no + [gpg] # the directory where gpg-mailgate public keys are stored # (see INSTALL for details) diff --git a/gpg-mailgate.py b/gpg-mailgate.py index 88652d6..47f3930 100755 --- a/gpg-mailgate.py +++ b/gpg-mailgate.py @@ -86,7 +86,7 @@ gpg_to = list() ungpg_to = list() for to in to_addrs: - if to in keys: + if to in keys and not ( cfg['default'].has_key('keymap_only') and cfg['default']['keymap_only'] == 'yes' ): gpg_to.append( (to, to) ) elif cfg.has_key('keymap') and cfg['keymap'].has_key(to): gpg_to.append( (to, cfg['keymap'][to]) )