diff --git a/gpg-email-helper.py b/gpg-email-helper.py index a2839b5..46a0d12 100644 --- a/gpg-email-helper.py +++ b/gpg-email-helper.py @@ -21,6 +21,7 @@ with open(f'{XDG_DATA_HOME}/gpg-email-helper/log', 'a') as log: if email.rfind('-----BEGIN PGP PUBLIC KEY BLOCK-----') != -1 and email.rfind('-----END PGP PUBLIC KEY BLOCK-----') != -1: public_key = email[email.rfind( '-----BEGIN PGP PUBLIC KEY BLOCK-----'):email.rfind('-----END PGP PUBLIC KEY BLOCK-----')+35] + public_key = public_key.replace('=3D', '=') # quoted-printable attachments have the equals sign escaped as =3D apparently log.write( f'Attempted to import key from email: {gpg.Context(armor=True).key_import(public_key.encode())}\n')