From 52bdb3163776f7281346bbe50d368de5f2cf215a Mon Sep 17 00:00:00 2001 From: perennate Date: Sun, 22 Sep 2013 15:14:09 -0400 Subject: [PATCH] Don't encrypt if it's a signed message, since that would mess with the signature. --- gpg-mailgate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gpg-mailgate.py b/gpg-mailgate.py index 456420f..8e132ef 100755 --- a/gpg-mailgate.py +++ b/gpg-mailgate.py @@ -47,7 +47,7 @@ def send_msg( message, recipients = None ): def encrypt_payload( payload, gpg_to_cmdline ): gpg = GnuPG.GPGEncryptor( cfg['gpg']['keyhome'], gpg_to_cmdline, payload.get_content_charset() ) raw_payload = payload.get_payload(decode=True) - if "-----BEGIN PGP MESSAGE-----" in raw_payload and "-----END PGP MESSAGE-----" in raw_payload: + if ("-----BEGIN PGP MESSAGE-----" in raw_payload and "-----END PGP MESSAGE-----" in raw_payload) or ("-----BEGIN PGP SIGNED MESSAGE-----" in raw_payload): return payload gpg = GnuPG.GPGEncryptor( cfg['gpg']['keyhome'], gpg_to_cmdline, payload.get_content_charset() ) gpg.update( raw_payload )